v1beta2

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1beta2 contains API Schema definitions for the bootstrap v1beta2 API group +kubebuilder:object:generate=true +groupName=bootstrap.cluster.x-k8s.io +k8s:defaulter-gen=TypeMeta

Index

Constants

View Source
const (
	// DataSecretAvailableCondition documents the status of the bootstrap secret generation process.
	//
	// NOTE: When the DataSecret generation starts the process completes immediately and within the
	// same reconciliation, so the user will always see a transition from Wait to Generated without having
	// evidence that BootstrapSecret generation is started/in progress.
	DataSecretAvailableCondition clusterv1.ConditionType = "DataSecretAvailable"

	// WaitingForClusterInfrastructureReason (Severity=Info) document a bootstrap secret generation process
	// waiting for the cluster infrastructure to be ready.
	//
	// NOTE: Having the cluster infrastructure ready is a pre-condition for starting to create machines;
	// the CK8sConfig controller ensure this pre-condition is satisfied.
	WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"

	// WaitingForControlPlaneAvailableReason (Severity=Info) document a bootstrap secret generation process
	// waiting for the control plane machine to be available.
	//
	// NOTE: Having the control plane machine available is a pre-condition for joining additional control planes
	// or workers nodes.
	// Deprecated: This has been deprecated in v1beta1 and will be removed in a future version.
	// Switch to WaitingForControlPlaneAvailableReason constant from the `sigs.k8s.io/cluster-api/api/v1beta1`
	// package.
	WaitingForControlPlaneAvailableReason = clusterv1.WaitingForControlPlaneAvailableReason

	// DataSecretGenerationFailedReason (Severity=Warning) documents a CK8sConfig controller detecting
	// an error while generating a data secret; those kind of errors are usually due to misconfigurations
	// and user intervention is required to get them fixed.
	DataSecretGenerationFailedReason = "DataSecretGenerationFailed"
)
View Source
const (
	// CertificatesAvailableCondition documents that cluster certificates are available.
	//
	// NOTE: Cluster certificates are generated only for the CK8sConfig object linked to the initial control plane
	// machine, if the cluster is not using a control plane ref object, if the certificates are not provided
	// by the users.
	// IMPORTANT: This condition won't be re-created after clusterctl move.
	CertificatesAvailableCondition clusterv1.ConditionType = "CertificatesAvailable"

	// CertificatesGenerationFailedReason (Severity=Warning) documents a CK8sConfig controller detecting
	// an error while generating certificates; those kind of errors are usually temporary and the controller
	// automatically recover from them.
	CertificatesGenerationFailedReason = "CertificatesGenerationFailed"

	// CertificatesCorruptedReason (Severity=Error) documents a CK8sConfig controller detecting
	// an error while retrieving certificates for a joining node.
	CertificatesCorruptedReason = "CertificatesCorrupted"
)

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

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

Functions

This section is empty.

Types

type CK8sConfig

type CK8sConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CK8sConfigSpec   `json:"spec,omitempty"`
	Status CK8sConfigStatus `json:"status,omitempty"`
}

CK8sConfig is the Schema for the ck8sconfigs API.

func (*CK8sConfig) DeepCopy

func (in *CK8sConfig) DeepCopy() *CK8sConfig

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

func (*CK8sConfig) DeepCopyInto

func (in *CK8sConfig) DeepCopyInto(out *CK8sConfig)

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

func (*CK8sConfig) DeepCopyObject

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

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

func (*CK8sConfig) Default

func (c *CK8sConfig) Default(_ context.Context, _ runtime.Object) error

Default will set default values for the CK8sControlPlane.

func (*CK8sConfig) GetConditions

func (c *CK8sConfig) GetConditions() clusterv1.Conditions

func (*CK8sConfig) Hub

func (*CK8sConfig) Hub()

Hub marks CK8sConfig as a conversion hub.

func (*CK8sConfig) SetConditions

func (c *CK8sConfig) SetConditions(conditions clusterv1.Conditions)

func (*CK8sConfig) SetupWebhookWithManager

func (c *CK8sConfig) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager will setup the webhooks for the CK8sControlPlane.

func (*CK8sConfig) ValidateCreate

func (c *CK8sConfig) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateCreate will do any extra validation when creating a CK8sControlPlane.

func (*CK8sConfig) ValidateDelete

func (c *CK8sConfig) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete allows you to add any extra validation when deleting.

func (*CK8sConfig) ValidateUpdate

func (c *CK8sConfig) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error)

ValidateUpdate will do any extra validation when updating a CK8sControlPlane.

type CK8sConfigList

type CK8sConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CK8sConfig `json:"items"`
}

CK8sConfigList contains a list of CK8sConfig.

func (*CK8sConfigList) DeepCopy

func (in *CK8sConfigList) DeepCopy() *CK8sConfigList

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

