Issue while setting up Meshery with microk8s

Issue: Facing an issue while setting up Meshery on my system, using kubernetes!
Previously, i used Docker-desktop to do so & that is working successfully. But recently i setup microk8s!
Although the cluster is running, its showing the following result with mesheryctl system start.

Discussion on Slack (potential solutions)

  1. @Yash_Kamboj suggested to check whether Docker was running successfully
    => Yes, it was:
  1. @alphaX86 suggested to refine the ~/.kube/config file to use the microk8s cluster instead of Docker desktop cluster Or one could try changing the k8s context to microk8s in the docker desktop app.
    => Going through the ~/.kube/config, we noticed that microk8s was not mentioned there! (i.e it wasn’t configured)

~/.kube/config output:

    server: https://kubernetes.docker.internal:6443
  name: docker-desktop
contexts:
- context:
    cluster: docker-desktop
    user: docker-desktop
  name: docker-desktop
current-context: docker-desktop
kind: Config
preferences: {}
users:
- name: docker-desktop
  user:
    client-certificate-data: 
  1. @alphaX86 shared that, microk8s it’s bit different than other k8s cluster and operating it is totally different because of its own version of kubectl

Solution: Therefore, copying the config content via referring the microk8s docs (topic: Working with kubectl), then setting current context to microk8s in the config should work!
That is, merging the output from the microk8s config with the existing config (~/.kube/config)

This worked & the ~/.kube/config output is:

    server: https://192.168.117.4:16443
  name: microk8s-cluster
contexts:
- context:
    cluster: docker-desktop
    user: docker-desktop
  name: docker-desktop
- context:
    cluster: microk8s-cluster
    user: admin
  name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
  user:
    token: MlBBNTdnT3VtLzIyQXpXRkc4bDU2SmlTU01qcTZ4V3BHVkFrRi8yV3pzZz0K
- name: docker-desktop
  user:
    client-certificate-data: 

Now, it has microk8s as a context here!

Running Meshery again: (Successfull)

1 Like

Small note : This troubleshooting method works for almost all k8s clusters and not just microk8s (some properties may change, but method stays the same). Hope this helps :wink:

1 Like