howto

K8 Dashboard on Docker Desktop

what’s going on

tags
kubernetes
docker

Pretty easy to setup, but here are the steps.

Docker Desktop

To easily get going on a local Mac, you can install the compoents using homebrew.

1
2
3
  brew install --cask docker
  brew install kubernetes-cli
  brew install kn

Start up Docker, and then turn on kubernetes and make sure that you have a running node.

1
  kubectl get nodes
NAME             STATUS   ROLES                  AGE     VERSION
docker-desktop   Ready    control-plane,master   5h59m   v1.21.5

Install kubenetes dashboard

It's nice to have a local dashboard to see whats' going on.

1
  kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml

Then create a service account account.yaml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  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

Apply it:

1
  kubectl apply -f account.yaml

Then you can get the token into your clipboard:

1
2
3
4
  kubectl -n kubernetes-dashboard get secret \
          $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") \
          -o go-template="{{.data.token | base64decode}}" | \
    pbcopy

Finally, setup a proxy to access the dashboard:

1
kubectl proxy &

And point your browser to http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

Previously

howto

Getting emacs working on OSX Monterey

security and permissions

tags
emacs
osx
homebrew

Next

howto

Setting up knative

functions functions functions

tags
kubernetes
helm
knative