func (*CK8sConfigList) DeepCopyInto

func (in *CK8sConfigList) DeepCopyInto(out *CK8sConfigList)

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

func (*CK8sConfigList) DeepCopyObject

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

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

func (*CK8sConfigList) Hub

func (*CK8sConfigList) Hub()

Hub marks CK8sConfigList as a conversion hub.

type CK8sConfigSpec

type CK8sConfigSpec struct {
	// Version specifies the Kubernetes version.
	// +optional
	Version string `json:"version,omitempty"`

	// Files specifies extra files to be passed to user_data upon creation.
	// +optional
	Files []File `json:"files,omitempty"`

	// BootCommands specifies extra commands to run in cloud-init early in the boot process.
	// +optional
	BootCommands []string `json:"bootCommands,omitempty"`

	// PreRunCommands specifies extra commands to run in cloud-init before k8s-snap setup runs.
	// +optional
	PreRunCommands []string `json:"preRunCommands,omitempty"`

	// PostRunCommands specifies extra commands to run in cloud-init after k8s-snap setup runs.
	// +optional
	PostRunCommands []string `json:"postRunCommands,omitempty"`

	// AirGapped is used to signal that we are deploying to an airgap environment. In this case,
	// the provider will not attempt to install k8s-snap on the machine. The user is expected to
	// install k8s-snap manually with preRunCommands, or provide an image with k8s-snap pre-installed.
	// +optional
	AirGapped bool `json:"airGapped,omitempty"`

	// CK8sControlPlaneConfig is configuration for the control plane node.
	// +optional
	ControlPlaneConfig CK8sControlPlaneConfig `json:"controlPlane,omitempty"`

	// CK8sInitConfig is configuration for the initializing the cluster features.
	// +optional
	InitConfig CK8sInitConfiguration `json:"initConfig,omitempty"`

	// NodeName is the name to use for the kubelet of this node. It is needed for clouds
	// where the cloud-provider has specific pre-requisites about the node names. It is
	// typically set in Jinja template form, e.g."{{ ds.meta_data.local_hostname }}".
	// +optional
	NodeName string `json:"nodeName,omitempty"`
}

CK8sConfigSpec defines the desired state of CK8sConfig.

func (*CK8sConfigSpec) DeepCopy

func (in *CK8sConfigSpec) DeepCopy() *CK8sConfigSpec

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

func (*CK8sConfigSpec) DeepCopyInto

func (in *CK8sConfigSpec) DeepCopyInto(out *CK8sConfigSpec)

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

func (*CK8sConfigSpec) IsEtcdManaged

func (c *CK8sConfigSpec) IsEtcdManaged() bool

IsEtcdManaged returns true if the control plane is using k8s-dqlite.

type CK8sConfigStatus

type CK8sConfigStatus struct {
	// Ready indicates the BootstrapData field is ready to be consumed
	Ready bool `json:"ready,omitempty"`

	BootstrapData []byte `json:"bootstrapData,omitempty"`

	// DataSecretName is the name of the secret that stores the bootstrap data script.
	// +optional
	DataSecretName *string `json:"dataSecretName,omitempty"`

	// FailureReason will be set on non-retryable errors
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// FailureMessage will be set on non-retryable errors
	// +optional
	FailureMessage string `json:"failureMessage,omitempty"`

	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions defines current service state of the CK8sConfig.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

CK8sConfigStatus defines the observed state of CK8sConfig.

func (*CK8sConfigStatus) DeepCopy

func (in *CK8sConfigStatus) DeepCopy() *CK8sConfigStatus

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

func (*CK8sConfigStatus) DeepCopyInto

func (in *CK8sConfigStatus) DeepCopyInto(out *CK8sConfigStatus)

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

type CK8sConfigTemplate

type CK8sConfigTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec CK8sConfigTemplateSpec `json:"spec,omitempty"`
}

CK8sConfigTemplate is the Schema for the ck8sconfigtemplates API.

func (*CK8sConfigTemplate) DeepCopy

func (in *CK8sConfigTemplate) DeepCopy() *CK8sConfigTemplate

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

func (*CK8sConfigTemplate) DeepCopyInto

func (in *CK8sConfigTemplate) DeepCopyInto(out *CK8sConfigTemplate)

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

func (*CK8sConfigTemplate) DeepCopyObject

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

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

func (*CK8sConfigTemplate) Default

Default will set default values for the CK8sControlPlane.

func (*CK8sConfigTemplate) Hub

func (*CK8sConfigTemplate) Hub()

Hub marks CK8sConfigTemplate as a conversion hub.

func (*CK8sConfigTemplate) SetupWebhookWithManager

