pub struct SecurityContext {
pub allow_privilege_escalation: Option<bool>,
pub capabilities: Option<Capabilities>,
pub privileged: Option<bool>,
pub proc_mount: Option<String>,
pub read_only_root_filesystem: Option<bool>,
pub run_as_group: Option<i64>,
pub run_as_non_root: Option<bool>,
pub run_as_user: Option<i64>,
pub se_linux_options: Option<SeLinuxOptions>,
pub seccomp_profile: Option<SeccompProfile>,
pub windows_options: Option<WindowsSecurityContextOptions>,
}Expand description
Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.
Fields§
§allow_privilege_escalation: Option<bool>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 Note that this field cannot be set when spec.os.name is windows. +optional
capabilities: Option<Capabilities>§privileged: Option<bool>Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. +optional
proc_mount: Option<String>+enum
read_only_root_filesystem: Option<bool>Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. +optional
run_as_group: Option<i64>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. Note that this field cannot be set when spec.os.name is windows. +optional
run_as_non_root: Option<bool>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. +optional
run_as_user: Option<i64>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. Note that this field cannot be set when spec.os.name is windows. +optional
se_linux_options: Option<SeLinuxOptions>§seccomp_profile: Option<SeccompProfile>§windows_options: Option<WindowsSecurityContextOptions>Implementations§
Source§impl SecurityContext
impl SecurityContext
pub fn new() -> SecurityContext
Trait Implementations§
Source§impl Clone for SecurityContext
impl Clone for SecurityContext
Source§fn clone(&self) -> SecurityContext
fn clone(&self) -> SecurityContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityContext
impl Debug for SecurityContext
Source§impl<'de> Deserialize<'de> for SecurityContext
impl<'de> Deserialize<'de> for SecurityContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromStr for SecurityContext
Converts Query Parameters representation (style=form, explode=false) to a SecurityContext value
as specified in https://swagger.io/docs/specification/serialization/
Should be implemented in a serde deserializer
impl FromStr for SecurityContext
Converts Query Parameters representation (style=form, explode=false) to a SecurityContext value as specified in https://swagger.io/docs/specification/serialization/ Should be implemented in a serde deserializer
Source§impl PartialEq for SecurityContext
impl PartialEq for SecurityContext
Source§impl Serialize for SecurityContext
impl Serialize for SecurityContext
Source§impl ToString for SecurityContext
Converts the SecurityContext value to the Query Parameters representation (style=form, explode=false)
specified in https://swagger.io/docs/specification/serialization/
Should be implemented in a serde serializer
impl ToString for SecurityContext
Converts the SecurityContext value to the Query Parameters representation (style=form, explode=false) specified in https://swagger.io/docs/specification/serialization/ Should be implemented in a serde serializer