v1beta2

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 11 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 KThreesConfig 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 KThreesConfig 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 KThreesConfig 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 KThreesConfig 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 KThreesConfig 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 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 KThreesAgentConfig

type KThreesAgentConfig struct {
	// NodeLabels  Registering and starting kubelet with set of labels
	// +optional
	NodeLabels []string `json:"nodeLabels,omitempty"`

	// NodeTaints Registering kubelet with set of taints
	// +optional
	NodeTaints []string `json:"nodeTaints,omitempty"`

	// TODO: take in a object or secret and write to file. this is not useful
	// PrivateRegistry  registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
	// +optional
	PrivateRegistry string `json:"privateRegistry,omitempty"`

	// KubeletArgs Customized flag for kubelet process
	// +optional
	KubeletArgs []string `json:"kubeletArgs,omitempty"`

	// KubeProxyArgs Customized flag for kube-proxy process
	// +optional
	KubeProxyArgs []string `json:"kubeProxyArgs,omitempty"`

	// NodeName Name of the Node
	// +optional
	NodeName string `json:"nodeName,omitempty"`

	// AirGapped is a boolean value to define if the bootstrapping should be air-gapped,
	// basically supposing that online container registries and k3s install scripts are not reachable.
	// User should prepare docker image, k3s binary, and put the install script in AirGappedInstallScriptPath (default path: "/opt/install.sh")
	// on all nodes in the air-gap environment.
	// +optional
	AirGapped bool `json:"airGapped,omitempty"`

	// AirGappedInstallScriptPath is the path to the install script in the air-gapped environment.
	// The install script should be prepared by the user. The value is only
	// used when AirGapped is set to true (default: "/opt/install.sh").
	// +optional
	AirGappedInstallScriptPath string `json:"airGappedInstallScriptPath,omitempty"`
}

func (*KThreesAgentConfig) DeepCopy

func (in *KThreesAgentConfig) DeepCopy() *KThreesAgentConfig

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

func (*KThreesAgentConfig) DeepCopyInto

func (in *KThreesAgentConfig) DeepCopyInto(out *KThreesAgentConfig)

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

type KThreesConfig

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

	Spec   KThreesConfigSpec   `json:"spec,omitempty"`
	Status KThreesConfigStatus `json:"status,omitempty"`
}

KThreesConfig is the Schema for the kthreesconfigs API.

func (*KThreesConfig) DeepCopy

func (in *KThreesConfig) DeepCopy() *KThreesConfig

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

func (*KThreesConfig) DeepCopyInto

func (in *KThreesConfig) DeepCopyInto(out *KThreesConfig)

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

func (*KThreesConfig) DeepCopyObject

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

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

func (*KThreesConfig) Default

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

Default will set default values for the KThreesConfig.

func (*KThreesConfig) GetConditions

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

func (*KThreesConfig) Hub

func (*KThreesConfig) Hub()

Hub marks KThreesConfig as a conversion hub.

func (*KThreesConfig) SetConditions

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

func (*KThreesConfig) SetupWebhookWithManager

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

SetupWebhookWithManager will setup the webhooks for the KThreesConfig.

func (*KThreesConfig) ValidateCreate

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

ValidateCreate will do any extra validation when creating a KThreesConfig.

func (*KThreesConfig) ValidateDelete

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

ValidateDelete allows you to add any extra validation when deleting.

func (*KThreesConfig) ValidateUpdate

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

ValidateUpdate will do any extra validation when updating a KThreesConfig.

type KThreesConfigList

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

KThreesConfigList contains a list of KThreesConfig.

func (*KThreesConfigList) DeepCopy

func (in *KThreesConfigList) DeepCopy() *KThreesConfigList

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

func (*KThreesConfigList) DeepCopyInto

func (in *KThreesConfigList) DeepCopyInto(out *KThreesConfigList)

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

func (*KThreesConfigList) DeepCopyObject

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

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

func (*KThreesConfigList) Hub

