简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM