Skip to content

apiextensions.v1alpha1.managedResourceDefinition

"A ManagedResourceDefinition defines the schema for a new custom Kubernetes API."

Index

Fields

fn new

new(name)

new returns an instance of ManagedResourceDefinition

obj metadata

"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create."

fn metadata.withAnnotations

withAnnotations(annotations)

"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations"

fn metadata.withAnnotationsMixin

withAnnotationsMixin(annotations)

"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations"

Note: This function appends passed data to existing values

fn metadata.withClusterName

withClusterName(clusterName)

"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request."

fn metadata.withCreationTimestamp

withCreationTimestamp(creationTimestamp)

"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers."

fn metadata.withDeletionGracePeriodSeconds

withDeletionGracePeriodSeconds(deletionGracePeriodSeconds)

"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only."

fn metadata.withDeletionTimestamp

withDeletionTimestamp(deletionTimestamp)

"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers."

fn metadata.withFinalizers

withFinalizers(finalizers)

"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list."

fn metadata.withFinalizersMixin

withFinalizersMixin(finalizers)

"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list."

Note: This function appends passed data to existing values

fn metadata.withGenerateName

withGenerateName(generateName)

"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency"

fn metadata.withGeneration

withGeneration(generation)

"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only."

fn metadata.withLabels

withLabels(labels)

"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels"

fn metadata.withLabelsMixin

withLabelsMixin(labels)

"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels"

Note: This function appends passed data to existing values

fn metadata.withName

withName(name)

"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names"

fn metadata.withNamespace

withNamespace(namespace)

"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"

fn metadata.withOwnerReferences

withOwnerReferences(ownerReferences)

"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller."

fn metadata.withOwnerReferencesMixin

withOwnerReferencesMixin(ownerReferences)

"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller."

Note: This function appends passed data to existing values

fn metadata.withResourceVersion

withResourceVersion(resourceVersion)

"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency"

withSelfLink(selfLink)

"SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release."

fn metadata.withUid

withUid(uid)

"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"

obj spec

"ManagedResourceDefinitionSpec specifies the desired state of the resource definition."

fn spec.withConnectionDetails

withConnectionDetails(connectionDetails)

"ConnectionDetails is an array of connection detail keys and descriptions."

fn spec.withConnectionDetailsMixin

withConnectionDetailsMixin(connectionDetails)

"ConnectionDetails is an array of connection detail keys and descriptions."

Note: This function appends passed data to existing values

fn spec.withGroup

withGroup(group)

"Group is the API group of the defined custom resource.\nThe custom resources are served under /apis/<group>/....\nMust match the name of the CustomResourceDefinition (in the form <names.plural>.<group>)."

fn spec.withPreserveUnknownFields

withPreserveUnknownFields(preserveUnknownFields)

"PreserveUnknownFields indicates that object fields which are not specified\nin the OpenAPI schema should be preserved when persisting to storage.\napiVersion, kind, metadata and known fields inside metadata are always preserved.\nThis field is deprecated in favor of setting x-preserve-unknown-fields to true in spec.versions[*].schema.openAPIV3Schema.\nSee https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details."

fn spec.withScope

withScope(scope)

"Scope indicates whether the defined custom resource is cluster- or namespace-scoped.\nAllowed values are Cluster and Namespaced."

fn spec.withState

withState(state)

"State toggles whether the underlying CRD is created or not."

fn spec.withVersions

withVersions(versions)

"Versions is the list of all API versions of the defined custom resource.\nVersion names are used to compute the order in which served versions are listed in API discovery.\nIf the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered\nlexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version),\nthen optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first\nby GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing\nmajor version, then minor version. An example sorted list of versions:\nv10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10."

fn spec.withVersionsMixin

withVersionsMixin(versions)

"Versions is the list of all API versions of the defined custom resource.\nVersion names are used to compute the order in which served versions are listed in API discovery.\nIf the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered\nlexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version),\nthen optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first\nby GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing\nmajor version, then minor version. An example sorted list of versions:\nv10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10."

