Skip to main content

Cluster Models

V1CustomResourceDefinition

  • CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ObjectMeta
specV1CustomResourceDefinitionSpec
statusV1CustomResourceDefinitionStatus

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.ApiextensionsV1Api);

const body: k8s.V1CustomResourceDefinition = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createCustomResourceDefinition({ body });
console.log(res.metadata?.name);

Used by: ApiextensionsV1Api.createCustomResourceDefinition · ApiextensionsV1Api.readCustomResourceDefinition · ApiextensionsV1Api.readCustomResourceDefinitionStatus

V1CustomResourceDefinitionCondition

  • CustomResourceDefinitionCondition contains details for the current condition of this pod.

Source

PropertyTypeDescription
lastTransitionTimeDatelastTransitionTime last time the condition transitioned from one status to another.
messagestringmessage is a human-readable message indicating details about last transition.
observedGenerationnumberobservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration...
reasonstringreason is a unique, one-word, CamelCase reason for the condition's last transition.
statusstringstatus is the status of the condition. Can be True, False, Unknown.
typestringtype is the type of the condition. Types include Established, NamesAccepted and Terminating.

V1CustomResourceDefinitionList

  • CustomResourceDefinitionList is a list of CustomResourceDefinition objects.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1CustomResourceDefinition[]items list individual CustomResourceDefinition objects
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.ApiextensionsV1Api);

