v1beta2

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package v1beta2 contains the v1beta2 implementation of ExtensionConfig.

Index

Constants

View Source
const (
	// ExtensionConfigDiscoveredCondition is true if the runtime extension has been successfully discovered.
	ExtensionConfigDiscoveredCondition = "Discovered"

	// ExtensionConfigDiscoveredReason surfaces that the runtime extension has been successfully discovered.
	ExtensionConfigDiscoveredReason = "Discovered"

	// ExtensionConfigNotDiscoveredReason surfaces that the runtime extension has not been successfully discovered.
	ExtensionConfigNotDiscoveredReason = "NotDiscovered"
)

ExtensionConfig's Discovered conditions and corresponding reasons that will be used in v1Beta2 API version.

View Source
const (
	// RuntimeExtensionDiscoveredV1Beta1Condition is a condition set on an ExtensionConfig object once it has been discovered by the Runtime SDK client.
	RuntimeExtensionDiscoveredV1Beta1Condition clusterv1.ConditionType = "Discovered"

	// DiscoveryFailedV1Beta1Reason documents failure of a Discovery call.
	DiscoveryFailedV1Beta1Reason string = "DiscoveryFailed"

	// InjectCAFromSecretAnnotation is the annotation that specifies that an ExtensionConfig
	// object wants injection of CAs. The value is a reference to a Secret
	// as <namespace>/<name>.
	InjectCAFromSecretAnnotation string = "runtime.cluster.x-k8s.io/inject-ca-from-secret"

	// PendingHooksAnnotation is the annotation used to keep track of pending runtime hooks.
	// The annotation will be used to track the intent to call a hook as soon as an operation completes;
	// the intent will be removed as soon as the hook call completes successfully.
	PendingHooksAnnotation string = "runtime.cluster.x-k8s.io/pending-hooks"

	// OkToDeleteAnnotation is the annotation used to indicate if a cluster is ready to be fully deleted.
	// This annotation is added to the cluster after the BeforeClusterDelete hook has passed.
	OkToDeleteAnnotation string = "runtime.cluster.x-k8s.io/ok-to-delete"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "runtime.cluster.x-k8s.io", Version: "v1beta2"}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	// url gives the location of the Extension server, in standard URL form
	// (`scheme://host:port/path`).
	// Note: Exactly one of `url` or `service` must be specified.
	//
	// The scheme must be "https".
	//
	// The `host` should not refer to a service running in the cluster; use
	// the `service` field instead.
	//
	// A path is optional, and if present may be any string permissible in
	// a URL. If a path is set it will be used as prefix to the hook-specific path.
	//
	// Attempting to use a user or basic auth e.g. "user:password@" is not
	// allowed. Fragments ("#...") and query parameters ("?...") are not
	// allowed either.
	//
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	URL string `json:"url,omitempty"`

	// service is a reference to the Kubernetes service for the Extension server.
	// Note: Exactly one of `url` or `service` must be specified.
	//
	// If the Extension server is running within a cluster, then you should use `service`.
	//
	// +optional
	Service ServiceReference `json:"service,omitempty,omitzero"`

	// caBundle is a PEM encoded CA bundle which will be used to validate the Extension server's server certificate.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=51200
	CABundle []byte `json:"caBundle,omitempty"`
}

ClientConfig contains the information to make a client connection with an Extension server. +kubebuilder:validation:MinProperties=1

func (*ClientConfig) DeepCopy

func (in *ClientConfig) DeepCopy() *ClientConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConfig.

func (*ClientConfig) DeepCopyInto

func (in *ClientConfig) DeepCopyInto(out *ClientConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionConfig

type ExtensionConfig struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is the standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec is the desired state of the ExtensionConfig.
	// +required
	Spec ExtensionConfigSpec `json:"spec,omitempty,omitzero"`

	// status is the current state of the ExtensionConfig
	// +optional
	Status ExtensionConfigStatus `json:"status,omitempty,omitzero"`
}

ExtensionConfig is the Schema for the ExtensionConfig API. NOTE: This CRD can only be used if the RuntimeSDK feature gate is enabled.

func (*ExtensionConfig) DeepCopy

func (in *ExtensionConfig) DeepCopy() *ExtensionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfig.

func (*ExtensionConfig) DeepCopyInto

func (in *ExtensionConfig) DeepCopyInto(out *ExtensionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExtensionConfig) DeepCopyObject

func (in *ExtensionConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ExtensionConfig) GetConditions

func (m *ExtensionConfig) GetConditions() []metav1.Condition

GetConditions returns the set of conditions for this object.

func (*ExtensionConfig) GetV1Beta1Conditions

func (m *ExtensionConfig) GetV1Beta1Conditions() clusterv1.Conditions

GetV1Beta1Conditions returns the set of conditions for this object.

func (*ExtensionConfig) Hub

func (*ExtensionConfig) Hub()

func (*ExtensionConfig) SetConditions

func (m *ExtensionConfig) SetConditions(conditions []metav1.Condition)

SetConditions sets conditions for an API object.

func (*ExtensionConfig) SetV1Beta1Conditions

func (m *ExtensionConfig) SetV1Beta1Conditions(conditions clusterv1.Conditions)

SetV1Beta1Conditions sets the conditions on this object.

type ExtensionConfigDeprecatedStatus

type ExtensionConfigDeprecatedStatus struct {
	// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
	//
	// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
	//
	// +optional
	V1Beta1 *ExtensionConfigV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"`
}

ExtensionConfigDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version.

func (*ExtensionConfigDeprecatedStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigDeprecatedStatus.

func (*ExtensionConfigDeprecatedStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionConfigList

type ExtensionConfigList struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is the standard list's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	// items is the list of ExtensionConfigs.
	Items []ExtensionConfig `json:"items"`
}

ExtensionConfigList contains a list of ExtensionConfig.

func (*ExtensionConfigList) DeepCopy

func (in *ExtensionConfigList) DeepCopy() *ExtensionConfigList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigList.

func (*ExtensionConfigList) DeepCopyInto

func (in *ExtensionConfigList) DeepCopyInto(out *ExtensionConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExtensionConfigList) DeepCopyObject

func (in *ExtensionConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ExtensionConfigSpec

type ExtensionConfigSpec struct {
	// clientConfig defines how to communicate with the Extension server.
	// +required
	ClientConfig ClientConfig `json:"clientConfig,omitempty,omitzero"`

	// namespaceSelector decides whether to call the hook for an object based
	// on whether the namespace for that object matches the selector.
	// Defaults to the empty LabelSelector, which matches all objects.
	// +optional
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

	// settings defines key value pairs to be passed to all calls
	// to all supported RuntimeExtensions.
	// Note: Settings can be overridden on the ClusterClass.
	// +optional
	Settings map[string]string `json:"settings,omitempty"`
}

ExtensionConfigSpec defines the desired state of ExtensionConfig.

func (*ExtensionConfigSpec) DeepCopy

func (in *ExtensionConfigSpec) DeepCopy() *ExtensionConfigSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigSpec.

func (*ExtensionConfigSpec) DeepCopyInto

func (in *ExtensionConfigSpec) DeepCopyInto(out *ExtensionConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionConfigStatus

type ExtensionConfigStatus struct {
	// conditions represents the observations of a ExtensionConfig's current state.
	// Known condition types are Discovered, Paused.
	// +optional
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MaxItems=32
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// handlers defines the current ExtensionHandlers supported by an Extension.
	// +optional
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=512
	Handlers []ExtensionHandler `json:"handlers,omitempty"`

	// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
	// +optional
	Deprecated *ExtensionConfigDeprecatedStatus `json:"deprecated,omitempty"`
}

ExtensionConfigStatus defines the observed state of ExtensionConfig. +kubebuilder:validation:MinProperties=1

func (*ExtensionConfigStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigStatus.

func (*ExtensionConfigStatus) DeepCopyInto

func (in *ExtensionConfigStatus) DeepCopyInto(out *ExtensionConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionConfigV1Beta1DeprecatedStatus

type ExtensionConfigV1Beta1DeprecatedStatus struct {
	// conditions defines current service state of the ExtensionConfig.
	//
	// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
	//
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

ExtensionConfigV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.

func (*ExtensionConfigV1Beta1DeprecatedStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionConfigV1Beta1DeprecatedStatus.

func (*ExtensionConfigV1Beta1DeprecatedStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtensionHandler

type ExtensionHandler struct {
	// name is the unique name of the ExtensionHandler.
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	Name string `json:"name,omitempty"`

	// requestHook defines the versioned runtime hook which this ExtensionHandler serves.
	// +required
	RequestHook GroupVersionHook `json:"requestHook,omitempty,omitzero"`

	// timeoutSeconds defines the timeout duration for client calls to the ExtensionHandler.
	// Defaults to 10 if not set.
	// +optional
	// +kubebuilder:validation:Minimum=1
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`

	// failurePolicy defines how failures in calls to the ExtensionHandler should be handled by a client.
	// Defaults to Fail if not set.
	// +optional
	FailurePolicy FailurePolicy `json:"failurePolicy,omitempty"`
}

ExtensionHandler specifies the details of a handler for a particular runtime hook registered by an Extension server.

func (*ExtensionHandler) DeepCopy

func (in *ExtensionHandler) DeepCopy() *ExtensionHandler

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionHandler.

func (*ExtensionHandler) DeepCopyInto

func (in *ExtensionHandler) DeepCopyInto(out *ExtensionHandler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FailurePolicy

type FailurePolicy string

FailurePolicy specifies how unrecognized errors when calling the ExtensionHandler are handled. FailurePolicy helps with extensions not working consistently, e.g. due to an intermittent network issue. The following type of errors are never ignored by FailurePolicy Ignore: - Misconfigurations (e.g. incompatible types) - Extension explicitly returns a Status Failure. +kubebuilder:validation:Enum=Ignore;Fail

const (
	// FailurePolicyIgnore means that an error when calling the extension is ignored.
	FailurePolicyIgnore FailurePolicy = "Ignore"

	// FailurePolicyFail means that an error when calling the extension is propagated as an error.
	FailurePolicyFail FailurePolicy = "Fail"
)

type GroupVersionHook

type GroupVersionHook struct {
	// apiVersion is the group and version of the Hook.
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	APIVersion string `json:"apiVersion,omitempty"`

	// hook is the name of the hook.
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=256
	Hook string `json:"hook,omitempty"`
}

GroupVersionHook defines the runtime hook when the ExtensionHandler is called.

func (*GroupVersionHook) DeepCopy

func (in *GroupVersionHook) DeepCopy() *GroupVersionHook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupVersionHook.

func (*GroupVersionHook) DeepCopyInto

func (in *GroupVersionHook) DeepCopyInto(out *GroupVersionHook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceReference

type ServiceReference struct {
	// namespace is the namespace of the service.
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Namespace string `json:"namespace,omitempty"`

	// name is the name of the service.
	// +required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Name string `json:"name,omitempty"`

	// path is an optional URL path and if present may be any string permissible in
	// a URL. If a path is set it will be used as prefix to the hook-specific path.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	Path string `json:"path,omitempty"`

	// port is the port on the service that's hosting the Extension server.
	// Defaults to 443.
	// Port should be a valid port number (1-65535, inclusive).
	// +optional
	Port *int32 `json:"port,omitempty"`
}

ServiceReference holds a reference to a Kubernetes Service of an Extension server.

func (*ServiceReference) DeepCopy

func (in *ServiceReference) DeepCopy() *ServiceReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference.

func (*ServiceReference) DeepCopyInto

func (in *ServiceReference) DeepCopyInto(out *ServiceReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceReference) IsDefined

func (r *ServiceReference) IsDefined() bool

IsDefined returns true if the ServiceReference is set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL