-
Notifications
You must be signed in to change notification settings - Fork 217
OCPBUGS-65621: add dedicated service account to crb, cvo and version pod #1266
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
base: main
Are you sure you want to change the base?
Changes from all commits
bf44d47
29bce17
2982ece
ca25977
825ac61
446f19b
bb1602f
d7e4cd0
5641681
5fe9198
6310c45
b39df2b
7d69c50
0c875cc
7b05705
31c2b46
9002190
38530cd
a575e1c
fc55fa5
7be8122
d677a46
6e3595e
63774e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: cluster-version-operator | ||
| namespace: openshift-cluster-version | ||
| annotations: | ||
| kubernetes.io/description: Dedicated Service Account for the Cluster Version Operator. | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: update-payload | ||
| namespace: openshift-cluster-version | ||
| annotations: | ||
| kubernetes.io/description: Dedicated Service Account for the Update Payload. | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ spec: | |
| k8s-app: cluster-version-operator | ||
| spec: | ||
| automountServiceAccountToken: false | ||
| serviceAccountName: cluster-version-operator | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you either add this to the bootstrap manifest too, or have a commit message that mentions why we don't need a service account for that bootstrap manifest? In that vein, you might want to reshuffle your existing commit stack to try and tell the transformation story in a more narrative arc. It is completely fine to take a bunch of commits, if you need more space to talk about each pivot in a series. But at the moment, there are things like fc55fa5, which sounds like useful context to include in a "why I did things this way..." commit message in a commit that adds the new role-bindings. But I don't see a benefit to keeping it completely separate, vs. having a single commit that brings in the finished roll bindings and then explains all the context you need to explain that finished shape.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added it to the bootstrap manifest. I'll wait to see how tests behave before squashing the commits into a narrative commit, or a collection of them depending. |
||
| containers: | ||
| - name: cluster-version-operator | ||
| image: '{{.ReleaseImage}}' | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: ClusterRoleBinding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: cluster-version-operator-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include.release.openshift.io/self-managed-high-availability: "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subjects: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - kind: ServiceAccount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: cluster-version-operator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace: openshift-cluster-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| roleRef: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: ClusterRole | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: cluster-admin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiGroup: rbac.authorization.k8s.io | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # apiVersion: rbac.authorization.k8s.io/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # kind: ClusterRoleBinding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # name: cluster-version-operator-payload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # annotations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # include.release.openshift.io/self-managed-high-availability: "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # subjects: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - kind: ServiceAccount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # name: update-payload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # namespace: openshift-cluster-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # roleRef: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # kind: ClusterRole | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # name: cluster-admin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # apiGroup: rbac.authorization.k8s.io | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: ClusterRoleBinding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: cluster-version-operator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kubernetes.io/description: Grant the cluster-version operator permission to perform cluster-admin actions while managing the OpenShift core. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include.release.openshift.io/self-managed-high-availability: "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| release.openshift.io/delete: "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| roleRef: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: ClusterRole | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: cluster-admin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subjects: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - kind: ServiceAccount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace: openshift-cluster-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: For Minimal schema (YAML shape): apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: <binding-name>
roleRef: # required
apiGroup: rbac.authorization.k8s.io # required
kind: ClusterRole # required (ClusterRoleBinding -> ClusterRole)
name: <clusterrole-name> # required
subjects:
- kind: User|Group|ServiceAccount
name: <subject-name>
namespace: <ns> # only for ServiceAccount
apiGroup: rbac.authorization.k8s.io # for User/Group (not used for ServiceAccount)
``` [1], [2]
**Key point:** `roleRef.apiGroup` is not optional—set it to **`rbac.authorization.k8s.io`** for RBAC Role/ClusterRole references. [1], [2]
Sources:
[1] Kubernetes RBAC reference / ClusterRoleBinding fields (roleRef + required subfields) ([dev-k8sref-io.web.app](https://dev-k8sref-io.web.app/docs/authorization/clusterrolebinding-v1/?utm_source=openai))
[2] Kubernetes RBAC docs (ClusterRoleBinding example; roleRef immutability) ([v1-32.docs.kubernetes.io](https://v1-32.docs.kubernetes.io/docs/reference/access-authn-authz/rbac/?utm_source=openai))
Citations:
- 1: https://dev-k8sref-io.web.app/docs/authorization/clusterrolebinding-v1/?utm_source=openai
- 2: https://v1-32.docs.kubernetes.io/docs/reference/access-authn-authz/rbac/?utm_source=openai
---
</details>
**Add missing `roleRef.apiGroup` to avoid invalid ClusterRoleBinding.**
The `roleRef` field omits `apiGroup`, which is a required field in the Kubernetes RBAC schema for ClusterRoleBinding. This omission will cause validation failures when the manifest is applied or schema-checked. Set it to `rbac.authorization.k8s.io`.
<details>
<summary>Proposed fix</summary>
```diff
roleRef:
kind: ClusterRole
name: cluster-admin
+ apiGroup: rbac.authorization.k8s.io📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.