User \"system:anonymous\" cannot get path \"/\"


I start to learn kubernetes. I follow a tutorial but I can't reproduce the step. I just install the kubectl and minikube, start minikube with docker as driver and run a pod.

filip@filip-pc:~/Desktop$ kubectl get pods
my-apache   1/1     Running   0          5h7m
my-nging    1/1     Running   0          4h59m
filip@filip-pc:~/Desktop$ kubectl scale --replicas=2 my-apache
error: the server doesn't have a resource type "my-apache"
filip@filip-pc:~/Desktop$ kubectl cluster-info
Kubernetes master is running at
KubeDNS is running at

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

I can se a pod but I can't manage it. if I follow the link I get an error

  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {
  "code": 403

I do a short research on this error but the solutions that I found don't work for me. As I mention I am new to kubernetes but I understant that is a privilege issue but the user that I use have rights

filip@filip-pc:~/Desktop$ kubectl auth can-i create deployments --namespace dev
filip@filip-pc:~/Desktop$ kubectl auth can-i create deployments --namespace prod
-- Filip Laurentiu

1 Answer


Don't know which tutorial you are following and not sure how you created the pod but if it worked for them and it doesn't work for you then the issue is probably in that you are running newer version of kubernetes.

Using kubectl run ... used to create pod as well as replication controller. Nowadays (since 1.18) it only creates a single pod. You need either replication controller (deprecated), or relicaset or deployment in order to scale it. You can't scale a single pod (pod resource doesn't have a concept of replicas that you might scale - increase/decrease).

You can replace the old run command with

kubectl create deployment myapache --image=httpd

and the scale it with

kubectl scale deployment myapache --replicas=2

It is not exactly the same as using the old run command but it is close.

-- Matus Dubrava
Source: StackOverflow