Unfortunately, there is no such way. WindowsSecurityContextOptions
contain Windows-specific options and credentials. PodSecurityContext allows you to use:
securityContext.runAsUser
(int64)
The UID to run the entrypoint of the container process. Defaults to
user specified in image metadata if unspecified. May also be set in
SecurityContext. If set in both SecurityContext and
PodSecurityContext, the value specified in SecurityContext takes
precedence for that container.
securityContext.runAsNonRoot
(boolean)
Indicates that the container must run as a non-root user. If true, the
Kubelet will validate the image at runtime to ensure that it does not
run as UID 0 (root) and fail to start the container if it does. If
unset or false, no such validation will be performed. May also be set
in SecurityContext. If set in both SecurityContext and
PodSecurityContext, the value specified in SecurityContext takes
precedence.
securityContext.runAsGroup
(int64)
The GID to run the entrypoint of the container process. Uses runtime
default if unset. May also be set in SecurityContext. If set in both
SecurityContext and PodSecurityContext, the value specified in
SecurityContext takes precedence for that container.
Trying to use String instead of Integer for runAsUser
will result in error:
invalid type for io.k8s.api.core.v1.SecurityContext.runAsUser: got "string", expected "integer"