func (*KThreesConfigList) Hub()

Hub marks KThreesConfigList as a conversion hub.

type KThreesConfigSpec

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

	// PreK3sCommands specifies extra commands to run before k3s setup runs
	// +optional
	PreK3sCommands []string `json:"preK3sCommands,omitempty"`

	// PostK3sCommands specifies extra commands to run after k3s setup runs
	// +optional
	PostK3sCommands []string `json:"postK3sCommands,omitempty"`

	// AgentConfig specifies configuration for the agent nodes
	// +optional
	AgentConfig KThreesAgentConfig `json:"agentConfig,omitempty"`

	// ServerConfig specifies configuration for the agent nodes
	// +optional
	ServerConfig KThreesServerConfig `json:"serverConfig,omitempty"`

	// Version specifies the k3s version
	// +optional
	Version string `json:"version,omitempty"`
}

KThreesConfigSpec defines the desired state of KThreesConfig.

func (*KThreesConfigSpec) DeepCopy

func (in *KThreesConfigSpec) DeepCopy() *KThreesConfigSpec

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

func (*KThreesConfigSpec) DeepCopyInto

func (in *KThreesConfigSpec) DeepCopyInto(out *KThreesConfigSpec)

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

func (*KThreesConfigSpec) IsEtcdEmbedded

func (c *KThreesConfigSpec) IsEtcdEmbedded() bool

TODO Will need extend this func when implementing other k3s database options.

type KThreesConfigStatus

type KThreesConfigStatus 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 KThreesConfig.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

KThreesConfigStatus defines the observed state of KThreesConfig.

func (*KThreesConfigStatus) DeepCopy

func (in *KThreesConfigStatus) DeepCopy() *KThreesConfigStatus

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

func (*KThreesConfigStatus) DeepCopyInto

func (in *KThreesConfigStatus) DeepCopyInto(out *KThreesConfigStatus)

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

type KThreesConfigTemplate

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

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

KThreesConfigTemplate is the Schema for the kthreesconfigtemplates API.

func (*KThreesConfigTemplate) DeepCopy

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

func (*KThreesConfigTemplate) DeepCopyInto

func (in *KThreesConfigTemplate) DeepCopyInto(out *KThreesConfigTemplate)

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

func (*KThreesConfigTemplate) DeepCopyObject

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

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

func (*KThreesConfigTemplate) Default

Default will set default values for the KThreesConfigTemplate.

func (*KThreesConfigTemplate) Hub

func (*KThreesConfigTemplate) Hub()

Hub marks KThreesConfigTemplate as a conversion hub.

func (*KThreesConfigTemplate) SetupWebhookWithManager

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

SetupWebhookWithManager will setup the webhooks for the KThreesConfigTemplate.

func (*KThreesConfigTemplate) ValidateCreate

ValidateCreate will do any extra validation when creating a KThreesConfigTemplate.

func (*KThreesConfigTemplate) ValidateDelete

ValidateDelete allows you to add any extra validation when deleting.

func (*KThreesConfigTemplate) ValidateUpdate

ValidateUpdate will do any extra validation when updating a KThreesConfigTemplate.

type KThreesConfigTemplateList

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

KThreesConfigTemplateList contains a list of KThreesConfigTemplate.

func (*KThreesConfigTemplateList) DeepCopy

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

func (*KThreesConfigTemplateList) DeepCopyInto

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

func (*KThreesConfigTemplateList) DeepCopyObject

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

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

func (*KThreesConfigTemplateList) Hub

Hub marks KThreesConfigTemplateList as a conversion hub.

type KThreesConfigTemplateResource

type KThreesConfigTemplateResource struct {
	Spec KThreesConfigSpec `json:"spec,omitempty"`
}

KThreesConfigTemplateResource defines the Template structure.

func (*KThreesConfigTemplateResource) DeepCopy

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

func (*KThreesConfigTemplateResource) DeepCopyInto

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

type KThreesConfigTemplateSpec

type KThreesConfigTemplateSpec struct {
	Template KThreesConfigTemplateResource `json:"template"`
}

KThreesConfigTemplateSpec defines the desired state of KThreesConfigTemplate.

func (*KThreesConfigTemplateSpec) DeepCopy

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

func (*KThreesConfigTemplateSpec) DeepCopyInto

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

type KThreesServerConfig

type KThreesServerConfig struct {
	// KubeAPIServerArgs is a customized flag for kube-apiserver process
	// +optional
	KubeAPIServerArgs []string `json:"kubeAPIServerArg,omitempty"`

	// KubeControllerManagerArgs is a customized flag for kube-controller-manager process
	// +optional
	KubeControllerManagerArgs []string `json:"kubeControllerManagerArgs,omitempty"`

	// KubeSchedulerArgs is a customized flag for kube-scheduler process
	// +optional
	KubeSchedulerArgs []string `json:"kubeSchedulerArgs,omitempty"`

	// TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert
	// +optional
	TLSSan []string `json:"tlsSan,omitempty"`

	// BindAddress k3s bind address (default: 0.0.0.0)
	// +optional
	BindAddress string `json:"bindAddress,omitempty"`

	// HTTPSListenPort HTTPS listen port (default: 6443)
	// +optional
	HTTPSListenPort string `json:"httpsListenPort,omitempty"`

	// AdvertiseAddress IP address that apiserver uses to advertise to members of the cluster (default: node-external-ip/node-ip)
	// +optional
	AdvertiseAddress string `json:"advertiseAddress,omitempty"`

	// AdvertisePort Port that apiserver uses to advertise to members of the cluster (default: listen-port) (default: 0)
	// +optional
	AdvertisePort string `json:"advertisePort,omitempty"`

	// ClusterCidr  Network CIDR to use for pod IPs (default: "10.42.0.0/16")
	// +optional
	ClusterCidr string `json:"clusterCidr,omitempty"`

	// ServiceCidr Network CIDR to use for services IPs (default: "10.43.0.0/16")
	// +optional
	ServiceCidr string `json:"serviceCidr,omitempty"`

	// ClusterDNS  Cluster IP for coredns service. Should be in your service-cidr range (default: 10.43.0.10)
	// +optional
	ClusterDNS string `json:"clusterDNS,omitempty"`

	// ClusterDomain Cluster Domain (default: "cluster.local")
	// +optional
	ClusterDomain string `json:"clusterDomain,omitempty"`

	// DisableComponents  specifies extra commands to run before k3s setup runs
	// +optional
	DisableComponents []string `json:"disableComponents,omitempty"`

	// DeprecatedDisableExternalCloudProvider suppresses the 'cloud-provider=external' kubelet argument. (default: false)
	// +optional
	DeprecatedDisableExternalCloudProvider bool `json:"disableExternalCloudProvider,omitempty"`

	// DisableCloudController disables k3s default cloud controller manager. (default: true)
	// +optional
	DisableCloudController *bool `json:"disableCloudController,omitempty"`

	// CloudProviderName defines the --cloud-provider= kubelet extra arg. (default: "external")
	// +optional
	CloudProviderName *string `json:"cloudProviderName,omitempty"`

	// SystemDefaultRegistry defines private registry to be used for all system images
	// +optional
	SystemDefaultRegistry string `json:"systemDefaultRegistry,omitempty"`

	// Customized etcd proxy image for management cluster to communicate with workload cluster etcd (default: "alpine/socat")
	// +optional
	EtcdProxyImage string `json:"etcdProxyImage,omitempty"`
}

func (*KThreesServerConfig) DeepCopy

func (in *KThreesServerConfig) DeepCopy() *KThreesServerConfig

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

func (*KThreesServerConfig) DeepCopyInto

func (in *KThreesServerConfig) DeepCopyInto(out *KThreesServerConfig)

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 KThreesBootstrapConfig'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.

Jump to

Keyboard shortcuts

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