Last active
July 11, 2023 22:50
Talos on Docker-Desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: admin-user | |
namespace: kubernetes-dashboard | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: admin-user | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-admin | |
subjects: | |
- kind: ServiceAccount | |
name: admin-user | |
namespace: kubernetes-dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Deploy Cluster | |
talosctl cluster create --workers 2 --controlplanes 3 --control-plane-port 6444 --wait | |
# Will show an error because it tries to connect to port 6443, which you can ignore. | |
sed -i.bak 's/talos-default/talos-docker-desktop/g' ~/.talos/config | |
talosctl config context talos-docker-desktop | |
talosctl config node 127.0.0.1 | |
talosctl health | |
rm -f ~/.kube/config.d/talos-docker-desktop.yaml | |
talosctl kubeconfig ~/.kube/config.d/talos-docker-desktop.yaml | |
sed -i.bak '/^current-context/d' ~/.kube/config.d/talos-docker-desktop.yaml | |
sed -i.bak 's/talos-default/talos-docker-desktop/g' ~/.kube/config.d/talos-docker-desktop.yaml | |
kubectl config use-context admin@talos-docker-desktop | |
kubectl get nodes -o wide | |
### Dashboard | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml | |
kubectl apply -f https://gist.githubusercontent.com/jeroenvermeulen/f7e4e06c7c82fdb147f45a0097feea4c/raw/77c72579db976d9b3698d42685b559b6c442bca6/serviceaccount.yaml | |
kubectl -n kubernetes-dashboard create token admin-user | |
kubectl proxy | |
# Go to URL: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment