runAsUser in securityContext

when runAsUser: tom is specified under securityContext.

When i exec into pod and using command id , it shows me user as tom . But I cannot see the user tom in /etc/passwd file.

Hi @dnpuneeth3 please refer below:

controlplane $ k get po
NAME READY STATUS RESTARTS AGE
security-context-demo 1/1 Running 0 5m58s
controlplane $

controlplane $ kubectl exec -it security-context-demo – sh
/ $
/ $ hostname
security-context-demo
/ $ id
uid=1000 gid=3000 groups=2000
/ $ id -nu 1000
id: unknown user 1000
/ $ exit
command terminated with exit code 1
controlplane $

Thank you.