Note: This function appends passed data to existing values

obj spec.connectionDetails

"ConnectionDetails is an array of connection detail keys and descriptions."

fn spec.connectionDetails.withDescription

withDescription(description)

"Description of how the key is used."

fn spec.connectionDetails.withName

withName(name)

"Name of the key."

obj spec.conversion

"Conversion defines conversion settings for the CRD."

fn spec.conversion.withStrategy

withStrategy(strategy)

"strategy specifies how custom resources are converted between versions. Allowed values are:\n- \"None\": The converter only change the apiVersion and would not touch any other field in the custom resource.\n- \"Webhook\": API Server will call to an external webhook to do the conversion. Additional information\n is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set."

obj spec.conversion.webhook

"webhook describes how to call the conversion webhook. Required when strategy is set to \"Webhook\"."

fn spec.conversion.webhook.withConversionReviewVersions

withConversionReviewVersions(conversionReviewVersions)

"conversionReviewVersions is an ordered list of preferred ConversionReview\nversions the Webhook expects. The API server will use the first version in\nthe list which it supports. If none of the versions specified in this list\nare supported by API server, conversion will fail for the custom resource.\nIf a persisted Webhook configuration specifies allowed versions and does not\ninclude any versions known to the API Server, calls to the webhook will fail."

fn spec.conversion.webhook.withConversionReviewVersionsMixin

withConversionReviewVersionsMixin(conversionReviewVersions)

"conversionReviewVersions is an ordered list of preferred ConversionReview\nversions the Webhook expects. The API server will use the first version in\nthe list which it supports. If none of the versions specified in this list\nare supported by API server, conversion will fail for the custom resource.\nIf a persisted Webhook configuration specifies allowed versions and does not\ninclude any versions known to the API Server, calls to the webhook will fail."

Note: This function appends passed data to existing values

obj spec.conversion.webhook.clientConfig

"clientConfig is the instructions for how to call the webhook if strategy is Webhook."

fn spec.conversion.webhook.clientConfig.withCaBundle

withCaBundle(caBundle)

"caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.\nIf unspecified, system trust roots on the apiserver are used."

fn spec.conversion.webhook.clientConfig.withUrl

withUrl(url)

"url gives the location of the webhook, in standard URL form\n(scheme://host:port/path). Exactly one of url or service\nmust be specified.\n\nThe host should not refer to a service running in the cluster; use\nthe service field instead. The host might be resolved via external\nDNS in some apiservers (e.g., kube-apiserver cannot resolve\nin-cluster DNS as that would be a layering violation). host may\nalso be an IP address.\n\nPlease note that using localhost or 127.0.0.1 as a host is\nrisky unless you take great care to run this webhook on all hosts\nwhich run an apiserver which might need to make calls to this\nwebhook. Such installs are likely to be non-portable, i.e., not easy\nto turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in\na URL. You may use the path to pass an arbitrary string to the\nwebhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not\nallowed. Fragments (\"#...\") and query parameters (\"?...\") are not\nallowed, either."

obj spec.conversion.webhook.clientConfig.service

"service is a reference to the service for this webhook. Either\nservice or url must be specified.\n\nIf the webhook is running within the cluster, then you should use service."

fn spec.conversion.webhook.clientConfig.service.withName

withName(name)

"name is the name of the service.\nRequired"

fn spec.conversion.webhook.clientConfig.service.withNamespace

withNamespace(namespace)

"namespace is the namespace of the service.\nRequired"

fn spec.conversion.webhook.clientConfig.service.withPath

withPath(path)

"path is an optional URL path at which the webhook will be contacted."

fn spec.conversion.webhook.clientConfig.service.withPort

withPort(port)

"port is an optional service port at which the webhook will be contacted.\nport should be a valid port number (1-65535, inclusive).\nDefaults to 443 for backward compatibility."

obj spec.names

"Names specify the resource and kind names for the custom resource."

fn spec.names.withCategories

withCategories(categories)

"categories is a list of grouped resources this custom resource belongs to (e.g. 'all').\nThis is published in API discovery documents, and used by clients to support invocations like\nkubectl get all."

fn spec.names.withCategoriesMixin

withCategoriesMixin(categories)

"categories is a list of grouped resources this custom resource belongs to (e.g. 'all').\nThis is published in API discovery documents, and used by clients to support invocations like\nkubectl get all."

Note: This function appends passed data to existing values

fn spec.names.withKind

withKind(kind)

"kind is the serialized kind of the resource. It is normally CamelCase and singular.\nCustom resource instances will use this value as the kind attribute in API calls."

fn spec.names.withListKind

withListKind(listKind)

"listKind is the serialized kind of the list for this resource. Defaults to \"kindList\"."

fn spec.names.withPlural

withPlural(plural)

"plural is the plural name of the resource to serve.\nThe custom resources are served under /apis/<group>/<version>/.../<plural>.\nMust match the name of the CustomResourceDefinition (in the form <names.plural>.<group>).\nMust be all lowercase."

fn spec.names.withShortNames

withShortNames(shortNames)

"shortNames are short names for the resource, exposed in API discovery documents,\nand used by clients to support invocations like kubectl get <shortname>.\nIt must be all lowercase."

fn spec.names.withShortNamesMixin

withShortNamesMixin(shortNames)

"shortNames are short names for the resource, exposed in API discovery documents,\nand used by clients to support invocations like kubectl get <shortname>.\nIt must be all lowercase."

Note: This function appends passed data to existing values

fn spec.names.withSingular

withSingular(singular)

"singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased kind."

obj spec.versions

"Versions is the list of all API versions of the defined custom resource.\nVersion names are used to compute the order in which served versions are listed in API discovery.\nIf the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered\nlexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version),\nthen optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first\nby GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing\nmajor version, then minor version. An example sorted list of versions:\nv10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10."

fn spec.versions.withAdditionalPrinterColumns

withAdditionalPrinterColumns(additionalPrinterColumns)

"AdditionalPrinterColumns specifies additional columns returned in Table output.\nSee https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.\nIf no columns are specified, a single column displaying the age of the custom resource is used."

fn spec.versions.withAdditionalPrinterColumnsMixin

withAdditionalPrinterColumnsMixin(additionalPrinterColumns)

"AdditionalPrinterColumns specifies additional columns returned in Table output.\nSee https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.\nIf no columns are specified, a single column displaying the age of the custom resource is used."

Note: This function appends passed data to existing values

fn spec.versions.withDeprecated

withDeprecated(deprecated)

"Deprecated indicates this version of the custom resource API is deprecated.\nWhen set to true, API requests to this version receive a warning header in the server response.\nDefaults to false."

fn spec.versions.withDeprecationWarning

withDeprecationWarning(deprecationWarning)

"DeprecationWarning overrides the default warning returned to API clients.\nMay only be set when deprecated is true.\nThe default warning indicates this version is deprecated and recommends use\nof the newest served version of equal or greater stability, if one exists."

fn spec.versions.withName

withName(name)

"Name is the version name, e.g. “v1”, “v2beta1”, etc.\nThe custom resources are served under this version at /apis/<group>/<version>/... if served is true."

fn spec.versions.withSelectableFields

withSelectableFields(selectableFields)

"SelectableFields specifies paths to fields that may be used as field selectors.\nA maximum of 8 selectable fields are allowed.\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors"

fn spec.versions.withSelectableFieldsMixin

withSelectableFieldsMixin(selectableFields)

"SelectableFields specifies paths to fields that may be used as field selectors.\nA maximum of 8 selectable fields are allowed.\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors"

Note: This function appends passed data to existing values

fn spec.versions.withServed

withServed(served)

"Served is a flag enabling/disabling this version from being served via REST APIs"

fn spec.versions.withStorage

withStorage(storage)

"Storage indicates this version should be used when persisting custom resources to storage.\nThere must be exactly one version with storage=true."

obj spec.versions.additionalPrinterColumns

"AdditionalPrinterColumns specifies additional columns returned in Table output.\nSee https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.\nIf no columns are specified, a single column displaying the age of the custom resource is used."

fn spec.versions.additionalPrinterColumns.withDescription

withDescription(description)

"description is a human readable description of this column."

fn spec.versions.additionalPrinterColumns.withFormat

withFormat(format)

"format is an optional OpenAPI type definition for this column. The 'name' format is applied\nto the primary identifier column to assist in clients identifying column is the resource name.\nSee https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details."

fn spec.versions.additionalPrinterColumns.withJsonPath

withJsonPath(jsonPath)

"jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against\neach custom resource to produce the value for this column."

fn spec.versions.additionalPrinterColumns.withName

withName(name)

"name is a human readable name for the column."

fn spec.versions.additionalPrinterColumns.withPriority

withPriority(priority)

"priority is an integer defining the relative importance of this column compared to others. Lower\nnumbers are considered higher priority. Columns that may be omitted in limited space scenarios\nshould be given a priority greater than 0."

fn spec.versions.additionalPrinterColumns.withType

withType(type)

"type is an OpenAPI type definition for this column.\nSee https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details."

obj spec.versions.schema

"Schema describes the schema used for validation, pruning, and defaulting of this version of the custom resource."

fn spec.versions.schema.withOpenAPIV3Schema

withOpenAPIV3Schema(openAPIV3Schema)

"OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and\npruning."

fn spec.versions.schema.withOpenAPIV3SchemaMixin

withOpenAPIV3SchemaMixin(openAPIV3Schema)

"OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and\npruning."

Note: This function appends passed data to existing values

obj spec.versions.selectableFields

"SelectableFields specifies paths to fields that may be used as field selectors.\nA maximum of 8 selectable fields are allowed.\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors"

fn spec.versions.selectableFields.withJsonPath

withJsonPath(jsonPath)

"jsonPath is a simple JSON path which is evaluated against each custom resource to produce a\nfield selector value.\nOnly JSON paths without the array notation are allowed.\nMust point to a field of type string, boolean or integer. Types with enum values\nand strings with formats are allowed.\nIf jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string.\nMust not point to metdata fields.\nRequired."

obj spec.versions.subresources

"Subresources specify what subresources this version of the defined custom resource have."

obj spec.versions.subresources.scale

"scale indicates the custom resource should serve a /scale subresource that returns an autoscaling/v1 Scale object."

fn spec.versions.subresources.scale.withLabelSelectorPath

withLabelSelectorPath(labelSelectorPath)

"labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale status.selector.\nOnly JSON paths without the array notation are allowed.\nMust be a JSON Path under .status or .spec.\nMust be set to work with HorizontalPodAutoscaler.\nThe field pointed by this JSON path must be a string field (not a complex selector struct)\nwhich contains a serialized label selector in string form.\nMore info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource\nIf there is no value under the given path in the custom resource, the status.selector value in the /scale\nsubresource will default to the empty string."

fn spec.versions.subresources.scale.withSpecReplicasPath

withSpecReplicasPath(specReplicasPath)

"specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale spec.replicas.\nOnly JSON paths without the array notation are allowed.\nMust be a JSON Path under .spec.\nIf there is no value under the given path in the custom resource, the /scale subresource will return an error on GET."

fn spec.versions.subresources.scale.withStatusReplicasPath

withStatusReplicasPath(statusReplicasPath)

"statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale status.replicas.\nOnly JSON paths without the array notation are allowed.\nMust be a JSON Path under .status.\nIf there is no value under the given path in the custom resource, the status.replicas value in the /scale subresource\nwill default to 0."