Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with RBAC ClusterRoleBinding in section #8 #746

Open
jon-small opened this issue Oct 15, 2023 · 0 comments
Open

Error with RBAC ClusterRoleBinding in section #8 #746

jon-small opened this issue Oct 15, 2023 · 0 comments

Comments

@jon-small
Copy link

I'm following this guide for the first time and came across an issue in the RBAC section of step 8 I wanted to make you aware of. With my config (K8s v1.28), using 'namespace=""' in the ClusterRoleBinding will error out with the following:

pi@controller1:~ $ cat <<EOF | kubectl apply --kubeconfig admin.kubeconfig -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:kube-apiserver
  namespace: ""
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:kube-apiserver-to-kubelet
subjects:
  - apiGroup: rbac.authorization.k8s.io
    kind: User
    name: kubernetes
EOF
Error from server: error when retrieving current configuration of:
Resource: "rbac.authorization.k8s.io/v1, Resource=clusterrolebindings", GroupVersionKind: "rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding"
Name: "system:kube-apiserver", Namespace: ""
from server for: "STDIN": etcdserver: leader changed

I removed the 'namespace=""' line from the config and it worked properly:

pi@controller1:~ $ cat <<EOF | kubectl apply --kubeconfig admin.kubeconfig -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: system:kube-apiserver
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:kube-apiserver-to-kubelet
subjects:
  - apiGroup: rbac.authorization.k8s.io
    kind: User
    name: kubernetes
EOF
clusterrolebinding.rbac.authorization.k8s.io/system:kube-apiserver created

My Setup:

Thank you for this guide and the continuing maintenance of it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant