2 Copyright The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
18 // This file was autogenerated by go-to-protobuf. Do not edit it manually!
22 package k8s.io.api.policy.v1beta1;
24 import "k8s.io/api/core/v1/generated.proto";
25 import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
26 import "k8s.io/apimachinery/pkg/runtime/generated.proto";
27 import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28 import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
30 // Package-wide variables from generator "generated".
31 option go_package = "v1beta1";
33 // AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
34 message AllowedFlexVolume {
35 // driver is the name of the Flexvolume driver.
36 optional string driver = 1;
39 // AllowedHostPath defines the host volume conditions that will be enabled by a policy
40 // for pods to use. It requires the path prefix to be defined.
41 message AllowedHostPath {
42 // pathPrefix is the path prefix that the host volume must match.
43 // It does not support `*`.
44 // Trailing slashes are trimmed when validating the path prefix with a host path.
47 // `/foo` would allow `/foo`, `/foo/` and `/foo/bar`
48 // `/foo` would not allow `/food` or `/etc/foo`
49 optional string pathPrefix = 1;
51 // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.
53 optional bool readOnly = 2;
56 // Eviction evicts a pod from its node subject to certain policies and safety constraints.
57 // This is a subresource of Pod. A request to cause such an eviction is
58 // created by POSTing to .../pods/<pod name>/evictions.
60 // ObjectMeta describes the pod that is being evicted.
62 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
64 // DeleteOptions may be provided
66 optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
69 // FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
70 message FSGroupStrategyOptions {
71 // rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
73 optional string rule = 1;
75 // ranges are the allowed ranges of fs groups. If you would like to force a single
76 // fs group then supply a single range with the same start and end. Required for MustRunAs.
78 repeated IDRange ranges = 2;
81 // HostPortRange defines a range of host ports that will be enabled by a policy
82 // for pods to use. It requires both the start and end to be defined.
83 message HostPortRange {
84 // min is the start of the range, inclusive.
85 optional int32 min = 1;
87 // max is the end of the range, inclusive.
88 optional int32 max = 2;
91 // IDRange provides a min/max of an allowed range of IDs.
93 // min is the start of the range, inclusive.
94 optional int64 min = 1;
96 // max is the end of the range, inclusive.
97 optional int64 max = 2;
100 // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
101 message PodDisruptionBudget {
103 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
105 // Specification of the desired behavior of the PodDisruptionBudget.
107 optional PodDisruptionBudgetSpec spec = 2;
109 // Most recently observed status of the PodDisruptionBudget.
111 optional PodDisruptionBudgetStatus status = 3;
114 // PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
115 message PodDisruptionBudgetList {
117 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
119 repeated PodDisruptionBudget items = 2;
122 // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
123 message PodDisruptionBudgetSpec {
124 // An eviction is allowed if at least "minAvailable" pods selected by
125 // "selector" will still be available after the eviction, i.e. even in the
126 // absence of the evicted pod. So for example you can prevent all voluntary
127 // evictions by specifying "100%".
129 optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
131 // Label query over pods whose evictions are managed by the disruption
134 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
136 // An eviction is allowed if at most "maxUnavailable" pods selected by
137 // "selector" are unavailable after the eviction, i.e. even in absence of
138 // the evicted pod. For example, one can prevent all voluntary evictions
139 // by specifying 0. This is a mutually exclusive setting with "minAvailable".
141 optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
144 // PodDisruptionBudgetStatus represents information about the status of a
145 // PodDisruptionBudget. Status may trail the actual state of a system.
146 message PodDisruptionBudgetStatus {
147 // Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other
148 // status informatio is valid only if observedGeneration equals to PDB's object generation.
150 optional int64 observedGeneration = 1;
152 // DisruptedPods contains information about pods whose eviction was
153 // processed by the API server eviction subresource handler but has not
154 // yet been observed by the PodDisruptionBudget controller.
155 // A pod will be in this map from the time when the API server processed the
156 // eviction request to the time when the pod is seen by PDB controller
157 // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
158 // and the value is the time when the API server processed the eviction request. If
159 // the deletion didn't occur and a pod is still there it will be removed from
160 // the list automatically by PodDisruptionBudget controller after some time.
161 // If everything goes smooth this map should be empty for the most of the time.
162 // Large number of entries in the map may indicate problems with pod deletions.
164 map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
166 // Number of pod disruptions that are currently allowed.
167 optional int32 disruptionsAllowed = 3;
169 // current number of healthy pods
170 optional int32 currentHealthy = 4;
172 // minimum desired number of healthy pods
173 optional int32 desiredHealthy = 5;
175 // total number of pods counted by this disruption budget
176 optional int32 expectedPods = 6;
179 // PodSecurityPolicy governs the ability to make requests that affect the Security Context
180 // that will be applied to a pod and container.
181 message PodSecurityPolicy {
182 // Standard object's metadata.
183 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
185 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
187 // spec defines the policy enforced.
189 optional PodSecurityPolicySpec spec = 2;
192 // PodSecurityPolicyList is a list of PodSecurityPolicy objects.
193 message PodSecurityPolicyList {
194 // Standard list metadata.
195 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
197 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
199 // items is a list of schema objects.
200 repeated PodSecurityPolicy items = 2;
203 // PodSecurityPolicySpec defines the policy enforced.
204 message PodSecurityPolicySpec {
205 // privileged determines if a pod can request to be run as privileged.
207 optional bool privileged = 1;
209 // defaultAddCapabilities is the default set of capabilities that will be added to the container
210 // unless the pod spec specifically drops the capability. You may not list a capability in both
211 // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly
212 // allowed, and need not be included in the allowedCapabilities list.
214 repeated string defaultAddCapabilities = 2;
216 // requiredDropCapabilities are the capabilities that will be dropped from the container. These
217 // are required to be dropped and cannot be added.
219 repeated string requiredDropCapabilities = 3;
221 // allowedCapabilities is a list of capabilities that can be requested to add to the container.
222 // Capabilities in this field may be added at the pod author's discretion.
223 // You must not list a capability in both allowedCapabilities and requiredDropCapabilities.
225 repeated string allowedCapabilities = 4;
227 // volumes is a white list of allowed volume plugins. Empty indicates that
228 // no volumes may be used. To allow all volumes you may use '*'.
230 repeated string volumes = 5;
232 // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
234 optional bool hostNetwork = 6;
236 // hostPorts determines which host port ranges are allowed to be exposed.
238 repeated HostPortRange hostPorts = 7;
240 // hostPID determines if the policy allows the use of HostPID in the pod spec.
242 optional bool hostPID = 8;
244 // hostIPC determines if the policy allows the use of HostIPC in the pod spec.
246 optional bool hostIPC = 9;
248 // seLinux is the strategy that will dictate the allowable labels that may be set.
249 optional SELinuxStrategyOptions seLinux = 10;
251 // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.
252 optional RunAsUserStrategyOptions runAsUser = 11;
254 // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set.
255 // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the
256 // RunAsGroup feature gate to be enabled.
258 optional RunAsGroupStrategyOptions runAsGroup = 22;
260 // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.
261 optional SupplementalGroupsStrategyOptions supplementalGroups = 12;
263 // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext.
264 optional FSGroupStrategyOptions fsGroup = 13;
266 // readOnlyRootFilesystem when set to true will force containers to run with a read only root file
267 // system. If the container specifically requests to run with a non-read only root file system
268 // the PSP should deny the pod.
269 // If set to false the container may run with a read only root file system if it wishes but it
270 // will not be forced to.
272 optional bool readOnlyRootFilesystem = 14;
274 // defaultAllowPrivilegeEscalation controls the default setting for whether a
275 // process can gain more privileges than its parent process.
277 optional bool defaultAllowPrivilegeEscalation = 15;
279 // allowPrivilegeEscalation determines if a pod can request to allow
280 // privilege escalation. If unspecified, defaults to true.
282 optional bool allowPrivilegeEscalation = 16;
284 // allowedHostPaths is a white list of allowed host paths. Empty indicates
285 // that all host paths may be used.
287 repeated AllowedHostPath allowedHostPaths = 17;
289 // allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all
290 // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes
291 // is allowed in the "volumes" field.
293 repeated AllowedFlexVolume allowedFlexVolumes = 18;
295 // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none.
296 // Each entry is either a plain sysctl name or ends in "*" in which case it is considered
297 // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed.
298 // Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.
301 // e.g. "foo/*" allows "foo/bar", "foo/baz", etc.
302 // e.g. "foo.*" allows "foo.bar", "foo.baz", etc.
304 repeated string allowedUnsafeSysctls = 19;
306 // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none.
307 // Each entry is either a plain sysctl name or ends in "*" in which case it is considered
308 // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.
311 // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc.
312 // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc.
314 repeated string forbiddenSysctls = 20;
316 // AllowedProcMountTypes is a whitelist of allowed ProcMountTypes.
317 // Empty or nil indicates that only the DefaultProcMountType may be used.
318 // This requires the ProcMountType feature flag to be enabled.
320 repeated string allowedProcMountTypes = 21;
323 // RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.
324 message RunAsGroupStrategyOptions {
325 // rule is the strategy that will dictate the allowable RunAsGroup values that may be set.
326 optional string rule = 1;
328 // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid
329 // then supply a single range with the same start and end. Required for MustRunAs.
331 repeated IDRange ranges = 2;
334 // RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.
335 message RunAsUserStrategyOptions {
336 // rule is the strategy that will dictate the allowable RunAsUser values that may be set.
337 optional string rule = 1;
339 // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid
340 // then supply a single range with the same start and end. Required for MustRunAs.
342 repeated IDRange ranges = 2;
345 // SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.
346 message SELinuxStrategyOptions {
347 // rule is the strategy that will dictate the allowable labels that may be set.
348 optional string rule = 1;
350 // seLinuxOptions required to run as; required for MustRunAs
351 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
353 optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2;
356 // SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
357 message SupplementalGroupsStrategyOptions {
358 // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
360 optional string rule = 1;
362 // ranges are the allowed ranges of supplemental groups. If you would like to force a single
363 // supplemental group then supply a single range with the same start and end. Required for MustRunAs.
365 repeated IDRange ranges = 2;