generated.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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.admissionregistration.v1beta1;
  16. import "k8s.io/api/admissionregistration/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. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/admissionregistration/v1beta1";
  22. // MutatingWebhook describes an admission webhook and the resources and operations it applies to.
  23. message MutatingWebhook {
  24. // The name of the admission webhook.
  25. // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
  26. // "imagepolicy" is the name of the webhook, and kubernetes.io is the name
  27. // of the organization.
  28. // Required.
  29. optional string name = 1;
  30. // ClientConfig defines how to communicate with the hook.
  31. // Required
  32. optional WebhookClientConfig clientConfig = 2;
  33. // Rules describes what operations on what resources/subresources the webhook cares about.
  34. // The webhook cares about an operation if it matches _any_ Rule.
  35. // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
  36. // from putting the cluster in a state which cannot be recovered from without completely
  37. // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
  38. // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
  39. repeated k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
  40. // FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
  41. // allowed values are Ignore or Fail. Defaults to Ignore.
  42. // +optional
  43. optional string failurePolicy = 4;
  44. // matchPolicy defines how the "rules" list is used to match incoming requests.
  45. // Allowed values are "Exact" or "Equivalent".
  46. //
  47. // - Exact: match a request only if it exactly matches a specified rule.
  48. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
  49. // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
  50. // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  51. //
  52. // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
  53. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
  54. // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
  55. // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
  56. //
  57. // Defaults to "Exact"
  58. // +optional
  59. optional string matchPolicy = 9;
  60. // NamespaceSelector decides whether to run the webhook on an object based
  61. // on whether the namespace for that object matches the selector. If the
  62. // object itself is a namespace, the matching is performed on
  63. // object.metadata.labels. If the object is another cluster scoped resource,
  64. // it never skips the webhook.
  65. //
  66. // For example, to run the webhook on any objects whose namespace is not
  67. // associated with "runlevel" of "0" or "1"; you will set the selector as
  68. // follows:
  69. // "namespaceSelector": {
  70. // "matchExpressions": [
  71. // {
  72. // "key": "runlevel",
  73. // "operator": "NotIn",
  74. // "values": [
  75. // "0",
  76. // "1"
  77. // ]
  78. // }
  79. // ]
  80. // }
  81. //
  82. // If instead you want to only run the webhook on any objects whose
  83. // namespace is associated with the "environment" of "prod" or "staging";
  84. // you will set the selector as follows:
  85. // "namespaceSelector": {
  86. // "matchExpressions": [
  87. // {
  88. // "key": "environment",
  89. // "operator": "In",
  90. // "values": [
  91. // "prod",
  92. // "staging"
  93. // ]
  94. // }
  95. // ]
  96. // }
  97. //
  98. // See
  99. // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
  100. // for more examples of label selectors.
  101. //
  102. // Default to the empty LabelSelector, which matches everything.
  103. // +optional
  104. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
  105. // ObjectSelector decides whether to run the webhook based on if the
  106. // object has matching labels. objectSelector is evaluated against both
  107. // the oldObject and newObject that would be sent to the webhook, and
  108. // is considered to match if either object matches the selector. A null
  109. // object (oldObject in the case of create, or newObject in the case of
  110. // delete) or an object that cannot have labels (like a
  111. // DeploymentRollback or a PodProxyOptions object) is not considered to
  112. // match.
  113. // Use the object selector only if the webhook is opt-in, because end
  114. // users may skip the admission webhook by setting the labels.
  115. // Default to the empty LabelSelector, which matches everything.
  116. // +optional
  117. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
  118. // SideEffects states whether this webhook has side effects.
  119. // Acceptable values are: Unknown, None, Some, NoneOnDryRun
  120. // Webhooks with side effects MUST implement a reconciliation system, since a request may be
  121. // rejected by a future step in the admission chain and the side effects therefore need to be undone.
  122. // Requests with the dryRun attribute will be auto-rejected if they match a webhook with
  123. // sideEffects == Unknown or Some. Defaults to Unknown.
  124. // +optional
  125. optional string sideEffects = 6;
  126. // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
  127. // the webhook call will be ignored or the API call will fail based on the
  128. // failure policy.
  129. // The timeout value must be between 1 and 30 seconds.
  130. // Default to 30 seconds.
  131. // +optional
  132. optional int32 timeoutSeconds = 7;
  133. // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
  134. // versions the Webhook expects. API server will try to use first version in
  135. // the list which it supports. If none of the versions specified in this list
  136. // supported by API server, validation will fail for this object.
  137. // If a persisted webhook configuration specifies allowed versions and does not
  138. // include any versions known to the API Server, calls to the webhook will fail
  139. // and be subject to the failure policy.
  140. // Default to `['v1beta1']`.
  141. // +optional
  142. repeated string admissionReviewVersions = 8;
  143. // reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
  144. // Allowed values are "Never" and "IfNeeded".
  145. //
  146. // Never: the webhook will not be called more than once in a single admission evaluation.
  147. //
  148. // IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
  149. // if the object being admitted is modified by other admission plugins after the initial webhook call.
  150. // Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
  151. // Note:
  152. // * the number of additional invocations is not guaranteed to be exactly one.
  153. // * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
  154. // * webhooks that use this option may be reordered to minimize the number of additional invocations.
  155. // * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
  156. //
  157. // Defaults to "Never".
  158. // +optional
  159. optional string reinvocationPolicy = 10;
  160. }
  161. // MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
  162. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead.
  163. message MutatingWebhookConfiguration {
  164. // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
  165. // +optional
  166. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  167. // Webhooks is a list of webhooks and the affected resources and operations.
  168. // +optional
  169. // +patchMergeKey=name
  170. // +patchStrategy=merge
  171. repeated MutatingWebhook Webhooks = 2;
  172. }
  173. // MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
  174. message MutatingWebhookConfigurationList {
  175. // Standard list metadata.
  176. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  177. // +optional
  178. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  179. // List of MutatingWebhookConfiguration.
  180. repeated MutatingWebhookConfiguration items = 2;
  181. }
  182. // ServiceReference holds a reference to Service.legacy.k8s.io
  183. message ServiceReference {
  184. // `namespace` is the namespace of the service.
  185. // Required
  186. optional string namespace = 1;
  187. // `name` is the name of the service.
  188. // Required
  189. optional string name = 2;
  190. // `path` is an optional URL path which will be sent in any request to
  191. // this service.
  192. // +optional
  193. optional string path = 3;
  194. // If specified, the port on the service that hosting webhook.
  195. // Default to 443 for backward compatibility.
  196. // `port` should be a valid port number (1-65535, inclusive).
  197. // +optional
  198. optional int32 port = 4;
  199. }
  200. // ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
  201. message ValidatingWebhook {
  202. // The name of the admission webhook.
  203. // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
  204. // "imagepolicy" is the name of the webhook, and kubernetes.io is the name
  205. // of the organization.
  206. // Required.
  207. optional string name = 1;
  208. // ClientConfig defines how to communicate with the hook.
  209. // Required
  210. optional WebhookClientConfig clientConfig = 2;
  211. // Rules describes what operations on what resources/subresources the webhook cares about.
  212. // The webhook cares about an operation if it matches _any_ Rule.
  213. // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
  214. // from putting the cluster in a state which cannot be recovered from without completely
  215. // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
  216. // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
  217. repeated k8s.io.api.admissionregistration.v1.RuleWithOperations rules = 3;
  218. // FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
  219. // allowed values are Ignore or Fail. Defaults to Ignore.
  220. // +optional
  221. optional string failurePolicy = 4;
  222. // matchPolicy defines how the "rules" list is used to match incoming requests.
  223. // Allowed values are "Exact" or "Equivalent".
  224. //
  225. // - Exact: match a request only if it exactly matches a specified rule.
  226. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
  227. // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
  228. // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
  229. //
  230. // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
  231. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
  232. // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
  233. // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
  234. //
  235. // Defaults to "Exact"
  236. // +optional
  237. optional string matchPolicy = 9;
  238. // NamespaceSelector decides whether to run the webhook on an object based
  239. // on whether the namespace for that object matches the selector. If the
  240. // object itself is a namespace, the matching is performed on
  241. // object.metadata.labels. If the object is another cluster scoped resource,
  242. // it never skips the webhook.
  243. //
  244. // For example, to run the webhook on any objects whose namespace is not
  245. // associated with "runlevel" of "0" or "1"; you will set the selector as
  246. // follows:
  247. // "namespaceSelector": {
  248. // "matchExpressions": [
  249. // {
  250. // "key": "runlevel",
  251. // "operator": "NotIn",
  252. // "values": [
  253. // "0",
  254. // "1"
  255. // ]
  256. // }
  257. // ]
  258. // }
  259. //
  260. // If instead you want to only run the webhook on any objects whose
  261. // namespace is associated with the "environment" of "prod" or "staging";
  262. // you will set the selector as follows:
  263. // "namespaceSelector": {
  264. // "matchExpressions": [
  265. // {
  266. // "key": "environment",
  267. // "operator": "In",
  268. // "values": [
  269. // "prod",
  270. // "staging"
  271. // ]
  272. // }
  273. // ]
  274. // }
  275. //
  276. // See
  277. // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
  278. // for more examples of label selectors.
  279. //
  280. // Default to the empty LabelSelector, which matches everything.
  281. // +optional
  282. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
  283. // ObjectSelector decides whether to run the webhook based on if the
  284. // object has matching labels. objectSelector is evaluated against both
  285. // the oldObject and newObject that would be sent to the webhook, and
  286. // is considered to match if either object matches the selector. A null
  287. // object (oldObject in the case of create, or newObject in the case of
  288. // delete) or an object that cannot have labels (like a
  289. // DeploymentRollback or a PodProxyOptions object) is not considered to
  290. // match.
  291. // Use the object selector only if the webhook is opt-in, because end
  292. // users may skip the admission webhook by setting the labels.
  293. // Default to the empty LabelSelector, which matches everything.
  294. // +optional
  295. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
  296. // SideEffects states whether this webhook has side effects.
  297. // Acceptable values are: Unknown, None, Some, NoneOnDryRun
  298. // Webhooks with side effects MUST implement a reconciliation system, since a request may be
  299. // rejected by a future step in the admission chain and the side effects therefore need to be undone.
  300. // Requests with the dryRun attribute will be auto-rejected if they match a webhook with
  301. // sideEffects == Unknown or Some. Defaults to Unknown.
  302. // +optional
  303. optional string sideEffects = 6;
  304. // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
  305. // the webhook call will be ignored or the API call will fail based on the
  306. // failure policy.
  307. // The timeout value must be between 1 and 30 seconds.
  308. // Default to 30 seconds.
  309. // +optional
  310. optional int32 timeoutSeconds = 7;
  311. // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
  312. // versions the Webhook expects. API server will try to use first version in
  313. // the list which it supports. If none of the versions specified in this list
  314. // supported by API server, validation will fail for this object.
  315. // If a persisted webhook configuration specifies allowed versions and does not
  316. // include any versions known to the API Server, calls to the webhook will fail
  317. // and be subject to the failure policy.
  318. // Default to `['v1beta1']`.
  319. // +optional
  320. repeated string admissionReviewVersions = 8;
  321. }
  322. // ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
  323. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead.
  324. message ValidatingWebhookConfiguration {
  325. // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
  326. // +optional
  327. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  328. // Webhooks is a list of webhooks and the affected resources and operations.
  329. // +optional
  330. // +patchMergeKey=name
  331. // +patchStrategy=merge
  332. repeated ValidatingWebhook Webhooks = 2;
  333. }
  334. // ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.
  335. message ValidatingWebhookConfigurationList {
  336. // Standard list metadata.
  337. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  338. // +optional
  339. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  340. // List of ValidatingWebhookConfiguration.
  341. repeated ValidatingWebhookConfiguration items = 2;
  342. }
  343. // WebhookClientConfig contains the information to make a TLS
  344. // connection with the webhook
  345. message WebhookClientConfig {
  346. // `url` gives the location of the webhook, in standard URL form
  347. // (`scheme://host:port/path`). Exactly one of `url` or `service`
  348. // must be specified.
  349. //
  350. // The `host` should not refer to a service running in the cluster; use
  351. // the `service` field instead. The host might be resolved via external
  352. // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
  353. // in-cluster DNS as that would be a layering violation). `host` may
  354. // also be an IP address.
  355. //
  356. // Please note that using `localhost` or `127.0.0.1` as a `host` is
  357. // risky unless you take great care to run this webhook on all hosts
  358. // which run an apiserver which might need to make calls to this
  359. // webhook. Such installs are likely to be non-portable, i.e., not easy
  360. // to turn up in a new cluster.
  361. //
  362. // The scheme must be "https"; the URL must begin with "https://".
  363. //
  364. // A path is optional, and if present may be any string permissible in
  365. // a URL. You may use the path to pass an arbitrary string to the
  366. // webhook, for example, a cluster identifier.
  367. //
  368. // Attempting to use a user or basic auth e.g. "user:password@" is not
  369. // allowed. Fragments ("#...") and query parameters ("?...") are not
  370. // allowed, either.
  371. //
  372. // +optional
  373. optional string url = 3;
  374. // `service` is a reference to the service for this webhook. Either
  375. // `service` or `url` must be specified.
  376. //
  377. // If the webhook is running within the cluster, then you should use `service`.
  378. //
  379. // +optional
  380. optional ServiceReference service = 1;
  381. // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
  382. // If unspecified, system trust roots on the apiserver are used.
  383. // +optional
  384. optional bytes caBundle = 2;
  385. }