|
| 1 | +# As of Cluster API v1.14.0 (kubernetes-sigs/cluster-api#13433, "Write kubeadm |
| 2 | +# control plane version file for workers to use to fetch the matching kubeadm |
| 3 | +# binary") the kubeadm bootstrap controller resolves the control-plane Kubernetes |
| 4 | +# version by reading the object referenced by `Cluster.spec.controlPlaneRef`. |
| 5 | +# When a Cluster uses a KamajiControlPlane, the bootstrap controller issues a |
| 6 | +# `get kamajicontrolplanes.controlplane.cluster.x-k8s.io`, which otherwise fails |
| 7 | +# with: |
| 8 | +# failed to read control plane version: ... kamajicontrolplanes... is forbidden: |
| 9 | +# User "system:serviceaccount:capi-kubeadm-bootstrap-system:capi-kubeadm-bootstrap-manager" |
| 10 | +# cannot get resource "kamajicontrolplanes" in API group "controlplane.cluster.x-k8s.io" |
| 11 | +# |
| 12 | +# The bootstrap controller reads via an APIReader (no /status), so the |
| 13 | +# get/list/watch rules already present in capi_role.yaml are sufficient; we bind |
| 14 | +# that same ClusterRole to the kubeadm bootstrap manager ServiceAccount. |
| 15 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 16 | +kind: ClusterRoleBinding |
| 17 | +metadata: |
| 18 | + labels: |
| 19 | + app.kubernetes.io/name: clusterrolebinding |
| 20 | + app.kubernetes.io/instance: manager-rolebinding |
| 21 | + app.kubernetes.io/component: rbac |
| 22 | + app.kubernetes.io/created-by: cluster-api-control-plane-provider-kamaji |
| 23 | + app.kubernetes.io/part-of: cluster-api-control-plane-provider-kamaji |
| 24 | + app.kubernetes.io/managed-by: kustomize |
| 25 | + name: capi-kamaji-control-plane-kubeadm-bootstrap-rolebinding |
| 26 | +roleRef: |
| 27 | + apiGroup: rbac.authorization.k8s.io |
| 28 | + kind: ClusterRole |
| 29 | + name: capi-kamaji-control-plane-role |
| 30 | +subjects: |
| 31 | +- kind: ServiceAccount |
| 32 | + name: capi-kubeadm-bootstrap-manager |
| 33 | + namespace: capi-kubeadm-bootstrap-system |
0 commit comments