Module policy/v1beta1

@pulumi/kubernetes > policy > v1beta1

Index

types/input.ts types/output.ts

function isEviction

isEviction(o: any): boolean

function isPodDisruptionBudget

isPodDisruptionBudget(o: any): boolean

function isPodDisruptionBudgetList

isPodDisruptionBudgetList(o: any): boolean

function isPodSecurityPolicy

isPodSecurityPolicy(o: any): boolean

function isPodSecurityPolicyList

isPodSecurityPolicyList(o: any): boolean

interface AllowedFlexVolume

AllowedFlexVolume represents a single Flexvolume that is allowed to be used.

property driver

driver: string;

driver is the name of the Flexvolume driver.

interface AllowedHostPath

AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.

property pathPrefix

pathPrefix: string;

pathPrefix is the path prefix that the host volume must match. It does not support *. Trailing slashes are trimmed when validating the path prefix with a host path.

Examples: /foo would allow /foo, /foo/ and /foo/bar /foo would not allow /food or /etc/foo

property readOnly

readOnly: boolean;

when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.

interface Eviction

Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to …/pods//evictions.

property apiVersion

apiVersion: string;

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

property deleteOptions

deleteOptions: DeleteOptions;

DeleteOptions may be provided

property kind

kind: string;

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

property metadata

metadata: ObjectMeta;

ObjectMeta describes the pod that is being evicted.

interface FSGroupStrategyOptions

FSGroupStrategyOptions defines the strategy type and options used to create the strategy.

property ranges

ranges: IDRange[];

ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs.

property rule

rule: string;

rule is the strategy that will dictate what FSGroup is used in the SecurityContext.

interface HostPortRange

HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.

property max

max: number;

max is the end of the range, inclusive.

property min

min: number;

min is the start of the range, inclusive.

interface IDRange

IDRange provides a min/max of an allowed range of IDs.

property max

max: number;

max is the end of the range, inclusive.

property min

min: number;

min is the start of the range, inclusive.

interface PodDisruptionBudget

PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods

property apiVersion

apiVersion: string;

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

property kind

kind: string;

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

property metadata

metadata: ObjectMeta;

property spec

spec: PodDisruptionBudgetSpec;

Specification of the desired behavior of the PodDisruptionBudget.

property status

status: PodDisruptionBudgetStatus;

Most recently observed status of the PodDisruptionBudget.

interface PodDisruptionBudgetList

PodDisruptionBudgetList is a collection of PodDisruptionBudgets.

property apiVersion

apiVersion: string;

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

property items

items: PodDisruptionBudget[];

property kind

kind: string;

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

property metadata

metadata: ListMeta;

interface PodDisruptionBudgetSpec

PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.

property maxUnavailable

maxUnavailable: number | string;

An eviction is allowed if at most “maxUnavailable” pods selected by “selector” are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with “minAvailable”.

property minAvailable

minAvailable: number | string;

An eviction is allowed if at least “minAvailable” pods selected by “selector” will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying “100%”.

property selector

selector: LabelSelector;

Label query over pods whose evictions are managed by the disruption budget.

interface PodDisruptionBudgetStatus

PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.

property currentHealthy

currentHealthy: number;

current number of healthy pods

property desiredHealthy

desiredHealthy: number;

minimum desired number of healthy pods

property disruptedPods

disruptedPods: object;

DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn’t occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.

property disruptionsAllowed

disruptionsAllowed: number;

Number of pod disruptions that are currently allowed.

property expectedPods

expectedPods: number;

total number of pods counted by this disruption budget

property observedGeneration

observedGeneration: number;

Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other status informatio is valid only if observedGeneration equals to PDB’s object generation.

interface PodSecurityPolicy

PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.

property apiVersion

apiVersion: string;

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

property kind

kind: string;

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

property metadata

metadata: ObjectMeta;

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

property spec

spec: PodSecurityPolicySpec;

spec defines the policy enforced.

interface PodSecurityPolicyList

PodSecurityPolicyList is a list of PodSecurityPolicy objects.

property apiVersion

apiVersion: string;

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

property items

items: PodSecurityPolicy[];

items is a list of schema objects.

property kind

kind: string;

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

property metadata

metadata: ListMeta;

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

interface PodSecurityPolicySpec

PodSecurityPolicySpec defines the policy enforced.

property allowPrivilegeEscalation

allowPrivilegeEscalation: boolean;

allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.

property allowedCapabilities

allowedCapabilities: string[];

allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author’s discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities.

property allowedFlexVolumes

allowedFlexVolumes: AllowedFlexVolume[];

allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the “volumes” field.

property allowedHostPaths

allowedHostPaths: AllowedHostPath[];

allowedHostPaths is a white list of allowed host paths. Empty indicates that all host paths may be used.

property allowedProcMountTypes

allowedProcMountTypes: string[];

AllowedProcMountTypes is a whitelist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled.

property allowedUnsafeSysctls

allowedUnsafeSysctls: string[];

allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in “*” in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.

Examples: e.g. “foo/” allows “foo/bar”, “foo/baz”, etc. e.g. “foo.” allows “foo.bar”, “foo.baz”, etc.

property defaultAddCapabilities

defaultAddCapabilities: string[];

defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list.

property defaultAllowPrivilegeEscalation

defaultAllowPrivilegeEscalation: boolean;

defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.

property forbiddenSysctls

forbiddenSysctls: string[];

forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in “*” in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.

Examples: e.g. “foo/” forbids “foo/bar”, “foo/baz”, etc. e.g. “foo.” forbids “foo.bar”, “foo.baz”, etc.

property fsGroup

fsGroup: FSGroupStrategyOptions;

fsGroup is the strategy that will dictate what fs group is used by the SecurityContext.

property hostIPC

hostIPC: boolean;

hostIPC determines if the policy allows the use of HostIPC in the pod spec.

property hostNetwork

hostNetwork: boolean;

hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.

property hostPID

hostPID: boolean;

hostPID determines if the policy allows the use of HostPID in the pod spec.

property hostPorts

hostPorts: HostPortRange[];

hostPorts determines which host port ranges are allowed to be exposed.

property privileged

privileged: boolean;

privileged determines if a pod can request to be run as privileged.

property readOnlyRootFilesystem

readOnlyRootFilesystem: boolean;

readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.

property requiredDropCapabilities

requiredDropCapabilities: string[];

requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.

property runAsGroup

runAsGroup: RunAsGroupStrategyOptions;

RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod’s RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled.

property runAsUser

runAsUser: RunAsUserStrategyOptions;

runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.

property seLinux

seLinux: SELinuxStrategyOptions;

seLinux is the strategy that will dictate the allowable labels that may be set.

property supplementalGroups

supplementalGroups: SupplementalGroupsStrategyOptions;

supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.

property volumes

volumes: string[];

volumes is a white list of allowed volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use ‘*’.

interface RunAsGroupStrategyOptions

RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.

property ranges

ranges: IDRange[];

ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs.

property rule

rule: string;

rule is the strategy that will dictate the allowable RunAsGroup values that may be set.

interface RunAsUserStrategyOptions

RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.

property ranges

ranges: IDRange[];

ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs.

property rule

rule: string;

rule is the strategy that will dictate the allowable RunAsUser values that may be set.

interface SELinuxStrategyOptions

SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.

property rule

rule: string;

rule is the strategy that will dictate the allowable labels that may be set.

property seLinuxOptions

seLinuxOptions: SELinuxOptions;

seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

interface SupplementalGroupsStrategyOptions

SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.

property ranges

ranges: IDRange[];

ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs.

property rule

rule: string;

rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.