-
Notifications
You must be signed in to change notification settings - Fork 984
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
Add automount_service_account_token
to podSpec.
#57
Conversation
The automountServiceAccountToken attribute was added to the Kubernetes podSpec in 1.6+ and is intended as a way to opt out of the default pre 1.6 behaviour of always mounting the service account token. For this reason, I’ve set the default to True. Additional Info https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
BTW - the equivalent attribute should be added to the |
Oops I missed merging some of the code. This doesn't work. |
Hi @sl1pm4t The main reason your acceptance test is passing is because you didn't change anything in the CRUD If you do modify either of these fields to I admit I could've done much better job documenting these reasons in the code and possibly in the Readme. Let me know if the explanation makes sense. |
- Fix ACC Tests - Handle diffs generated on volumes / volumeMounts
@radeksimko I've fixed the implementation, and acc tests etc. I added code to prevent intermittent diffs caused by As for your comments from #38
What could the user do to be "explicit" - create the secret, volume and volumeMount? The user would also have to know to mount the token at the exact path that Kubernetes would auto mount it, otherwise some apps will fail randomly. |
I did consider this, but I don't think name string-matching is a good approach. We don't want to prescribe what names should or shouldn't users use for their volumes or secrets.
I agree, it's a lot of work and thanks for providing examples. I think the best way forward would be to reach out to the upstream K8S community and propose an API field that would mark the volume and/or secret as default, so we have a reliable and clean way to detect such secrets and/or volumes. What do you think? |
I agree an upstream improvement is the best option. |
Closing until we have an upstream enhancement. |
The automountServiceAccountToken attribute was added to the Kubernetes
podSpec in 1.6+ and is intended as a way to opt out of the default pre
1.6 behaviour of always mounting the service account token.
For this reason, I’ve set the default to True.
Additional Info
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/