func (c *CK8sConfigTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager will setup the webhooks for the CK8sControlPlane.

func (*CK8sConfigTemplate) ValidateCreate

ValidateCreate will do any extra validation when creating a CK8sControlPlane.

func (*CK8sConfigTemplate) ValidateDelete

ValidateDelete allows you to add any extra validation when deleting.

func (*CK8sConfigTemplate) ValidateUpdate

func (c *CK8sConfigTemplate) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error)

ValidateUpdate will do any extra validation when updating a CK8sControlPlane.

type CK8sConfigTemplateList

type CK8sConfigTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CK8sConfigTemplate `json:"items"`
}

CK8sConfigTemplateList contains a list of CK8sConfigTemplate.

func (*CK8sConfigTemplateList) DeepCopy

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

func (*CK8sConfigTemplateList) DeepCopyInto

func (in *CK8sConfigTemplateList) DeepCopyInto(out *CK8sConfigTemplateList)

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

func (*CK8sConfigTemplateList) DeepCopyObject

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

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

func (*CK8sConfigTemplateList) Hub

func (*CK8sConfigTemplateList) Hub()

Hub marks CK8sConfigTemplateList as a conversion hub.

type CK8sConfigTemplateResource

type CK8sConfigTemplateResource struct {
	Spec CK8sConfigSpec `json:"spec,omitempty"`
}

CK8sConfigTemplateResource defines the Template structure.

func (*CK8sConfigTemplateResource) DeepCopy

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

func (*CK8sConfigTemplateResource) DeepCopyInto

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

type CK8sConfigTemplateSpec

type CK8sConfigTemplateSpec struct {
	Template CK8sConfigTemplateResource `json:"template"`
}

CK8sConfigTemplateSpec defines the desired state of CK8sConfigTemplate.

func (*CK8sConfigTemplateSpec) DeepCopy

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

func (*CK8sConfigTemplateSpec) DeepCopyInto

func (in *CK8sConfigTemplateSpec) DeepCopyInto(out *CK8sConfigTemplateSpec)

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

type CK8sControlPlaneConfig

type CK8sControlPlaneConfig struct {
	// ExtraSANs is a list of SANs to include in the server certificates.
	// +optional
	ExtraSANs []string `json:"extraSANs,omitempty"`

	// CloudProvider is the cloud-provider configuration option to set.
	// +optional
	CloudProvider string `json:"cloudProvider,omitempty"`

	// NodeTaints is taints to add to the control plane kubelet nodes.
	// +optional
	NodeTaints []string `json:"nodeTaints,omitempty"`

	// DatastoreType is the type of datastore to use for the control plane.
	// +optional
	DatastoreType string `json:"datastoreType,omitempty"`

	// DatastoreServersSecretRef is a reference to a secret containing the datastore servers.
	// +optional
	DatastoreServersSecretRef SecretRef `json:"datastoreServersSecretRef,omitempty"`

	// K8sDqlitePort is the port to use for k8s-dqlite. If unset, 2379 (etcd) will be used.
	// +optional
	K8sDqlitePort int `json:"k8sDqlitePort,omitempty"`

	// MicroclusterAddress is the address (or CIDR) to use for microcluster. If unset, the default node interface is chosen.
	MicroclusterAddress string `json:"microclusterAddress,omitempty"`

	// MicroclusterPort is the port to use for microcluster. If unset, ":2380" (etcd peer) will be used.
	// +optional
	MicroclusterPort *int `json:"microclusterPort,omitempty"`

	// ExtraKubeAPIServerArgs is extra arguments to add to kube-apiserver.
	// +optional
	ExtraKubeAPIServerArgs map[string]*string `json:"extraKubeAPIServerArgs,omitempty"`
}

CK8sControlPlaneConfig is configuration for control plane nodes.

func (*CK8sControlPlaneConfig) DeepCopy

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

func (*CK8sControlPlaneConfig) DeepCopyInto

func (in *CK8sControlPlaneConfig) DeepCopyInto(out *CK8sControlPlaneConfig)

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

func (*CK8sControlPlaneConfig) GetMicroclusterPort

func (c *CK8sControlPlaneConfig) GetMicroclusterPort() int

GetMicroclusterPort returns the port to use for microcluster. If unset, 2380 (etcd peer) will be used.

type CK8sInitConfiguration

type CK8sInitConfiguration struct {
	// Annotations are used to configure the behaviour of the built-in features.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// EnableDefaultDNS specifies whether to enable the default DNS configuration.
	// +optional
	EnableDefaultDNS *bool `json:"enableDefaultDNS,omitempty"`

	// EnableDefaultLocalStorage specifies whether to enable the default local storage.
	// +optional
	EnableDefaultLocalStorage *bool `json:"enableDefaultLocalStorage,omitempty"`

	// EnableDefaultMetricsServer specifies whether to enable the default metrics server.
	// +optional
	EnableDefaultMetricsServer *bool `json:"enableDefaultMetricsServer,omitempty"`

	// EnableDefaultNetwork specifies whether to enable the default CNI.
	// +optional
	EnableDefaultNetwork *bool `json:"enableDefaultNetwork,omitempty"`
}

CK8sInitConfiguration is configuration for the initializing the cluster features.

func (*CK8sInitConfiguration) DeepCopy

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

func (*CK8sInitConfiguration) DeepCopyInto

func (in *CK8sInitConfiguration) DeepCopyInto(out *CK8sInitConfiguration)

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

func (*CK8sInitConfiguration) GetEnableDefaultDNS

func (c *CK8sInitConfiguration) GetEnableDefaultDNS() bool

GetEnableDefaultNetwork returns the EnableDefaultNetwork field. If the field is not set, it returns true.

func (*CK8sInitConfiguration) GetEnableDefaultLocalStorage

func (c *CK8sInitConfiguration) GetEnableDefaultLocalStorage() bool

GetEnableDefaultLocalStorage returns the EnableDefaultLocalStorage field. If the field is not set, it returns true.

func (*CK8sInitConfiguration) GetEnableDefaultMetricsServer

func (c *CK8sInitConfiguration) GetEnableDefaultMetricsServer() bool

GetEnableDefaultMetricsServer returns the EnableDefaultMetricsServer field. If the field is not set, it returns true.

func (*CK8sInitConfiguration) GetEnableDefaultNetwork

func (c *CK8sInitConfiguration) GetEnableDefaultNetwork() bool

GetEnableDefaultNetwork returns the EnableDefaultNetwork field. If the field is not set, it returns true.

type Encoding

type Encoding string

Encoding specifies the cloud-init file encoding. +kubebuilder:validation:Enum=base64;gzip;gzip+base64

const (
	// Base64 implies the contents of the file are encoded as base64.
	Base64 Encoding = "base64"
	// Gzip implies the contents of the file are encoded with gzip.
	Gzip Encoding = "gzip"
	// GzipBase64 implies the contents of the file are first base64 encoded and then gzip encoded.
	GzipBase64 Encoding = "gzip+base64"
)

type File

type File struct {
	// Path specifies the full path on disk where to store the file.
	Path string `json:"path"`

	// Owner specifies the ownership of the file, e.g. "root:root".
	// +optional
	Owner string `json:"owner,omitempty"`

	// Permissions specifies the permissions to assign to the file, e.g. "0640".
	// +optional
	Permissions string `json:"permissions,omitempty"`

	// Encoding specifies the encoding of the file contents.
	// +optional
	Encoding Encoding `json:"encoding,omitempty"`

	// Content is the actual content of the file.
	// +optional
	Content string `json:"content,omitempty"`

	// ContentFrom is a referenced source of content to populate the file.
	// +optional
	ContentFrom *FileSource `json:"contentFrom,omitempty"`
}

File defines the input for generating write_files in cloud-init.

func (*File) DeepCopy

func (in *File) DeepCopy() *File

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

func (*File) DeepCopyInto

func (in *File) DeepCopyInto(out *File)

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

type FileSource

type FileSource struct {
	// Secret represents a secret that should populate this file.
	Secret SecretFileSource `json:"secret"`
}

FileSource is a union of all possible external source types for file data. Only one field may be populated in any given instance. Developers adding new sources of data for target systems should add them here.

func (*FileSource) DeepCopy

func (in *FileSource) DeepCopy() *FileSource

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

func (*FileSource) DeepCopyInto

func (in *FileSource) DeepCopyInto(out *FileSource)

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

type SecretFileSource

type SecretFileSource struct {
	// Name of the secret in the CK8sBootstrapConfig's namespace to use.
	Name string `json:"name"`

	// Key is the key in the secret's data map for this value.
	Key string `json:"key"`
}

Adapts a Secret into a FileSource.

The contents of the target Secret's Data field will be presented as files using the keys in the Data field as the file names.

func (*SecretFileSource) DeepCopy

func (in *SecretFileSource) DeepCopy() *SecretFileSource

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

func (*SecretFileSource) DeepCopyInto

func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource)

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

type SecretRef added in v0.1.2

type SecretRef struct {
	// Name of the secret in the CK8sBootstrapConfig's namespace to use.
	Name string `json:"name"`

	// Key is the key in the secret's data map for this value.
	// +optional
	Key string `json:"key,omitempty"`
}

SecretRef is a reference to a secret in the CK8sBootstrapConfig's namespace.

func (*SecretRef) DeepCopy added in v0.1.2

func (in *SecretRef) DeepCopy() *SecretRef

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

func (*SecretRef) DeepCopyInto added in v0.1.2

func (in *SecretRef) DeepCopyInto(out *SecretRef)

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

Jump to

Keyboard shortcuts

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