mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
API Changes for RunAsGroup and Implementation and e2e
This commit is contained in:
parent
ded25445fe
commit
b888415ebf
10
api/openapi-spec/swagger.json
generated
10
api/openapi-spec/swagger.json
generated
@ -78183,6 +78183,11 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"description": "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.",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"description": "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.",
|
"description": "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.",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -79322,6 +79327,11 @@
|
|||||||
"description": "Whether this container has a read-only root filesystem. Default is false.",
|
"description": "Whether this container has a read-only root filesystem. Default is false.",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
10
api/swagger-spec/apps_v1.json
generated
10
api/swagger-spec/apps_v1.json
generated
@ -8286,6 +8286,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -8359,6 +8364,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/apps_v1beta1.json
generated
10
api/swagger-spec/apps_v1beta1.json
generated
@ -5920,6 +5920,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -5993,6 +5998,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/apps_v1beta2.json
generated
10
api/swagger-spec/apps_v1beta2.json
generated
@ -8286,6 +8286,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -8359,6 +8364,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/batch_v1.json
generated
10
api/swagger-spec/batch_v1.json
generated
@ -3260,6 +3260,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -3333,6 +3338,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/batch_v1beta1.json
generated
10
api/swagger-spec/batch_v1beta1.json
generated
@ -3315,6 +3315,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -3388,6 +3393,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/batch_v2alpha1.json
generated
10
api/swagger-spec/batch_v2alpha1.json
generated
@ -3315,6 +3315,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -3388,6 +3393,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/extensions_v1beta1.json
generated
10
api/swagger-spec/extensions_v1beta1.json
generated
@ -8928,6 +8928,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -9001,6 +9006,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
10
api/swagger-spec/v1.json
generated
10
api/swagger-spec/v1.json
generated
@ -21511,6 +21511,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
"description": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence."
|
||||||
@ -21584,6 +21589,11 @@
|
|||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
},
|
},
|
||||||
|
"runAsGroup": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "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."
|
||||||
|
},
|
||||||
"runAsNonRoot": {
|
"runAsNonRoot": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "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."
|
"description": "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."
|
||||||
|
14
docs/api-reference/apps/v1/definitions.html
generated
14
docs/api-reference/apps/v1/definitions.html
generated
@ -5687,6 +5687,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -6524,6 +6531,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/apps/v1beta1/definitions.html
generated
14
docs/api-reference/apps/v1beta1/definitions.html
generated
@ -5822,6 +5822,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -6384,6 +6391,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/apps/v1beta2/definitions.html
generated
14
docs/api-reference/apps/v1beta2/definitions.html
generated
@ -6156,6 +6156,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -6663,6 +6670,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/batch/v1/definitions.html
generated
14
docs/api-reference/batch/v1/definitions.html
generated
@ -4627,6 +4627,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -5203,6 +5210,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/batch/v1beta1/definitions.html
generated
14
docs/api-reference/batch/v1beta1/definitions.html
generated
@ -4778,6 +4778,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -5340,6 +5347,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/batch/v2alpha1/definitions.html
generated
14
docs/api-reference/batch/v2alpha1/definitions.html
generated
@ -4634,6 +4634,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -5141,6 +5148,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
@ -6537,6 +6537,13 @@ Both these may change in the future. Incoming requests are matched against the h
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -7353,6 +7360,13 @@ Both these may change in the future. Incoming requests are matched against the h
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
14
docs/api-reference/v1/definitions.html
generated
14
docs/api-reference/v1/definitions.html
generated
@ -4260,6 +4260,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
@ -4956,6 +4963,13 @@ Examples:<br>
|
|||||||
<td class="tableblock halign-left valign-top"></td>
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsGroup</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
|
||||||
|
<td class="tableblock halign-left valign-top"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">runAsNonRoot</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.</p></td>
|
||||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||||
|
@ -256,6 +256,28 @@ func DropDisabledAlphaFields(podSpec *api.PodSpec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DropDisabledVolumeDevicesAlphaFields(podSpec)
|
DropDisabledVolumeDevicesAlphaFields(podSpec)
|
||||||
|
|
||||||
|
DropDisabledRunAsGroupField(podSpec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DropDisabledRunAsGroupField removes disabled fields from PodSpec related
|
||||||
|
// to RunAsGroup
|
||||||
|
func DropDisabledRunAsGroupField(podSpec *api.PodSpec) {
|
||||||
|
if !utilfeature.DefaultFeatureGate.Enabled(features.RunAsGroup) {
|
||||||
|
if podSpec.SecurityContext != nil {
|
||||||
|
podSpec.SecurityContext.RunAsGroup = nil
|
||||||
|
}
|
||||||
|
for i := range podSpec.Containers {
|
||||||
|
if podSpec.Containers[i].SecurityContext != nil {
|
||||||
|
podSpec.Containers[i].SecurityContext.RunAsGroup = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range podSpec.InitContainers {
|
||||||
|
if podSpec.InitContainers[i].SecurityContext != nil {
|
||||||
|
podSpec.InitContainers[i].SecurityContext.RunAsGroup = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DropDisabledVolumeMountsAlphaFields removes disabled fields from []VolumeMount.
|
// DropDisabledVolumeMountsAlphaFields removes disabled fields from []VolumeMount.
|
||||||
|
@ -2695,12 +2695,20 @@ type PodSecurityContext struct {
|
|||||||
// for that container.
|
// for that container.
|
||||||
// +optional
|
// +optional
|
||||||
RunAsUser *int64
|
RunAsUser *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.
|
||||||
|
// +optional
|
||||||
|
RunAsGroup *int64
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// 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.
|
// If unset or false, no such validation will be performed.
|
||||||
// May also be set in SecurityContext. If set in both SecurityContext and
|
// May also be set in SecurityContext. If set in both SecurityContext and
|
||||||
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
// PodSecurityContext, the value specified in SecurityContext takes precedence
|
||||||
|
// for that container.
|
||||||
// +optional
|
// +optional
|
||||||
RunAsNonRoot *bool
|
RunAsNonRoot *bool
|
||||||
// A list of groups applied to the first process run in each container, in addition
|
// A list of groups applied to the first process run in each container, in addition
|
||||||
@ -4585,6 +4593,12 @@ type SecurityContext struct {
|
|||||||
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||||
// +optional
|
// +optional
|
||||||
RunAsUser *int64
|
RunAsUser *int64
|
||||||
|
// The GID to run the entrypoint of the container process.
|
||||||
|
// Uses runtime default if unset.
|
||||||
|
// May also be set in PodSecurityContext. If set in both SecurityContext and
|
||||||
|
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||||
|
// +optional
|
||||||
|
RunAsGroup *int64
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// does not run as UID 0 (root) and fail to start the container if it does.
|
||||||
|
@ -454,6 +454,7 @@ func Convert_v1_Secret_To_core_Secret(in *v1.Secret, out *core.Secret, s convers
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Convert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityContext, out *v1.SecurityContext, s conversion.Scope) error {
|
func Convert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityContext, out *v1.SecurityContext, s conversion.Scope) error {
|
||||||
if in.Capabilities != nil {
|
if in.Capabilities != nil {
|
||||||
out.Capabilities = new(v1.Capabilities)
|
out.Capabilities = new(v1.Capabilities)
|
||||||
@ -473,6 +474,7 @@ func Convert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityContext
|
|||||||
out.SELinuxOptions = nil
|
out.SELinuxOptions = nil
|
||||||
}
|
}
|
||||||
out.RunAsUser = in.RunAsUser
|
out.RunAsUser = in.RunAsUser
|
||||||
|
out.RunAsGroup = in.RunAsGroup
|
||||||
out.RunAsNonRoot = in.RunAsNonRoot
|
out.RunAsNonRoot = in.RunAsNonRoot
|
||||||
out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem
|
out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem
|
||||||
out.AllowPrivilegeEscalation = in.AllowPrivilegeEscalation
|
out.AllowPrivilegeEscalation = in.AllowPrivilegeEscalation
|
||||||
@ -490,6 +492,7 @@ func Convert_core_PodSecurityContext_To_v1_PodSecurityContext(in *core.PodSecuri
|
|||||||
out.SELinuxOptions = nil
|
out.SELinuxOptions = nil
|
||||||
}
|
}
|
||||||
out.RunAsUser = in.RunAsUser
|
out.RunAsUser = in.RunAsUser
|
||||||
|
out.RunAsGroup = in.RunAsGroup
|
||||||
out.RunAsNonRoot = in.RunAsNonRoot
|
out.RunAsNonRoot = in.RunAsNonRoot
|
||||||
out.FSGroup = in.FSGroup
|
out.FSGroup = in.FSGroup
|
||||||
return nil
|
return nil
|
||||||
@ -506,6 +509,7 @@ func Convert_v1_PodSecurityContext_To_core_PodSecurityContext(in *v1.PodSecurity
|
|||||||
out.SELinuxOptions = nil
|
out.SELinuxOptions = nil
|
||||||
}
|
}
|
||||||
out.RunAsUser = in.RunAsUser
|
out.RunAsUser = in.RunAsUser
|
||||||
|
out.RunAsGroup = in.RunAsGroup
|
||||||
out.RunAsNonRoot = in.RunAsNonRoot
|
out.RunAsNonRoot = in.RunAsNonRoot
|
||||||
out.FSGroup = in.FSGroup
|
out.FSGroup = in.FSGroup
|
||||||
return nil
|
return nil
|
||||||
|
4
pkg/apis/core/v1/zz_generated.conversion.go
generated
4
pkg/apis/core/v1/zz_generated.conversion.go
generated
@ -3774,6 +3774,7 @@ func Convert_core_PodProxyOptions_To_v1_PodProxyOptions(in *core.PodProxyOptions
|
|||||||
func autoConvert_v1_PodSecurityContext_To_core_PodSecurityContext(in *v1.PodSecurityContext, out *core.PodSecurityContext, s conversion.Scope) error {
|
func autoConvert_v1_PodSecurityContext_To_core_PodSecurityContext(in *v1.PodSecurityContext, out *core.PodSecurityContext, s conversion.Scope) error {
|
||||||
out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
||||||
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
||||||
|
out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup))
|
||||||
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
||||||
out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups))
|
out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups))
|
||||||
out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup))
|
out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup))
|
||||||
@ -3787,6 +3788,7 @@ func autoConvert_core_PodSecurityContext_To_v1_PodSecurityContext(in *core.PodSe
|
|||||||
// INFO: in.ShareProcessNamespace opted out of conversion generation
|
// INFO: in.ShareProcessNamespace opted out of conversion generation
|
||||||
out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
||||||
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
||||||
|
out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup))
|
||||||
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
||||||
out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups))
|
out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups))
|
||||||
out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup))
|
out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup))
|
||||||
@ -4983,6 +4985,7 @@ func autoConvert_v1_SecurityContext_To_core_SecurityContext(in *v1.SecurityConte
|
|||||||
out.Privileged = (*bool)(unsafe.Pointer(in.Privileged))
|
out.Privileged = (*bool)(unsafe.Pointer(in.Privileged))
|
||||||
out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
||||||
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
||||||
|
out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup))
|
||||||
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
||||||
out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem))
|
out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem))
|
||||||
out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation))
|
out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation))
|
||||||
@ -4999,6 +5002,7 @@ func autoConvert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityCon
|
|||||||
out.Privileged = (*bool)(unsafe.Pointer(in.Privileged))
|
out.Privileged = (*bool)(unsafe.Pointer(in.Privileged))
|
||||||
out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions))
|
||||||
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser))
|
||||||
|
out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup))
|
||||||
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot))
|
||||||
out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem))
|
out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem))
|
||||||
out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation))
|
out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation))
|
||||||
|
@ -3298,6 +3298,12 @@ func ValidatePodSecurityContext(securityContext *core.PodSecurityContext, spec *
|
|||||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *(securityContext.RunAsUser), msg))
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *(securityContext.RunAsUser), msg))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if securityContext.RunAsGroup != nil {
|
||||||
|
for _, msg := range validation.IsValidGroupID(*securityContext.RunAsGroup) {
|
||||||
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsGroup"), *(securityContext.RunAsGroup), msg))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for g, gid := range securityContext.SupplementalGroups {
|
for g, gid := range securityContext.SupplementalGroups {
|
||||||
for _, msg := range validation.IsValidGroupID(gid) {
|
for _, msg := range validation.IsValidGroupID(gid) {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("supplementalGroups").Index(g), gid, msg))
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("supplementalGroups").Index(g), gid, msg))
|
||||||
@ -4921,6 +4927,12 @@ func ValidateSecurityContext(sc *core.SecurityContext, fldPath *field.Path) fiel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sc.RunAsGroup != nil {
|
||||||
|
for _, msg := range validation.IsValidGroupID(*sc.RunAsGroup) {
|
||||||
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsGroup"), *sc.RunAsGroup, msg))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if sc.AllowPrivilegeEscalation != nil && !*sc.AllowPrivilegeEscalation {
|
if sc.AllowPrivilegeEscalation != nil && !*sc.AllowPrivilegeEscalation {
|
||||||
if sc.Privileged != nil && *sc.Privileged {
|
if sc.Privileged != nil && *sc.Privileged {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath, sc, "cannot set `allowPrivilegeEscalation` to false and `privileged` to true"))
|
allErrs = append(allErrs, field.Invalid(fldPath, sc, "cannot set `allowPrivilegeEscalation` to false and `privileged` to true"))
|
||||||
|
18
pkg/apis/core/zz_generated.deepcopy.go
generated
18
pkg/apis/core/zz_generated.deepcopy.go
generated
@ -3857,6 +3857,15 @@ func (in *PodSecurityContext) DeepCopyInto(out *PodSecurityContext) {
|
|||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.RunAsGroup != nil {
|
||||||
|
in, out := &in.RunAsGroup, &out.RunAsGroup
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int64)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
if in.RunAsNonRoot != nil {
|
if in.RunAsNonRoot != nil {
|
||||||
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
||||||
if *in == nil {
|
if *in == nil {
|
||||||
@ -5065,6 +5074,15 @@ func (in *SecurityContext) DeepCopyInto(out *SecurityContext) {
|
|||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.RunAsGroup != nil {
|
||||||
|
in, out := &in.RunAsGroup, &out.RunAsGroup
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int64)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
if in.RunAsNonRoot != nil {
|
if in.RunAsNonRoot != nil {
|
||||||
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
||||||
if *in == nil {
|
if *in == nil {
|
||||||
|
@ -261,6 +261,12 @@ const (
|
|||||||
//
|
//
|
||||||
// Enables the regional PD feature on GCE.
|
// Enables the regional PD feature on GCE.
|
||||||
GCERegionalPersistentDisk utilfeature.Feature = "GCERegionalPersistentDisk"
|
GCERegionalPersistentDisk utilfeature.Feature = "GCERegionalPersistentDisk"
|
||||||
|
|
||||||
|
// owner: @krmayankk
|
||||||
|
// alpha: v1.10
|
||||||
|
//
|
||||||
|
// Enables control over the primary group ID of containers' init processes.
|
||||||
|
RunAsGroup utilfeature.Feature = "RunAsGroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -306,6 +312,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
|
|||||||
TokenRequest: {Default: false, PreRelease: utilfeature.Alpha},
|
TokenRequest: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
CRIContainerLogRotation: {Default: false, PreRelease: utilfeature.Alpha},
|
CRIContainerLogRotation: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
GCERegionalPersistentDisk: {Default: true, PreRelease: utilfeature.Beta},
|
GCERegionalPersistentDisk: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
|
RunAsGroup: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
|
|
||||||
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
|
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
|
||||||
// unintentionally on either side:
|
// unintentionally on either side:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -235,6 +235,8 @@ message LinuxSandboxSecurityContext {
|
|||||||
SELinuxOption selinux_options = 2;
|
SELinuxOption selinux_options = 2;
|
||||||
// UID to run sandbox processes as, when applicable.
|
// UID to run sandbox processes as, when applicable.
|
||||||
Int64Value run_as_user = 3;
|
Int64Value run_as_user = 3;
|
||||||
|
// GID to run sandbox processes as, when applicable.
|
||||||
|
Int64Value run_as_group = 8;
|
||||||
// If set, the root filesystem of the sandbox is read-only.
|
// If set, the root filesystem of the sandbox is read-only.
|
||||||
bool readonly_rootfs = 4;
|
bool readonly_rootfs = 4;
|
||||||
// List of groups applied to the first process run in the sandbox, in
|
// List of groups applied to the first process run in the sandbox, in
|
||||||
@ -551,6 +553,9 @@ message LinuxContainerSecurityContext {
|
|||||||
// UID to run the container process as. Only one of run_as_user and
|
// UID to run the container process as. Only one of run_as_user and
|
||||||
// run_as_username can be specified at a time.
|
// run_as_username can be specified at a time.
|
||||||
Int64Value run_as_user = 5;
|
Int64Value run_as_user = 5;
|
||||||
|
// GID to run the container process as. Only one of run_as_group and
|
||||||
|
// run_as_groupname can be specified at a time.
|
||||||
|
Int64Value run_as_group = 12;
|
||||||
// User name to run the container process as. If specified, the user MUST
|
// User name to run the container process as. If specified, the user MUST
|
||||||
// exist in the container image (i.e. in the /etc/passwd inside the image),
|
// exist in the container image (i.e. in the /etc/passwd inside the image),
|
||||||
// and be resolved there by the runtime; otherwise, the runtime MUST error.
|
// and be resolved there by the runtime; otherwise, the runtime MUST error.
|
||||||
|
@ -39,13 +39,18 @@ func applySandboxSecurityContext(lc *runtimeapi.LinuxPodSandboxConfig, config *d
|
|||||||
sc = &runtimeapi.LinuxContainerSecurityContext{
|
sc = &runtimeapi.LinuxContainerSecurityContext{
|
||||||
SupplementalGroups: lc.SecurityContext.SupplementalGroups,
|
SupplementalGroups: lc.SecurityContext.SupplementalGroups,
|
||||||
RunAsUser: lc.SecurityContext.RunAsUser,
|
RunAsUser: lc.SecurityContext.RunAsUser,
|
||||||
|
RunAsGroup: lc.SecurityContext.RunAsGroup,
|
||||||
ReadonlyRootfs: lc.SecurityContext.ReadonlyRootfs,
|
ReadonlyRootfs: lc.SecurityContext.ReadonlyRootfs,
|
||||||
SelinuxOptions: lc.SecurityContext.SelinuxOptions,
|
SelinuxOptions: lc.SecurityContext.SelinuxOptions,
|
||||||
NamespaceOptions: lc.SecurityContext.NamespaceOptions,
|
NamespaceOptions: lc.SecurityContext.NamespaceOptions,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyContainerConfig(sc, config)
|
err := modifyContainerConfig(sc, config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if err := modifyHostConfig(sc, hc, separator); err != nil {
|
if err := modifyHostConfig(sc, hc, separator); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -59,7 +64,10 @@ func applyContainerSecurityContext(lc *runtimeapi.LinuxContainerConfig, podSandb
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyContainerConfig(lc.SecurityContext, config)
|
err := modifyContainerConfig(lc.SecurityContext, config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := modifyHostConfig(lc.SecurityContext, hc, separator); err != nil {
|
if err := modifyHostConfig(lc.SecurityContext, hc, separator); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -68,9 +76,9 @@ func applyContainerSecurityContext(lc *runtimeapi.LinuxContainerConfig, podSandb
|
|||||||
}
|
}
|
||||||
|
|
||||||
// modifyContainerConfig applies container security context config to dockercontainer.Config.
|
// modifyContainerConfig applies container security context config to dockercontainer.Config.
|
||||||
func modifyContainerConfig(sc *runtimeapi.LinuxContainerSecurityContext, config *dockercontainer.Config) {
|
func modifyContainerConfig(sc *runtimeapi.LinuxContainerSecurityContext, config *dockercontainer.Config) error {
|
||||||
if sc == nil {
|
if sc == nil {
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
if sc.RunAsUser != nil {
|
if sc.RunAsUser != nil {
|
||||||
config.User = strconv.FormatInt(sc.GetRunAsUser().Value, 10)
|
config.User = strconv.FormatInt(sc.GetRunAsUser().Value, 10)
|
||||||
@ -78,6 +86,18 @@ func modifyContainerConfig(sc *runtimeapi.LinuxContainerSecurityContext, config
|
|||||||
if sc.RunAsUsername != "" {
|
if sc.RunAsUsername != "" {
|
||||||
config.User = sc.RunAsUsername
|
config.User = sc.RunAsUsername
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user := config.User
|
||||||
|
if sc.RunAsGroup != nil {
|
||||||
|
if user == "" {
|
||||||
|
return fmt.Errorf("runAsGroup is specified without a runAsUser.")
|
||||||
|
}
|
||||||
|
user = fmt.Sprintf("%s:%d", config.User, sc.GetRunAsGroup().Value)
|
||||||
|
}
|
||||||
|
|
||||||
|
config.User = user
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifyHostConfig applies security context config to dockercontainer.HostConfig.
|
// modifyHostConfig applies security context config to dockercontainer.HostConfig.
|
||||||
|
@ -31,11 +31,13 @@ import (
|
|||||||
func TestModifyContainerConfig(t *testing.T) {
|
func TestModifyContainerConfig(t *testing.T) {
|
||||||
var uid int64 = 123
|
var uid int64 = 123
|
||||||
var username = "testuser"
|
var username = "testuser"
|
||||||
|
var gid int64 = 423
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
name string
|
name string
|
||||||
sc *runtimeapi.LinuxContainerSecurityContext
|
sc *runtimeapi.LinuxContainerSecurityContext
|
||||||
expected *dockercontainer.Config
|
expected *dockercontainer.Config
|
||||||
|
isErr bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "container.SecurityContext.RunAsUser set",
|
name: "container.SecurityContext.RunAsUser set",
|
||||||
@ -45,6 +47,7 @@ func TestModifyContainerConfig(t *testing.T) {
|
|||||||
expected: &dockercontainer.Config{
|
expected: &dockercontainer.Config{
|
||||||
User: strconv.FormatInt(uid, 10),
|
User: strconv.FormatInt(uid, 10),
|
||||||
},
|
},
|
||||||
|
isErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "container.SecurityContext.RunAsUsername set",
|
name: "container.SecurityContext.RunAsUsername set",
|
||||||
@ -54,18 +57,54 @@ func TestModifyContainerConfig(t *testing.T) {
|
|||||||
expected: &dockercontainer.Config{
|
expected: &dockercontainer.Config{
|
||||||
User: username,
|
User: username,
|
||||||
},
|
},
|
||||||
|
isErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no RunAsUser value set",
|
name: "no RunAsUser value set",
|
||||||
sc: &runtimeapi.LinuxContainerSecurityContext{},
|
sc: &runtimeapi.LinuxContainerSecurityContext{},
|
||||||
expected: &dockercontainer.Config{},
|
expected: &dockercontainer.Config{},
|
||||||
|
isErr: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "RunAsUser value set, RunAsGroup set",
|
||||||
|
sc: &runtimeapi.LinuxContainerSecurityContext{
|
||||||
|
RunAsUser: &runtimeapi.Int64Value{Value: uid},
|
||||||
|
RunAsGroup: &runtimeapi.Int64Value{Value: gid},
|
||||||
|
},
|
||||||
|
expected: &dockercontainer.Config{
|
||||||
|
User: "123:423",
|
||||||
|
},
|
||||||
|
isErr: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "RunAsUsername value set, RunAsGroup set",
|
||||||
|
sc: &runtimeapi.LinuxContainerSecurityContext{
|
||||||
|
RunAsUsername: username,
|
||||||
|
RunAsGroup: &runtimeapi.Int64Value{Value: gid},
|
||||||
|
},
|
||||||
|
expected: &dockercontainer.Config{
|
||||||
|
User: "testuser:423",
|
||||||
|
},
|
||||||
|
isErr: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "RunAsUser/RunAsUsername not set, RunAsGroup set",
|
||||||
|
sc: &runtimeapi.LinuxContainerSecurityContext{
|
||||||
|
RunAsGroup: &runtimeapi.Int64Value{Value: gid},
|
||||||
|
},
|
||||||
|
isErr: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
dockerCfg := &dockercontainer.Config{}
|
dockerCfg := &dockercontainer.Config{}
|
||||||
modifyContainerConfig(tc.sc, dockerCfg)
|
err := modifyContainerConfig(tc.sc, dockerCfg)
|
||||||
assert.Equal(t, tc.expected, dockerCfg, "[Test case %q]", tc.name)
|
if tc.isErr {
|
||||||
|
assert.NotNil(t, err)
|
||||||
|
} else {
|
||||||
|
assert.Nil(t, err)
|
||||||
|
assert.Equal(t, tc.expected, dockerCfg, "[Test case %q]", tc.name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +122,11 @@ func DetermineEffectiveSecurityContext(pod *v1.Pod, container *v1.Container) *v1
|
|||||||
*effectiveSc.RunAsUser = *containerSc.RunAsUser
|
*effectiveSc.RunAsUser = *containerSc.RunAsUser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if containerSc.RunAsGroup != nil {
|
||||||
|
effectiveSc.RunAsGroup = new(int64)
|
||||||
|
*effectiveSc.RunAsGroup = *containerSc.RunAsGroup
|
||||||
|
}
|
||||||
|
|
||||||
if containerSc.RunAsNonRoot != nil {
|
if containerSc.RunAsNonRoot != nil {
|
||||||
effectiveSc.RunAsNonRoot = new(bool)
|
effectiveSc.RunAsNonRoot = new(bool)
|
||||||
*effectiveSc.RunAsNonRoot = *containerSc.RunAsNonRoot
|
*effectiveSc.RunAsNonRoot = *containerSc.RunAsNonRoot
|
||||||
@ -156,6 +161,11 @@ func securityContextFromPodSecurityContext(pod *v1.Pod) *v1.SecurityContext {
|
|||||||
*synthesized.RunAsUser = *pod.Spec.SecurityContext.RunAsUser
|
*synthesized.RunAsUser = *pod.Spec.SecurityContext.RunAsUser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pod.Spec.SecurityContext.RunAsGroup != nil {
|
||||||
|
synthesized.RunAsGroup = new(int64)
|
||||||
|
*synthesized.RunAsGroup = *pod.Spec.SecurityContext.RunAsGroup
|
||||||
|
}
|
||||||
|
|
||||||
if pod.Spec.SecurityContext.RunAsNonRoot != nil {
|
if pod.Spec.SecurityContext.RunAsNonRoot != nil {
|
||||||
synthesized.RunAsNonRoot = new(bool)
|
synthesized.RunAsNonRoot = new(bool)
|
||||||
*synthesized.RunAsNonRoot = *pod.Spec.SecurityContext.RunAsNonRoot
|
*synthesized.RunAsNonRoot = *pod.Spec.SecurityContext.RunAsNonRoot
|
||||||
|
1643
staging/src/k8s.io/api/core/v1/generated.pb.go
generated
1643
staging/src/k8s.io/api/core/v1/generated.pb.go
generated
File diff suppressed because it is too large
Load Diff
@ -2964,6 +2964,14 @@ message PodSecurityContext {
|
|||||||
// +optional
|
// +optional
|
||||||
optional int64 runAsUser = 2;
|
optional int64 runAsUser = 2;
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
// +optional
|
||||||
|
optional int64 runAsGroup = 6;
|
||||||
|
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// does not run as UID 0 (root) and fail to start the container if it does.
|
||||||
@ -4024,6 +4032,13 @@ message SecurityContext {
|
|||||||
// +optional
|
// +optional
|
||||||
optional int64 runAsUser = 4;
|
optional int64 runAsUser = 4;
|
||||||
|
|
||||||
|
// The GID to run the entrypoint of the container process.
|
||||||
|
// Uses runtime default if unset.
|
||||||
|
// May also be set in PodSecurityContext. If set in both SecurityContext and
|
||||||
|
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||||
|
// +optional
|
||||||
|
optional int64 runAsGroup = 8;
|
||||||
|
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// does not run as UID 0 (root) and fail to start the container if it does.
|
||||||
|
@ -2983,6 +2983,13 @@ type PodSecurityContext struct {
|
|||||||
// for that container.
|
// for that container.
|
||||||
// +optional
|
// +optional
|
||||||
RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"`
|
RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"`
|
||||||
|
// 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.
|
||||||
|
// +optional
|
||||||
|
RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,6,opt,name=runAsGroup"`
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// does not run as UID 0 (root) and fail to start the container if it does.
|
||||||
@ -5165,6 +5172,12 @@ type SecurityContext struct {
|
|||||||
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||||
// +optional
|
// +optional
|
||||||
RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"`
|
RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"`
|
||||||
|
// The GID to run the entrypoint of the container process.
|
||||||
|
// Uses runtime default if unset.
|
||||||
|
// May also be set in PodSecurityContext. If set in both SecurityContext and
|
||||||
|
// PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||||
|
// +optional
|
||||||
|
RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,8,opt,name=runAsGroup"`
|
||||||
// Indicates that the container must run as a non-root user.
|
// 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
|
// 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.
|
// does not run as UID 0 (root) and fail to start the container if it does.
|
||||||
|
@ -1475,6 +1475,7 @@ var map_PodSecurityContext = map[string]string{
|
|||||||
"": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.",
|
"": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.",
|
||||||
"seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.",
|
"seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.",
|
||||||
"runAsUser": "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.",
|
"runAsUser": "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.",
|
||||||
|
"runAsGroup": "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.",
|
||||||
"runAsNonRoot": "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.",
|
"runAsNonRoot": "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.",
|
||||||
"supplementalGroups": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.",
|
"supplementalGroups": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.",
|
||||||
"fsGroup": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw ",
|
"fsGroup": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw ",
|
||||||
@ -1957,6 +1958,7 @@ var map_SecurityContext = map[string]string{
|
|||||||
"privileged": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.",
|
"privileged": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.",
|
||||||
"seLinuxOptions": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
"seLinuxOptions": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
"runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
"runAsUser": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
|
"runAsGroup": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
"runAsNonRoot": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
"runAsNonRoot": "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 PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
|
||||||
"readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false.",
|
"readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false.",
|
||||||
"allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN",
|
"allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN",
|
||||||
|
@ -3834,6 +3834,15 @@ func (in *PodSecurityContext) DeepCopyInto(out *PodSecurityContext) {
|
|||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.RunAsGroup != nil {
|
||||||
|
in, out := &in.RunAsGroup, &out.RunAsGroup
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int64)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
if in.RunAsNonRoot != nil {
|
if in.RunAsNonRoot != nil {
|
||||||
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
||||||
if *in == nil {
|
if *in == nil {
|
||||||
@ -5067,6 +5076,15 @@ func (in *SecurityContext) DeepCopyInto(out *SecurityContext) {
|
|||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.RunAsGroup != nil {
|
||||||
|
in, out := &in.RunAsGroup, &out.RunAsGroup
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int64)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
if in.RunAsNonRoot != nil {
|
if in.RunAsNonRoot != nil {
|
||||||
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
in, out := &in.RunAsNonRoot, &out.RunAsNonRoot
|
||||||
if *in == nil {
|
if *in == nil {
|
||||||
|
@ -81,6 +81,20 @@ var _ = SIGDescribe("Security Context [Feature:SecurityContext]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("should support pod.Spec.SecurityContext.RunAsUser And pod.Spec.SecurityContext.RunAsGroup [Feature:RunAsGroup]", func() {
|
||||||
|
pod := scTestPod(false, false)
|
||||||
|
userID := int64(1001)
|
||||||
|
groupID := int64(2002)
|
||||||
|
pod.Spec.SecurityContext.RunAsUser = &userID
|
||||||
|
pod.Spec.SecurityContext.RunAsGroup = &groupID
|
||||||
|
pod.Spec.Containers[0].Command = []string{"sh", "-c", "id"}
|
||||||
|
|
||||||
|
f.TestContainerOutput("pod.Spec.SecurityContext.RunAsUser", pod, 0, []string{
|
||||||
|
fmt.Sprintf("uid=%v", userID),
|
||||||
|
fmt.Sprintf("gid=%v", groupID),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
It("should support container.SecurityContext.RunAsUser", func() {
|
It("should support container.SecurityContext.RunAsUser", func() {
|
||||||
pod := scTestPod(false, false)
|
pod := scTestPod(false, false)
|
||||||
userID := int64(1001)
|
userID := int64(1001)
|
||||||
@ -95,6 +109,25 @@ var _ = SIGDescribe("Security Context [Feature:SecurityContext]", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("should support container.SecurityContext.RunAsUser And container.SecurityContext.RunAsGroup [Feature:RunAsGroup]", func() {
|
||||||
|
pod := scTestPod(false, false)
|
||||||
|
userID := int64(1001)
|
||||||
|
groupID := int64(2001)
|
||||||
|
overrideUserID := int64(1002)
|
||||||
|
overrideGroupID := int64(2002)
|
||||||
|
pod.Spec.SecurityContext.RunAsUser = &userID
|
||||||
|
pod.Spec.SecurityContext.RunAsGroup = &groupID
|
||||||
|
pod.Spec.Containers[0].SecurityContext = new(v1.SecurityContext)
|
||||||
|
pod.Spec.Containers[0].SecurityContext.RunAsUser = &overrideUserID
|
||||||
|
pod.Spec.Containers[0].SecurityContext.RunAsGroup = &overrideGroupID
|
||||||
|
pod.Spec.Containers[0].Command = []string{"sh", "-c", "id"}
|
||||||
|
|
||||||
|
f.TestContainerOutput("pod.Spec.SecurityContext.RunAsUser", pod, 0, []string{
|
||||||
|
fmt.Sprintf("uid=%v", overrideUserID),
|
||||||
|
fmt.Sprintf("gid=%v", overrideGroupID),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
It("should support volume SELinux relabeling", func() {
|
It("should support volume SELinux relabeling", func() {
|
||||||
testPodSELinuxLabeling(f, false, false)
|
testPodSELinuxLabeling(f, false, false)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user