Skip to content

Commit fb29776

Browse files
authored
Merge pull request #35053 from verb/32351-projected-volumes
Clarify handling of projected SA token permissions
2 parents d543a1d + 3afe0c7 commit fb29776

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

content/en/docs/concepts/storage/projected-volumes.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@ In Linux pods that have a projected volume and `RunAsUser` set in the Pod
8282
the projected files have the correct ownership set including container user
8383
ownership.
8484

85+
When all containers in a pod have the same `runAsUser` set in their
86+
[`PodSecurityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
87+
or container
88+
[`SecurityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1),
89+
then the kubelet ensures that the contents of the `serviceAccountToken` volume are owned by that user,
90+
and the token file has its permission mode set to `0600`.
91+
92+
{{< note >}}
93+
{{< glossary_tooltip text="Ephemeral containers" term_id="ephemeral-container" >}}
94+
added to a Pod after it is created do *not* change volume permissions that were
95+
set when the pod was created.
96+
97+
If a Pod's `serviceAccountToken` volume permissions were set to `0600` because
98+
all other containers in the Pod have the same `runAsUser`, ephemeral
99+
containers must use the same `runAsUser` to be able to read the token.
100+
{{< /note >}}
101+
85102
### Windows
86103

87104
In Windows pods that have a projected volume and `RunAsUsername` set in the

0 commit comments

Comments
 (0)