generated.proto 17 KB

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