I have created the k8s cluster with one master node and two worker nodes using ubuntu vms using Microk8s. Now Every time I have to use microk8s before kubectl. for ex: microk8s kubectl get nodes
For this I have used below command to use kubectl directly on the three nodes. sudo snap alias microk8s.kubectl kubectl
In Master node it is working fine. root@controller:/home/kundurusrikanthreddy9# kubectl get nodes NAME STATUS ROLES AGE VERSION worker-2 Ready worker 22m v1.26.1 controller Ready master 26m v1.26.1 worker-1 Ready worker 22m v1.26.1
But while giving the same command in worker nodes it is showing the output as below undurusrikanthreddy9@worker-1:~$ sudo microk8s kubectl get node This MicroK8s deployment is acting as a node in a cluster. Please use the microk8s kubectl on the master.
How can I resolve this issue.
Can anyone help me on this?
I am expecting the resolution or what causing the issue