projected serviceAccountToken do not honour defaultMode or readOnly: true (tested in 1.30) #129475
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
sig/storage
Categorizes an issue or PR as relevant to SIG Storage.
What happened?
We have a container which needs to start as root today (because we install packages, mount a docker socket and the like). But then we change uid to a lower privilege user for the rest of time.
That user needs access to a projected serviceAccountToken to access another service. The user cannot read the file because its mode is rw-------.
So, we set defaultMode on the projected volume definition, but this has no effect.
We also had readOnly: true in the mount definition, and that seems to not have effect either, as the mode was still rw------- not r--------.
Sample Pod definitions
The test I did in making a SSCCE was to run this:
We checked the documentation and it describes defaultMode with no restrictions on its relevance to difference sources. The API reference is no more useful.
What did you expect to happen?
I expected the defaultMode setting to apply to the serviceAccountToken. All the same reasons one might want a different mode for a projected secret or config map also apply to a projected serviceAccountToken.
How can we reproduce it (as minimally and precisely as possible)?
See above.
Anything else we need to know?
Probably not ;) .
Kubernetes version
Cloud provider
OS version
I don't have access to the node OS itself, sorry.
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: