-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
🐛: Fix controller-pod SA permission denied
error
#3017
Conversation
Hi @astraw99. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 kubernetes/test-infra repository. |
Welcome @astraw99! |
@@ -104,6 +104,7 @@ spec: | |||
# values: | |||
# - linux | |||
securityContext: | |||
fsGroup: 65532 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
Why are you adding the fsGroup here?
It is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Described in issue #3016, the controller-pod start got error:
1.6656687258729894e+09 ERROR controller-runtime.client.config unable to get kubeconfig {"error": "open /var/run/secrets/kubernetes.io/serviceaccount/token: permission denied"}
So add fsGroup (based on dockerfile.go) to resolve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the issue #3016 you did not apply the manifests and you are running outside of the cluster. (make run)
Also, the error describe does not seems to have a relation with.
I do not think that we should add the fsGroup to the security context by default.
We need to better understand your scenario and we might can create a FAQ question where we describe why/where what needs to be changed in some circumstances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said in #3028 (comment), here add a fsGroup
comment doc, to make it helpful to resolve the issue.
PTAL thanks.
277a5b6
to
94edbb2
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: astraw99 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
permission denied
error
94edbb2
to
e275764
Compare
e275764
to
aa0837f
Compare
@@ -105,6 +105,8 @@ spec: | |||
# - linux | |||
securityContext: | |||
runAsNonRoot: true | |||
# if your K8s version <= 1.21, may need to uncomment the follow fsGroup to get SA token file access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @astraw99,
I do not think that we should add/change the scaffold.
(IHMO)
a) It could be fit in an issue as a workaround (so that others can find the problem and solution)
b) We could add it in the docs under a new FAQ section
c) It would be great better understand it and make clear that ONLY happens in development env when we are running/testing the project OUTSIDE of the cluster with make run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, maybe it is more proper to add this case into the FAQ section (I am doing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @astraw99,
The issue does not occur as you checked in the latest version of k8s.
So, I do not think that we should change the scaffolds with a workaround to solve issues for old k8s versions.
Also, we could address this scenario with the FAQ doc: #3044
So, wdyt? Could we close this one? Is that make sense?
OK, we can close it now. |
Fixes #3028
Add
fsGroup
based on dockerfile.go to get proper access to openserviceaccount
token file.