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.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1;
24 import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
25 import "k8s.io/apimachinery/pkg/runtime/generated.proto";
26 import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28 // Package-wide variables from generator "generated".
29 option go_package = "v1beta1";
31 // ConversionRequest describes the conversion request parameters.
32 message ConversionRequest {
33 // `uid` is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
34 // otherwise identical (parallel requests, requests when earlier requests did not modify etc)
35 // The UID is meant to track the round trip (request/response) between the KAS and the WebHook, not the user request.
36 // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
37 optional string uid = 1;
39 // `desiredAPIVersion` is the version to convert given objects to. e.g. "myapi.example.com/v1"
40 optional string desiredAPIVersion = 2;
42 // `objects` is the list of CR objects to be converted.
43 repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3;
46 // ConversionResponse describes a conversion response.
47 message ConversionResponse {
48 // `uid` is an identifier for the individual request/response.
49 // This should be copied over from the corresponding AdmissionRequest.
50 optional string uid = 1;
52 // `convertedObjects` is the list of converted version of `request.objects` if the `result` is successful otherwise empty.
53 // The webhook is expected to set apiVersion of these objects to the ConversionRequest.desiredAPIVersion. The list
54 // must also has the same size as input list with the same objects in the same order(i.e. equal UIDs and object meta)
55 repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2;
57 // `result` contains the result of conversion with extra details if the conversion failed. `result.status` determines if
58 // the conversion failed or succeeded. The `result.status` field is required and represent the success or failure of the
59 // conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set
60 // `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message`
61 // will be used to construct an error message for the end user.
62 optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3;
65 // ConversionReview describes a conversion request/response.
66 message ConversionReview {
67 // `request` describes the attributes for the conversion request.
69 optional ConversionRequest request = 1;
71 // `response` describes the attributes for the conversion response.
73 optional ConversionResponse response = 2;
76 // CustomResourceColumnDefinition specifies a column for server side printing.
77 message CustomResourceColumnDefinition {
78 // name is a human readable name for the column.
79 optional string name = 1;
81 // type is an OpenAPI type definition for this column.
82 // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
83 optional string type = 2;
85 // format is an optional OpenAPI type definition for this column. The 'name' format is applied
86 // to the primary identifier column to assist in clients identifying column is the resource name.
87 // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
89 optional string format = 3;
91 // description is a human readable description of this column.
93 optional string description = 4;
95 // priority is an integer defining the relative importance of this column compared to others. Lower
96 // numbers are considered higher priority. Columns that may be omitted in limited space scenarios
97 // should be given a higher priority.
99 optional int32 priority = 5;
101 // JSONPath is a simple JSON path, i.e. with array notation.
102 optional string JSONPath = 6;
105 // CustomResourceConversion describes how to convert different versions of a CR.
106 message CustomResourceConversion {
107 // `strategy` specifies the conversion strategy. Allowed values are:
108 // - `None`: The converter only change the apiVersion and would not touch any other field in the CR.
109 // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information is needed for this option.
110 optional string strategy = 1;
112 // `webhookClientConfig` is the instructions for how to call the webhook if strategy is `Webhook`. This field is
113 // alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
115 optional WebhookClientConfig webhookClientConfig = 2;
118 // CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format
119 // <.spec.name>.<.spec.group>.
120 message CustomResourceDefinition {
121 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
123 // Spec describes how the user wants the resources to appear
124 optional CustomResourceDefinitionSpec spec = 2;
126 // Status indicates the actual state of the CustomResourceDefinition
128 optional CustomResourceDefinitionStatus status = 3;
131 // CustomResourceDefinitionCondition contains details for the current condition of this pod.
132 message CustomResourceDefinitionCondition {
133 // Type is the type of the condition.
134 optional string type = 1;
136 // Status is the status of the condition.
137 // Can be True, False, Unknown.
138 optional string status = 2;
140 // Last time the condition transitioned from one status to another.
142 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
144 // Unique, one-word, CamelCase reason for the condition's last transition.
146 optional string reason = 4;
148 // Human-readable message indicating details about last transition.
150 optional string message = 5;
153 // CustomResourceDefinitionList is a list of CustomResourceDefinition objects.
154 message CustomResourceDefinitionList {
155 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
157 // Items individual CustomResourceDefinitions
158 repeated CustomResourceDefinition items = 2;
161 // CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
162 message CustomResourceDefinitionNames {
163 // Plural is the plural name of the resource to serve. It must match the name of the CustomResourceDefinition-registration
164 // too: plural.group and it must be all lowercase.
165 optional string plural = 1;
167 // Singular is the singular name of the resource. It must be all lowercase Defaults to lowercased <kind>
169 optional string singular = 2;
171 // ShortNames are short names for the resource. It must be all lowercase.
173 repeated string shortNames = 3;
175 // Kind is the serialized kind of the resource. It is normally CamelCase and singular.
176 optional string kind = 4;
178 // ListKind is the serialized kind of the list for this resource. Defaults to <kind>List.
180 optional string listKind = 5;
182 // Categories is a list of grouped resources custom resources belong to (e.g. 'all')
184 repeated string categories = 6;
187 // CustomResourceDefinitionSpec describes how a user wants their resource to appear
188 message CustomResourceDefinitionSpec {
189 // Group is the group this resource belongs in
190 optional string group = 1;
192 // Version is the version this resource belongs in
193 // Should be always first item in Versions field if provided.
194 // Optional, but at least one of Version or Versions must be set.
195 // Deprecated: Please use `Versions`.
197 optional string version = 2;
199 // Names are the names used to describe this custom resource
200 optional CustomResourceDefinitionNames names = 3;
202 // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
203 optional string scope = 4;
205 // Validation describes the validation methods for CustomResources
206 // Optional, the global validation schema for all versions.
207 // Top-level and per-version schemas are mutually exclusive.
209 optional CustomResourceValidation validation = 5;
211 // Subresources describes the subresources for CustomResource
212 // Optional, the global subresources for all versions.
213 // Top-level and per-version subresources are mutually exclusive.
215 optional CustomResourceSubresources subresources = 6;
217 // Versions is the list of all supported versions for this resource.
218 // If Version field is provided, this field is optional.
219 // Validation: All versions must use the same validation schema for now. i.e., top
220 // level Validation field is applied to all of these versions.
221 // Order: The version name will be used to compute the order.
222 // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered
223 // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version),
224 // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first
225 // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing
226 // major version, then minor version. An example sorted list of versions:
227 // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
229 repeated CustomResourceDefinitionVersion versions = 7;
231 // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
232 // Optional, the global columns for all versions.
233 // Top-level and per-version columns are mutually exclusive.
235 repeated CustomResourceColumnDefinition additionalPrinterColumns = 8;
237 // `conversion` defines conversion settings for the CRD.
239 optional CustomResourceConversion conversion = 9;
242 // CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition
243 message CustomResourceDefinitionStatus {
244 // Conditions indicate state for particular aspects of a CustomResourceDefinition
245 repeated CustomResourceDefinitionCondition conditions = 1;
247 // AcceptedNames are the names that are actually being used to serve discovery
248 // They may be different than the names in spec.
249 optional CustomResourceDefinitionNames acceptedNames = 2;
251 // StoredVersions are all versions of CustomResources that were ever persisted. Tracking these
252 // versions allows a migration path for stored versions in etcd. The field is mutable
253 // so the migration controller can first finish a migration to another version (i.e.
254 // that no old objects are left in the storage), and then remove the rest of the
255 // versions from this list.
256 // None of the versions in this list can be removed from the spec.Versions field.
257 repeated string storedVersions = 3;
260 // CustomResourceDefinitionVersion describes a version for CRD.
261 message CustomResourceDefinitionVersion {
262 // Name is the version name, e.g. “v1”, “v2beta1”, etc.
263 optional string name = 1;
265 // Served is a flag enabling/disabling this version from being served via REST APIs
266 optional bool served = 2;
268 // Storage flags the version as storage version. There must be exactly one
269 // flagged as storage version.
270 optional bool storage = 3;
272 // Schema describes the schema for CustomResource used in validation, pruning, and defaulting.
273 // Top-level and per-version schemas are mutually exclusive.
274 // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead)
275 // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
277 optional CustomResourceValidation schema = 4;
279 // Subresources describes the subresources for CustomResource
280 // Top-level and per-version subresources are mutually exclusive.
281 // Per-version subresources must not all be set to identical values (top-level subresources should be used instead)
282 // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
284 optional CustomResourceSubresources subresources = 5;
286 // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
287 // Top-level and per-version columns are mutually exclusive.
288 // Per-version columns must not all be set to identical values (top-level columns should be used instead)
289 // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
290 // NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an
291 // update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must
292 // be explicitly set to null
294 repeated CustomResourceColumnDefinition additionalPrinterColumns = 6;
297 // CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
298 message CustomResourceSubresourceScale {
299 // SpecReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Spec.Replicas.
300 // Only JSON paths without the array notation are allowed.
301 // Must be a JSON Path under .spec.
302 // If there is no value under the given path in the CustomResource, the /scale subresource will return an error on GET.
303 optional string specReplicasPath = 1;
305 // StatusReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Replicas.
306 // Only JSON paths without the array notation are allowed.
307 // Must be a JSON Path under .status.
308 // If there is no value under the given path in the CustomResource, the status replica value in the /scale subresource
309 // will default to 0.
310 optional string statusReplicasPath = 2;
312 // LabelSelectorPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Selector.
313 // Only JSON paths without the array notation are allowed.
314 // Must be a JSON Path under .status.
315 // Must be set to work with HPA.
316 // If there is no value under the given path in the CustomResource, the status label selector value in the /scale
317 // subresource will default to the empty string.
319 optional string labelSelectorPath = 3;
322 // CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources.
323 // Status is represented by the `.status` JSON path inside of a CustomResource. When set,
324 // * exposes a /status subresource for the custom resource
325 // * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza
326 // * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza
327 message CustomResourceSubresourceStatus {
330 // CustomResourceSubresources defines the status and scale subresources for CustomResources.
331 message CustomResourceSubresources {
332 // Status denotes the status subresource for CustomResources
334 optional CustomResourceSubresourceStatus status = 1;
336 // Scale denotes the scale subresource for CustomResources
338 optional CustomResourceSubresourceScale scale = 2;
341 // CustomResourceValidation is a list of validation methods for CustomResources.
342 message CustomResourceValidation {
343 // OpenAPIV3Schema is the OpenAPI v3 schema to be validated against.
345 optional JSONSchemaProps openAPIV3Schema = 1;
348 // ExternalDocumentation allows referencing an external resource for extended documentation.
349 message ExternalDocumentation {
350 optional string description = 1;
352 optional string url = 2;
355 // JSON represents any valid JSON value.
356 // These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil.
358 optional bytes raw = 1;
361 // JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
362 message JSONSchemaProps {
363 optional string id = 1;
365 optional string schema = 2;
367 optional string ref = 3;
369 optional string description = 4;
371 optional string type = 5;
373 optional string format = 6;
375 optional string title = 7;
377 optional JSON default = 8;
379 optional double maximum = 9;
381 optional bool exclusiveMaximum = 10;
383 optional double minimum = 11;
385 optional bool exclusiveMinimum = 12;
387 optional int64 maxLength = 13;
389 optional int64 minLength = 14;
391 optional string pattern = 15;
393 optional int64 maxItems = 16;
395 optional int64 minItems = 17;
397 optional bool uniqueItems = 18;
399 optional double multipleOf = 19;
401 repeated JSON enum = 20;
403 optional int64 maxProperties = 21;
405 optional int64 minProperties = 22;
407 repeated string required = 23;
409 optional JSONSchemaPropsOrArray items = 24;
411 repeated JSONSchemaProps allOf = 25;
413 repeated JSONSchemaProps oneOf = 26;
415 repeated JSONSchemaProps anyOf = 27;
417 optional JSONSchemaProps not = 28;
419 map<string, JSONSchemaProps> properties = 29;
421 optional JSONSchemaPropsOrBool additionalProperties = 30;
423 map<string, JSONSchemaProps> patternProperties = 31;
425 map<string, JSONSchemaPropsOrStringArray> dependencies = 32;
427 optional JSONSchemaPropsOrBool additionalItems = 33;
429 map<string, JSONSchemaProps> definitions = 34;
431 optional ExternalDocumentation externalDocs = 35;
433 optional JSON example = 36;
436 // JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
437 // or an array of JSONSchemaProps. Mainly here for serialization purposes.
438 message JSONSchemaPropsOrArray {
439 optional JSONSchemaProps schema = 1;
441 repeated JSONSchemaProps jSONSchemas = 2;
444 // JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value.
445 // Defaults to true for the boolean property.
446 message JSONSchemaPropsOrBool {
447 optional bool allows = 1;
449 optional JSONSchemaProps schema = 2;
452 // JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
453 message JSONSchemaPropsOrStringArray {
454 optional JSONSchemaProps schema = 1;
456 repeated string property = 2;
459 // ServiceReference holds a reference to Service.legacy.k8s.io
460 message ServiceReference {
461 // `namespace` is the namespace of the service.
463 optional string namespace = 1;
465 // `name` is the name of the service.
467 optional string name = 2;
469 // `path` is an optional URL path which will be sent in any request to
472 optional string path = 3;
475 // WebhookClientConfig contains the information to make a TLS
476 // connection with the webhook. It has the same field as admissionregistration.v1beta1.WebhookClientConfig.
477 message WebhookClientConfig {
478 // `url` gives the location of the webhook, in standard URL form
479 // (`scheme://host:port/path`). Exactly one of `url` or `service`
480 // must be specified.
482 // The `host` should not refer to a service running in the cluster; use
483 // the `service` field instead. The host might be resolved via external
484 // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
485 // in-cluster DNS as that would be a layering violation). `host` may
486 // also be an IP address.
488 // Please note that using `localhost` or `127.0.0.1` as a `host` is
489 // risky unless you take great care to run this webhook on all hosts
490 // which run an apiserver which might need to make calls to this
491 // webhook. Such installs are likely to be non-portable, i.e., not easy
492 // to turn up in a new cluster.
494 // The scheme must be "https"; the URL must begin with "https://".
496 // A path is optional, and if present may be any string permissible in
497 // a URL. You may use the path to pass an arbitrary string to the
498 // webhook, for example, a cluster identifier.
500 // Attempting to use a user or basic auth e.g. "user:password@" is not
501 // allowed. Fragments ("#...") and query parameters ("?...") are not
505 optional string url = 3;
507 // `service` is a reference to the service for this webhook. Either
508 // `service` or `url` must be specified.
510 // If the webhook is running within the cluster, then you should use `service`.
512 // Port 443 will be used if it is open, otherwise it is an error.
515 optional ServiceReference service = 1;
517 // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
518 // If unspecified, system trust roots on the apiserver are used.
520 optional bytes caBundle = 2;