const res: k8s.V1CustomResourceDefinitionList = await api.listCustomResourceDefinition({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: ApiextensionsV1Api.listCustomResourceDefinition

V1CustomResourceDefinitionNames

  • CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition

Source

PropertyTypeDescription
categoriesstring[]categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get...
kindstringkind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the kind attribute in API calls.
listKindstringlistKind is the serialized kind of the list for this resource. Defaults to "kindList".
pluralstringplural is the plural name of the resource to serve. The custom resources are served under /apis/<group>/<version>/.../<plural>. Must match the name of the CustomResourceDefinition (in the form...
shortNamesstring[]shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like kubectl get <shortname>. It must be all lowercase.
singularstringsingular is the singular name of the resource. It must be all lowercase. Defaults to lowercased kind.

V1CustomResourceDefinitionSpec

  • CustomResourceDefinitionSpec describes how a user wants their resource to appear

Source

PropertyTypeDescription
groupstringgroup is the API group of the defined custom resource. The custom resources are served under /apis/<group>/.... Must match the name of the CustomResourceDefinition (in the form...
preserveUnknownFieldsbooleanpreserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside...
scopestringscope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are Cluster and Namespaced.
versionsV1CustomResourceDefinitionVersion[]versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is...
conversionV1CustomResourceConversion
namesV1CustomResourceDefinitionNames

V1CustomResourceDefinitionStatus

  • CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition

Source

PropertyTypeDescription
conditionsV1CustomResourceDefinitionCondition[]conditions indicate state for particular aspects of a CustomResourceDefinition
observedGenerationnumberThe generation observed by the CRD controller.
storedVersionsstring[]storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration...
acceptedNamesV1CustomResourceDefinitionNames

V1CustomResourceDefinitionVersion

  • CustomResourceDefinitionVersion describes a version for CRD.

Source

PropertyTypeDescription
additionalPrinterColumnsV1CustomResourceColumnDefinition[]additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If no...
deprecatedbooleandeprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false.
deprecationWarningstringdeprecationWarning overrides the default warning returned to API clients. May only be set when deprecated is true. The default warning indicates this version is deprecated and recommends use of the...
namestringname is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at /apis/<group>/<version>/... if served is true.
selectableFieldsV1SelectableField[]selectableFields specifies paths to fields that may be used as field selectors. A maximum of 8 selectable fields are allowed. See...
servedbooleanserved is a flag enabling/disabling this version from being served via REST APIs
storagebooleanstorage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true.
schemaV1CustomResourceValidation
subresourcesV1CustomResourceSubresources

V1MutatingWebhookConfiguration

  • MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
webhooksV1MutatingWebhook[]Webhooks is a list of webhooks and the affected resources and operations.
metadataV1ObjectMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const body: k8s.V1MutatingWebhookConfiguration = {
metadata: { name: 'example' },
};
const res = await api.createMutatingWebhookConfiguration({ body });
console.log(res.metadata?.name);

Used by: AdmissionregistrationV1Api.createMutatingWebhookConfiguration · AdmissionregistrationV1Api.patchMutatingWebhookConfiguration · AdmissionregistrationV1Api.readMutatingWebhookConfiguration

V1MutatingWebhookConfigurationList

  • MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1MutatingWebhookConfiguration[]List of MutatingWebhookConfiguration.
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const res: k8s.V1MutatingWebhookConfigurationList = await api.listMutatingWebhookConfiguration({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: AdmissionregistrationV1Api.listMutatingWebhookConfiguration

V1PriorityClass

  • PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
descriptionstringdescription is an arbitrary string that usually provides guidelines on when this priority class should be used.
globalDefaultbooleanglobalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as globalDefault....
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
preemptionPolicystringpreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.
valuenumbervalue represents the integer value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.
metadataV1ObjectMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.SchedulingV1Api);

const body: k8s.V1PriorityClass = {
metadata: { name: 'example' },
};
const res = await api.createPriorityClass({ body });
console.log(res.metadata?.name);

Used by: SchedulingV1Api.createPriorityClass · SchedulingV1Api.patchPriorityClass · SchedulingV1Api.readPriorityClass

V1PriorityClassList

  • PriorityClassList is a collection of priority classes.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1PriorityClass[]items is the list of PriorityClasses
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.SchedulingV1Api);

const res: k8s.V1PriorityClassList = await api.listPriorityClass({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: SchedulingV1Api.listPriorityClass

V1Scheduling

  • Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.

Source

PropertyTypeDescription
nodeSelector{ [key: string]: stringnodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass...
tolerationsV1Toleration[]tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.

V1ValidatingAdmissionPolicy

  • ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ObjectMeta
specV1ValidatingAdmissionPolicySpec
statusV1ValidatingAdmissionPolicyStatus

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const body: k8s.V1ValidatingAdmissionPolicy = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createValidatingAdmissionPolicy({ body });
console.log(res.metadata?.name);

Used by: AdmissionregistrationV1Api.createValidatingAdmissionPolicy · AdmissionregistrationV1Api.readValidatingAdmissionPolicy · AdmissionregistrationV1Api.readValidatingAdmissionPolicyStatus

V1ValidatingAdmissionPolicyBinding

  • ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources. ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters. For a given admission request, each binding will cause its policy to be evaluated N times, where N is 1 for policies/bindings that don't use params, otherwise N is the number of parameters selected by the binding. The CEL expressions of a policy must have a computed CEL cost below the maximum CEL budget. Each evaluation of the policy is given an independent CEL cost budget. Adding/removing policies, bindings, or params can not affect whether a given (policy, binding, param) combination is within its own CEL budget.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ObjectMeta
specV1ValidatingAdmissionPolicyBindingSpec

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const body: k8s.V1ValidatingAdmissionPolicyBinding = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createValidatingAdmissionPolicyBinding({ body });
console.log(res.metadata?.name);

Used by: AdmissionregistrationV1Api.createValidatingAdmissionPolicyBinding · AdmissionregistrationV1Api.patchValidatingAdmissionPolicyBinding · AdmissionregistrationV1Api.readValidatingAdmissionPolicyBinding

V1ValidatingAdmissionPolicyBindingList

  • ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1ValidatingAdmissionPolicyBinding[]List of PolicyBinding.
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const res: k8s.V1ValidatingAdmissionPolicyBindingList = await api.listValidatingAdmissionPolicyBinding({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: AdmissionregistrationV1Api.listValidatingAdmissionPolicyBinding

V1ValidatingAdmissionPolicyBindingSpec

  • ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.

Source

PropertyTypeDescription
policyNamestringPolicyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to. If the referenced resource does not exist, this binding is considered invalid and will be...
validationActionsstring[]validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced. If a validation evaluates to false it is always enforced according to these actions. Failures...
matchResourcesV1MatchResources
paramRefV1ParamRef

V1ValidatingAdmissionPolicyList

  • ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1ValidatingAdmissionPolicy[]List of ValidatingAdmissionPolicy.
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const res: k8s.V1ValidatingAdmissionPolicyList = await api.listValidatingAdmissionPolicy({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: AdmissionregistrationV1Api.listValidatingAdmissionPolicy

V1ValidatingAdmissionPolicySpec

  • ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.

Source

PropertyTypeDescription
auditAnnotationsV1AuditAnnotation[]auditAnnotations contains CEL expressions which are used to produce audit annotations for the audit event of the API request. validations and auditAnnotations may not both be empty; a least one of...
failurePolicystringfailurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy...
matchConditionsV1MatchCondition[]MatchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and...
validationsV1Validation[]Validations contain CEL expressions which is used to apply the validation. Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is required.
variablesV1Variable[]Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under...
matchConstraintsV1MatchResources
paramKindV1ParamKind

V1ValidatingAdmissionPolicyStatus

  • ValidatingAdmissionPolicyStatus represents the status of an admission validation policy.

Source

PropertyTypeDescription
conditionsV1Condition[]The conditions represent the latest available observations of a policy's current state.
observedGenerationnumberThe generation observed by the controller.
typeCheckingV1TypeChecking

V1ValidatingWebhookConfiguration

  • ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
webhooksV1ValidatingWebhook[]Webhooks is a list of webhooks and the affected resources and operations.
metadataV1ObjectMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const body: k8s.V1ValidatingWebhookConfiguration = {
metadata: { name: 'example' },
};
const res = await api.createValidatingWebhookConfiguration({ body });
console.log(res.metadata?.name);

Used by: AdmissionregistrationV1Api.createValidatingWebhookConfiguration · AdmissionregistrationV1Api.patchValidatingWebhookConfiguration · AdmissionregistrationV1Api.readValidatingWebhookConfiguration

V1ValidatingWebhookConfigurationList

  • ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.

Source

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:...
itemsV1ValidatingWebhookConfiguration[]List of ValidatingWebhookConfiguration.
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:...
metadataV1ListMeta

Example

import * as k8s from '@kubernetes/client-node';

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.AdmissionregistrationV1Api);

const res: k8s.V1ValidatingWebhookConfigurationList = await api.listValidatingWebhookConfiguration({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}

Used by: AdmissionregistrationV1Api.listValidatingWebhookConfiguration