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

Missing RBAC configuration #1415

Open
sempex opened this issue Feb 11, 2025 · 0 comments
Open

Missing RBAC configuration #1415

sempex opened this issue Feb 11, 2025 · 0 comments

Comments

@sempex
Copy link

sempex commented Feb 11, 2025

The helm chart of cloud-provider-vsphere is missing quite an important bit of RBAC rules. Your pod's won't start by default it will throw something like:

Unable to get configmap/extension-apiserver-authentication in kube-system.  Usually fixed by '
kubectl create rolebinding -n kube-system ROLEBINDING_NAME --role=extension-apiserver-authentication-reader --serviceaccount=YOUR_NS:YOUR_SA'
unable to load configmap based request-header-client-ca-file: configmaps "extension-apiserver-authentication" is forbidden: User "system:serviceaccount:kube-
vsphere-cpi:cloud-controller-manager" cannot get resource "configmaps" in API group "" in the namespace "kube-system"

There is additional Configuration needed, that it can read it's own configmap holding the configuration for the cloud-provider-vsphere for example:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cpi-configmap-reader
rules:
- apiGroups: [""]
  resources: ["configmaps"]
  verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: configmap-reader-cloud-controller-manager
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cpi-configmap-reader
subjects:
- kind: ServiceAccount
  name: cloud-controller-manager
  namespace: kube-vsphere-cpi
- kind: User
  name: cloud-controller-manager
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: cloud-controller-manager

With that the operator is able to read it's own configuration, it requires "watch" as well, to watch the extension-apiserver-authentication configmap in the kube-system namespace. Although I didn't find out what that one is used for yet.

I would suggest to implement this in some form into the helm chart. I can create a MR for it if this is wanted. Let me know if you need a MR 💯

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