[release-5.0] OCPBUGS-112659: Remove the CRB for the default openshift-cluster-version SA - #1454
Conversation
To ensure the default SA does not have cluster admin permissions. To achieve this, rendering logic needs to be updated as well. During cluster bootstrap, the installer calls rendering commands of specific components required for the bootstrap [1]. These rendered manifests are then applied by the cluster-bootstrap component [2]. The cluster-bootstrap component applies all the non-bootstrap manifests as they are [3]. At no stage is the delete annotation [4] taken into account, and thus the CRB would keep getting applied during installations and getting removed only during cluster upgrades due to the annotation. This would prohibit us from ever removing the manifest file from the repository, as a freshly installed cluster upgrading to a version where manifest does not exist would result in the CRB being applied till manually removed, causing a security concern. Teach the rendering command to respect the delete annotation to allow us to remove such manifests. Add the delete annotation and move the CRB into a lower run-level where we can safely remove manifests and not take up space in the used levels. [1]: https://github.com/openshift/installer/blob/c93ae9fc74d7fa0f478fa250de2ba702f84a0a21/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template [2]: https://github.com/openshift/installer/blob/c93ae9fc74d7fa0f478fa250de2ba702f84a0a21/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template#L576 [3]: https://github.com/openshift/cluster-bootstrap/blob/b23c6ce3df43aed15158e999239694ec75371f18/pkg/start/start.go#L142 [4]: https://github.com/openshift/enhancements/blob/master/enhancements/update/object-removal-manifest-annotation.md
The installer renders the CVO bootstrap manifests into its bootstrap-manifests directory [1], where bootstrap manifests of other related componenets are rendered as well by their respective bootstrap commands. The directory is then consumed by the cluster-bootstrap component [2]. The cluster-bootstrap component copies these manifests to the static Pod path of the node's kubelet [3]. As such, static Pods have some notable details, such as: > The spec of a static Pod cannot refer to other API objects > (e.g., ServiceAccount, ConfigMap, Secret, etc). [4] Mention this in the manifest to save some time for future developers. [1]: https://github.com/openshift/installer/blob/c93ae9fc74d7fa0f478fa250de2ba702f84a0a21/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template#L192 [2]: https://github.com/openshift/installer/blob/c93ae9fc74d7fa0f478fa250de2ba702f84a0a21/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template#L576 [3]: https://github.com/openshift/cluster-bootstrap/blob/dc0d4a5cdaf8a7477cab584208dc99352f46efe2/pkg/start/bootstrap.go#L52-L60 [4]: https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-80925 has been cloned as Jira Issue OCPBUGS-112659. Will retitle bug to link to clone. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-112659, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
wking
left a comment
There was a problem hiding this comment.
/lgtm
/jira refresh
/label backport-risk-assessed
|
@wking: This pull request references Jira Issue OCPBUGS-112659, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: openshift-cherrypick-robot, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Verification to follow this precedent once the CI runs have completed. |
|
@openshift-cherrypick-robot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #1366
/assign wking