Is is possible to allow for completely unauthenticated requests to my dev enviro . . .

Dean H:
Is is possible to allow for completely unauthenticated requests to my dev environment? Currently I’m getting 401 even though the only authorization mode is AlwaysAllow:

root@cks-master:~# k get pods -n kube-system -l component=kube-apiserver -o yaml | grep -C3 authorization-mode
      - kube-apiserver
      - --advertise-address=
      - --allow-privileged=true
      - --authorization-mode=AlwaysAllow
      - --client-ca-file=/etc/kubernetes/pki/ca.crt
      - --enable-admission-plugins=NodeRestriction
      - --enable-bootstrap-token-auth=true

root@cks-master:~# curl <https://localhost:6443/apis> -k
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  "status": "Failure",
  "message": "Unauthorized",
  "reason": "Unauthorized",
  "code": 401

I’ve also altered the kubelet.conf file:

root@cks-master:/etc/kubernetes/manifests# cat /var/lib/kubelet/config.yaml | grep anonymous -A 5 -B 5
apiVersion: <|>
    enabled: true
cgroupDriver: systemd
clusterDomain: cluster.local

Kubelet.conf settings are for authenticating the user against kubelet.

That wont affect authentication to kube-apiserver.

I tested this by setting anonymous-auth and authorization-mode to true and somehow anonymous requests are still failing with “unauthorized message”. But any other user (ie default service account with its token) can query the API for anything and gets authenticated and authorized. It must be something with anonymous user that it still is limited even when you enable authorization-mode=alwaysallow in kube-api. The only other option I can think of is disabling https on kube-api which I am sure would work. But curious why it did not work for anonymous requests when I enabled anonymous-auth and authorization mode to alwaysallow in kube-api.

@Mumshad Mannambeth @Vijin Palazhi can you please comment ?

Mumshad Mannambeth:
@wahlberg Correct. @Dean H you have only disabled Authorization. Authentication is still required.

Mumshad Mannambeth:
What is --anonymous-auth set to on the kubeapi-server?

In my lab both --anonymous-auth is set to true and --authorization-modeis AlwaysAllow and when I do curl <https://localhost:6443/version> -k I still get failure unauthorized message. If I revert authorization mode back to Node,RBAC then the same API call works with a proper response.

It seems like even when authorization mode is set to AlwaysAllow it does not apply to anonymous requests. As if kube-apiserver does NOT authorize anonymous requests even when the authorization mode is AlwaysAllow.