Add projected SA token support to controller-manager chart (#6873)#6889
Open
ti-chi-bot wants to merge 1 commit into
Open
Add projected SA token support to controller-manager chart (#6873)#6889ti-chi-bot wants to merge 1 commit into
ti-chi-bot wants to merge 1 commit into
Conversation
FedRAMP Gatekeeper can require controller-manager pods to disable automatic service account token mounting. The controller still uses in-cluster Kubernetes authentication, so when automatic mounting is disabled the chart needs to provide the same token, CA, and namespace files through an explicit projected volume. The tidb-operator chart now exposes controllerManager.automountServiceAccountToken, defaults it to true to preserve existing behavior, and mounts a projected service account token volume when it is set to false. Constraint: FedRAMP block-automount-serviceaccount-token-pod policy rejects automatic service account token mounting Rejected: Require users to patch controller-manager-deployment.yaml locally | keeps FedRAMP deployments on an unreviewed chart fork Confidence: high Scope-risk: narrow Directive: Keep the projected volume path aligned with Kubernetes' default service account token path because client-go in-cluster config reads from there Tested: helm lint charts/tidb-operator Tested: helm template test charts/tidb-operator --namespace tidb-admin Tested: helm template test charts/tidb-operator --namespace tidb-admin --set controllerManager.automountServiceAccountToken=false Tested: git diff --check
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Member
|
/retest |
Member
|
retest |
Member
|
/retest |
Member
|
/test pull-e2e-kind-br |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #6873
What problem does this PR solve?
FedRAMP Gatekeeper can enforce
block-automount-serviceaccount-token-pod, requiring controller-manager pods to run withautomountServiceAccountToken: false.When automatic service account token mounting is disabled, controller-manager still needs the standard in-cluster credential files under
/var/run/secrets/kubernetes.io/serviceaccountso client-go can authenticate to the Kubernetes API.What is changed and how does it work?
This adds
controllerManager.automountServiceAccountTokento the tidb-operator chart, defaulting totrueto preserve current behavior.When set to
false, the chart renders:automountServiceAccountToken: falsein the controller-manager pod specsa-tokenvolumeMount at/var/run/secrets/kubernetes.io/serviceaccounttokenkube-root-ca.crtconfigmap item atca.crtnamespaceExample:
Check List
Tests
Side effects
Release note
Verification
helm lint charts/tidb-operatorhelm template test charts/tidb-operator --namespace tidb-adminhelm template test charts/tidb-operator --namespace tidb-admin --set controllerManager.automountServiceAccountToken=falsegit diff --check