Shuzheng
Shuzheng

Reputation: 14018

How to enable anonymous authentication for Kubernetes cluster using kops?

I want to enable anonymous authentication using kops, but it's default settings provides the --anonymous-auth=false options to kube-apiserver:

/usr/local/bin/kube-apiserver --allow-privileged=true --anonymous-auth=false --apiserver-count=1 --authorization-mode=RBAC --basic-auth-file=/srv/kubernetes/basic_auth.csv --bind-address=0.0.0.0 --client-ca-file=/srv/kubernetes/ca.crt

How can I change this setting, either for my current cluster or by creating a new cluster?

Upvotes: 1

Views: 3104

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44657

You can ssh to master nodes and modify the kube-apiserver.yaml in /etc/kubernetes/manifests and add that flag.

spec:
  containers:
  - command:
  - --anonymous-auth=true

Then you need to restart your kube-apiserver.

This could vary depending on what you are running in your masters. If something like docker you can do sudo systemctl restart docker or you might need to restart containerd if you are using it instead of docker systemctl restart containerd

Or if you want to just start the kube-apiserver you can do docker restart kube-apiserver or crictl stop kube-apiserver; crictl start kube-apiserver.

Upvotes: 4

Related Questions