“kubectl exec” results in “error: unable to upgrade connection: Unauthorized”

后端 未结 3 495
野趣味
野趣味 2021-01-13 11:21

I tried kubectl exec on a k8s 1.6.4 RBAC-enabled cluster and the error returned was: error: unable to upgrade connection: Unauthorized. docke

3条回答
  •  我在风中等你
    2021-01-13 11:53

    This is an RTFM moment... The solution was basically to follow all the steps on this page for authn, authz, or both.

    I had omitted --kubelet-client-certificate and --kubelet-client-key which resulted in the error. Without these flags, kube-apiserver will fail to authenticate with kubelet when you do a kubectl exec.

    My original attempt to configure authn was by reading the docs for the kubelet daemon (ie. not the one above). Hence the grave omission.

提交回复
热议问题