Kubernetes not found on skaffold dev command

616 Views Asked by At

I get this error when running skaffold dev command:

  • stdout: ""
  • stderr: "The connection to the server localhost:8080 was refused - did you specify the right host or port?\n"
  • cause: exit status 1 subtask=-1 task=DevLoop unable to connect to Kubernetes: getting client config for Kubernetes client: error creating REST client config in-cluster: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined

Should i set up the env variables?

1

There are 1 best solutions below

0
On

For anyone facing something like this, try adding:

owner @{HOME}/.minikube/certs/* to /var/lib/snapd/apparmor/profiles/snap.docker.docker

and then run

apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.docker.docker