This message was deleted.
# k3d
a
This message was deleted.
w
Nope, there's only k3x and vscode-k3d as far as I know
c
I installed it. It is running. It appeared in system tray as icon (Fedora Linux). I created a cluster: "k3s-cluster-432" How can I see it? 🙂
Where can I see it? In browser?
w
What do you want to see? I guess you're searching for a UI to see Kubernetes resources? 🤔 You may want to look into Lensapp, Okteto or just the Kubernetes dashboard
c
k3x system tray icon refer to a dashboard. But I can't find it. :(
w
It's been a while since I last used k3x... I'm not sure tbh. Yeah, that would be the dashboard deployed into the cluster. I guess Lens or Okteto would be easier to use for a start though.
c
I try the Kubernetes Dashboard: https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ I need create a user with token: https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md • Creating a Service Account • Creating a ClusterRoleBinding • ~# kubectl -n kubernetes-dashboard create token admin-user • ~# kubectl proxy • URL like this: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ • So, I can login with token. Right?
The ~/.kube/config like this: apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0............. server: https://0.0.0.0:33721 name: k3d-mycluster contexts: - context: cluster: k3d-mycluster user: admin@k3d-mycluster name: k3d-mycluster current-context: k3d-mycluster kind: Config preferences: {} users: - name: admin@k3d-mycluster user: client-certificate-data: LS0..... client-key-data: LS0t............ # -----------------------------------------------------------------------
I need create "dashboard-adminuser.yaml":
Copy code
apiVersion: v1
kind: ServiceAccount
metadata:
  # name: admin-user
  name: admin@k3d-mycluster 
  namespace: kubernetes-dashboard
and apply it: ~# kubectl apply -f dashboard-adminuser.yaml
How can I use the ClusterRoleBindig yaml file?
Copy code
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: ClusterRoleBinding
metadata:
  # name: admin-user
  name: admin@k3d-mycluster 
roleRef:
  apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  # name: admin-user
  name: admin@k3d-mycluster 
  namespace: kubernetes-dashboard
Is it again? kubectl apply -f clusterrolebinding.yaml
and last(?): ~# kubectl -n kubernetes-dashboard create token admin-user (what will generate a token, that I can use at login.)
w
Ah, do you expect Rancher to be pre-installed in the k3d cluster? Because that's not the case 🤔
c
"k3d cluster create mycluster" okay.
Copy code
kubectl apply -f <https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml>
it is okay too.
The dashboard is running, but I need login token.
w
Ah that's kubectl proxy, sorry
So yeah, you create the user account and the clusterrolebinding and then generate the token, just as you wrote above
Where are you struggling?
c
I need to replace this line?
Copy code
# name: admin-user
  name: admin@k3d-mycluster
everything else is okay?
I do not replaced any lines in two yaml files. It is working, I can login with token. 🙂 thanks!