Class V1.PodSecurityContext

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.kubernetes.client.proto.V1.PodSecurityContext
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, V1.PodSecurityContextOrBuilder, Serializable
Enclosing class:
V1

public static final class V1.PodSecurityContext extends com.google.protobuf.GeneratedMessageV3 implements V1.PodSecurityContextOrBuilder
 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.
 
Protobuf type k8s.io.api.core.v1.PodSecurityContext
See Also:
  • Field Details

    • SELINUXOPTIONS_FIELD_NUMBER

      public static final int SELINUXOPTIONS_FIELD_NUMBER
      See Also:
    • WINDOWSOPTIONS_FIELD_NUMBER

      public static final int WINDOWSOPTIONS_FIELD_NUMBER
      See Also:
    • RUNASUSER_FIELD_NUMBER

      public static final int RUNASUSER_FIELD_NUMBER
      See Also:
    • RUNASGROUP_FIELD_NUMBER

      public static final int RUNASGROUP_FIELD_NUMBER
      See Also:
    • RUNASNONROOT_FIELD_NUMBER

      public static final int RUNASNONROOT_FIELD_NUMBER
      See Also:
    • SUPPLEMENTALGROUPS_FIELD_NUMBER

      public static final int SUPPLEMENTALGROUPS_FIELD_NUMBER
      See Also:
    • FSGROUP_FIELD_NUMBER

      public static final int FSGROUP_FIELD_NUMBER
      See Also:
    • SYSCTLS_FIELD_NUMBER

      public static final int SYSCTLS_FIELD_NUMBER
      See Also:
    • FSGROUPCHANGEPOLICY_FIELD_NUMBER

      public static final int FSGROUPCHANGEPOLICY_FIELD_NUMBER
      See Also:
    • SECCOMPPROFILE_FIELD_NUMBER

      public static final int SECCOMPPROFILE_FIELD_NUMBER
      See Also:
    • PARSER

      @Deprecated public static final com.google.protobuf.Parser<V1.PodSecurityContext> PARSER
      Deprecated.
  • Method Details

    • getUnknownFields

      public final com.google.protobuf.UnknownFieldSet getUnknownFields()
      Specified by:
      getUnknownFields in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getUnknownFields in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
    • hasSeLinuxOptions

      public boolean hasSeLinuxOptions()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 1;
      Specified by:
      hasSeLinuxOptions in interface V1.PodSecurityContextOrBuilder
    • getSeLinuxOptions

      public V1.SELinuxOptions getSeLinuxOptions()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 1;
      Specified by:
      getSeLinuxOptions in interface V1.PodSecurityContextOrBuilder
    • getSeLinuxOptionsOrBuilder

      public V1.SELinuxOptionsOrBuilder getSeLinuxOptionsOrBuilder()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 1;
      Specified by:
      getSeLinuxOptionsOrBuilder in interface V1.PodSecurityContextOrBuilder
    • hasWindowsOptions

      public boolean hasWindowsOptions()
       The Windows specific settings applied to all containers.
       If unspecified, the options within a container's SecurityContext will be used.
       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 linux.
       +optional
       
      optional .k8s.io.api.core.v1.WindowsSecurityContextOptions windowsOptions = 8;
      Specified by:
      hasWindowsOptions in interface V1.PodSecurityContextOrBuilder
    • getWindowsOptions

      public V1.WindowsSecurityContextOptions getWindowsOptions()
       The Windows specific settings applied to all containers.
       If unspecified, the options within a container's SecurityContext will be used.
       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 linux.
       +optional
       
      optional .k8s.io.api.core.v1.WindowsSecurityContextOptions windowsOptions = 8;
      Specified by:
      getWindowsOptions in interface V1.PodSecurityContextOrBuilder
    • getWindowsOptionsOrBuilder

      public V1.WindowsSecurityContextOptionsOrBuilder getWindowsOptionsOrBuilder()
       The Windows specific settings applied to all containers.
       If unspecified, the options within a container's SecurityContext will be used.
       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 linux.
       +optional
       
      optional .k8s.io.api.core.v1.WindowsSecurityContextOptions windowsOptions = 8;
      Specified by:
      getWindowsOptionsOrBuilder in interface V1.PodSecurityContextOrBuilder
    • hasRunAsUser

      public boolean hasRunAsUser()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 runAsUser = 2;
      Specified by:
      hasRunAsUser in interface V1.PodSecurityContextOrBuilder
    • getRunAsUser

      public long getRunAsUser()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 runAsUser = 2;
      Specified by:
      getRunAsUser in interface V1.PodSecurityContextOrBuilder
    • hasRunAsGroup

      public boolean hasRunAsGroup()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 runAsGroup = 6;
      Specified by:
      hasRunAsGroup in interface V1.PodSecurityContextOrBuilder
    • getRunAsGroup

      public long getRunAsGroup()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 runAsGroup = 6;
      Specified by:
      getRunAsGroup in interface V1.PodSecurityContextOrBuilder
    • hasRunAsNonRoot

      public boolean hasRunAsNonRoot()
       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.
       +optional
       
      optional bool runAsNonRoot = 3;
      Specified by:
      hasRunAsNonRoot in interface V1.PodSecurityContextOrBuilder
    • getRunAsNonRoot

      public boolean getRunAsNonRoot()
       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.
       +optional
       
      optional bool runAsNonRoot = 3;
      Specified by:
      getRunAsNonRoot in interface V1.PodSecurityContextOrBuilder
    • getSupplementalGroupsList

      public List<Long> getSupplementalGroupsList()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated int64 supplementalGroups = 4;
      Specified by:
      getSupplementalGroupsList in interface V1.PodSecurityContextOrBuilder
    • getSupplementalGroupsCount

      public int getSupplementalGroupsCount()
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated int64 supplementalGroups = 4;
      Specified by:
      getSupplementalGroupsCount in interface V1.PodSecurityContextOrBuilder
    • getSupplementalGroups

      public long getSupplementalGroups(int index)
       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.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated int64 supplementalGroups = 4;
      Specified by:
      getSupplementalGroups in interface V1.PodSecurityContextOrBuilder
    • hasFsGroup

      public boolean hasFsGroup()
       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:
       1. 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----
       If unset, the Kubelet will not modify the ownership and permissions of any volume.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 fsGroup = 5;
      Specified by:
      hasFsGroup in interface V1.PodSecurityContextOrBuilder
    • getFsGroup

      public long getFsGroup()
       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:
       1. 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----
       If unset, the Kubelet will not modify the ownership and permissions of any volume.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional int64 fsGroup = 5;
      Specified by:
      getFsGroup in interface V1.PodSecurityContextOrBuilder
    • getSysctlsList

      public List<V1.Sysctl> getSysctlsList()
       Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
       sysctls (by the container runtime) might fail to launch.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated .k8s.io.api.core.v1.Sysctl sysctls = 7;
      Specified by:
      getSysctlsList in interface V1.PodSecurityContextOrBuilder
    • getSysctlsOrBuilderList

      public List<? extends V1.SysctlOrBuilder> getSysctlsOrBuilderList()
       Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
       sysctls (by the container runtime) might fail to launch.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated .k8s.io.api.core.v1.Sysctl sysctls = 7;
      Specified by:
      getSysctlsOrBuilderList in interface V1.PodSecurityContextOrBuilder
    • getSysctlsCount

      public int getSysctlsCount()
       Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
       sysctls (by the container runtime) might fail to launch.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated .k8s.io.api.core.v1.Sysctl sysctls = 7;
      Specified by:
      getSysctlsCount in interface V1.PodSecurityContextOrBuilder
    • getSysctls

      public V1.Sysctl getSysctls(int index)
       Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
       sysctls (by the container runtime) might fail to launch.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated .k8s.io.api.core.v1.Sysctl sysctls = 7;
      Specified by:
      getSysctls in interface V1.PodSecurityContextOrBuilder
    • getSysctlsOrBuilder

      public V1.SysctlOrBuilder getSysctlsOrBuilder(int index)
       Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
       sysctls (by the container runtime) might fail to launch.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      repeated .k8s.io.api.core.v1.Sysctl sysctls = 7;
      Specified by:
      getSysctlsOrBuilder in interface V1.PodSecurityContextOrBuilder
    • hasFsGroupChangePolicy

      public boolean hasFsGroupChangePolicy()
       fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
       before being exposed inside Pod. This field will only apply to
       volume types which support fsGroup based ownership(and permissions).
       It will have no effect on ephemeral volume types such as: secret, configmaps
       and emptydir.
       Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional string fsGroupChangePolicy = 9;
      Specified by:
      hasFsGroupChangePolicy in interface V1.PodSecurityContextOrBuilder
    • getFsGroupChangePolicy

      public String getFsGroupChangePolicy()
       fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
       before being exposed inside Pod. This field will only apply to
       volume types which support fsGroup based ownership(and permissions).
       It will have no effect on ephemeral volume types such as: secret, configmaps
       and emptydir.
       Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional string fsGroupChangePolicy = 9;
      Specified by:
      getFsGroupChangePolicy in interface V1.PodSecurityContextOrBuilder
    • getFsGroupChangePolicyBytes

      public com.google.protobuf.ByteString getFsGroupChangePolicyBytes()
       fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
       before being exposed inside Pod. This field will only apply to
       volume types which support fsGroup based ownership(and permissions).
       It will have no effect on ephemeral volume types such as: secret, configmaps
       and emptydir.
       Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional string fsGroupChangePolicy = 9;
      Specified by:
      getFsGroupChangePolicyBytes in interface V1.PodSecurityContextOrBuilder
    • hasSeccompProfile

      public boolean hasSeccompProfile()
       The seccomp options to use by the containers in this pod.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SeccompProfile seccompProfile = 10;
      Specified by:
      hasSeccompProfile in interface V1.PodSecurityContextOrBuilder
    • getSeccompProfile

      public V1.SeccompProfile getSeccompProfile()
       The seccomp options to use by the containers in this pod.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SeccompProfile seccompProfile = 10;
      Specified by:
      getSeccompProfile in interface V1.PodSecurityContextOrBuilder
    • getSeccompProfileOrBuilder

      public V1.SeccompProfileOrBuilder getSeccompProfileOrBuilder()
       The seccomp options to use by the containers in this pod.
       Note that this field cannot be set when spec.os.name is windows.
       +optional
       
      optional .k8s.io.api.core.v1.SeccompProfile seccompProfile = 10;
      Specified by:
      getSeccompProfileOrBuilder in interface V1.PodSecurityContextOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static V1.PodSecurityContext parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static V1.PodSecurityContext parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static V1.PodSecurityContext parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static V1.PodSecurityContext parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public V1.PodSecurityContext.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static V1.PodSecurityContext.Builder newBuilder()
    • newBuilder

      public static V1.PodSecurityContext.Builder newBuilder(V1.PodSecurityContext prototype)
    • toBuilder

      public V1.PodSecurityContext.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected V1.PodSecurityContext.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static V1.PodSecurityContext getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<V1.PodSecurityContext> parser()
    • getParserForType

      public com.google.protobuf.Parser<V1.PodSecurityContext> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public V1.PodSecurityContext getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder