v1alpha1

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the turtles-capi.cattle.io v1alpha1 API group +kubebuilder:object:generate=true +groupName=turtles-capi.cattle.io

Index

Constants

View Source
const (
	// RancherCredentialsSecretCondition provides information on Rancher credentials secret mapping result.
	RancherCredentialsSecretCondition clusterv1.ConditionType = "RancherCredentialsSecretMapped"

	// RancherCredentialKeyMissing notifies about missing credential secret key required for provider during credentials mapping.
	RancherCredentialKeyMissing = "RancherCredentialKeyMissing"

	// RancherCredentialSourceMissing occures when a source credential secret is missing.
	RancherCredentialSourceMissing = "RancherCredentialSourceMissing"

	// LastAppliedConfigurationTime is set as a timestamp info of the last configuration update byt the CAPI Operator resource.
	LastAppliedConfigurationTime = "LastAppliedConfigurationTime"

	// CheckLatestVersionTime is set as a timestamp info of the last timestamp of the latest version being up-to-date for the CAPIProvider.
	CheckLatestVersionTime = "CheckLatestVersionTime"
)
View Source
const (
	// CheckLatestUpdateAvailableReason is a reason for a False condition, due to update being available.
	CheckLatestUpdateAvailableReason = "UpdateAvailable"

	// CheckLatestProviderUnknownReason is a reason for an Unknown condition, due to provider not being available.
	CheckLatestProviderUnknownReason = "ProviderUnknown"
)
View Source
const (
	ClusterctlConfigName string = "clusterctl-config"
)

ClusterctlConfigName is a name of the clusterctl config in any namespace.

View Source
const Kind = "CAPIProvider"

Kind is a CAPIProvider kind string.

View Source
const (
	// ProviderFinalizer is the finalizer apply on the CAPI Provider resource.
	ProviderFinalizer = "capiprovider.turtles.cattle.io"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "turtles-capi.cattle.io", Version: "v1alpha1"}

	// 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

	// Providers is a list of registered CAPI Operator resources satisfying Provider interface.
	Providers = []operatorv1.GenericProvider{
		&operatorv1.CoreProvider{},
		&operatorv1.BootstrapProvider{},
		&operatorv1.ControlPlaneProvider{},
		&operatorv1.InfrastructureProvider{},
		&operatorv1.AddonProvider{},
		&operatorv1.IPAMProvider{},
	}

	// ProviderLists is a list of registered CAPI Operator resources satisfying ProviderList interface.
	ProviderLists = []operatorv1.GenericProviderList{
		&operatorv1.CoreProviderList{},
		&operatorv1.BootstrapProviderList{},
		&operatorv1.ControlPlaneProviderList{},
		&operatorv1.InfrastructureProviderList{},
		&operatorv1.AddonProviderList{},
		&operatorv1.IPAMProviderList{},
	}
)

Functions

func AddKnownTypes

func AddKnownTypes(scheme *runtime.Scheme)

AddKnownTypes adds the list of known types to api.Scheme.

Types

type CAPIProvider

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

	// +kubebuilder:example={name: aws, version: "v2.3.0", type: infrastructure, credentials: {rancherCloudCredential: user-credential}}
	Spec CAPIProviderSpec `json:"spec,omitempty"`

	// +kubebuilder:default={}
	Status CAPIProviderStatus `json:"status,omitempty"`
}

CAPIProvider is the Schema for the CAPI Providers API.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type" +kubebuilder:printcolumn:name="ProviderName",type="string",JSONPath=".status.name" +kubebuilder:printcolumn:name="InstalledVersion",type="string",JSONPath=".status.installedVersion" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:validation:XValidation:message="CAPI Provider type should always be set.",rule="has(self.spec.type)"

func (*CAPIProvider) DeepCopy

func (in *CAPIProvider) DeepCopy() *CAPIProvider

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

func (*CAPIProvider) DeepCopyInto

func (in *CAPIProvider) DeepCopyInto(out *CAPIProvider)

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

func (*CAPIProvider) DeepCopyObject

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

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

func (*CAPIProvider) GetConditions

func (b *CAPIProvider) GetConditions() clusterv1.Conditions

GetConditions returns the Conditions field from the CAPIProvider status.

func (*CAPIProvider) GetSpec

func (b *CAPIProvider) GetSpec() operatorv1.ProviderSpec

GetSpec returns the Spec field in the CAPIProvider status.

func (*CAPIProvider) GetStatus

func (b *CAPIProvider) GetStatus() operatorv1.ProviderStatus

GetStatus returns the Status.ProviderStatus field in the CAPIProvider status.

func (*CAPIProvider) GetType

func (b *CAPIProvider) GetType() string

GetType returns the type of the CAPIProvider.

func (*CAPIProvider) ProviderName

func (b *CAPIProvider) ProviderName() string

ProviderName is a name for the managed CAPI provider resource.

func (*CAPIProvider) SetConditions

func (b *CAPIProvider) SetConditions(conditions clusterv1.Conditions)

SetConditions updates the Conditions field in the CAPIProvider status.

func (*CAPIProvider) SetPhase

func (b *CAPIProvider) SetPhase(p Phase)

SetPhase updates the Phase field in the CAPIProvider status.

func (*CAPIProvider) SetProviderName added in v0.13.0

func (b *CAPIProvider) SetProviderName()

SetProviderName updates provider name based on spec field or metadata.name.

func (*CAPIProvider) SetSpec

func (b *CAPIProvider) SetSpec(in operatorv1.ProviderSpec)

SetSpec updates the Spec field in the CAPIProvider status.

func (*CAPIProvider) SetStatus

func (b *CAPIProvider) SetStatus(in operatorv1.ProviderStatus)

SetStatus updates the Status.ProviderStatus field in the CAPIProvider status.

func (*CAPIProvider) SetVariables

func (b *CAPIProvider) SetVariables(v map[string]string)

SetVariables updates the Variables field in the CAPIProvider status.

type CAPIProviderList

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

CAPIProviderList contains a list of CAPIProviders.

func (*CAPIProviderList) DeepCopy

func (in *CAPIProviderList) DeepCopy() *CAPIProviderList

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

func (*CAPIProviderList) DeepCopyInto

func (in *CAPIProviderList) DeepCopyInto(out *CAPIProviderList)

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

func (*CAPIProviderList) DeepCopyObject

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

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

func (*CAPIProviderList) GetItems

GetItems returns the list of GenericProviders for CAPIProviderList.

type CAPIProviderSpec

type CAPIProviderSpec struct {
	// Name is the name of the provider to enable
	// +optional
	// +kubebuilder:example=aws
	Name string `json:"name"`

	// Type is the type of the provider to enable
	// +required
	// +kubebuilder:example=InfrastructureProvider
	Type Type `json:"type"`

	// Credentials is the structure holding the credentials to use for the provider. Only one credential type could be set at a time.
	// +kubebuilder:example={rancherCloudCredential: user-credential}
	// +optional
	Credentials *Credentials `json:"credentials,omitempty"`

	// Features is a collection of features to enable.
	// +optional
	// +kubebuilder:example={machinePool: true, clusterResourceSet: true, clusterTopology: true}
	Features *Features `json:"features,omitempty"`

	// Variables is a map of environment variables to add to the content of the ConfigSecret
	// +optional
	// +kubebuilder:example={CLUSTER_TOPOLOGY:"true",EXP_CLUSTER_RESOURCE_SET:"true",EXP_MACHINE_POOL: "true"}
	Variables map[string]string `json:"variables,omitempty"`

	// ProviderSpec is the spec of the underlying CAPI Provider resource.
	operatorv1.ProviderSpec `json:",inline"`
}

CAPIProviderSpec defines the desired state of CAPIProvider. +kubebuilder:validation:XValidation:message="CAPI Provider version should be in the semver format prefixed with 'v'. Example: v1.9.3",rule="!has(self.version) || self.version.matches(r\"\"\"^v([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$\"\"\")" +kubebuilder:validation:XValidation:message="Config secret namespace is always equal to the resource namespace and should not be set.",rule="!has(self.configSecret) || !has(self.configSecret.__namespace__)" +kubebuilder:validation:XValidation:message="One of fetchConfig url or selector should be set.",rule="!has(self.fetchConfig) || [has(self.fetchConfig.url), has(self.fetchConfig.selector)].exists_one(e, e)"

func (*CAPIProviderSpec) DeepCopy

func (in *CAPIProviderSpec) DeepCopy() *CAPIProviderSpec

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

func (*CAPIProviderSpec) DeepCopyInto

func (in *CAPIProviderSpec) DeepCopyInto(out *CAPIProviderSpec)

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

type CAPIProviderStatus

type CAPIProviderStatus struct {
	// Indicates the provider status
	// +kubebuilder:default=Pending
	Phase Phase `json:"phase,omitempty"`

	// Variables is a map of environment variables added to the content of the ConfigSecret
	// +kubebuilder:default={CLUSTER_TOPOLOGY:"true",EXP_CLUSTER_RESOURCE_SET:"true",EXP_MACHINE_POOL: "true"}
	Variables map[string]string `json:"variables,omitempty"`

	// Name reflects actual provider name, which will be visible to users in 'kubectl get capiproviders -A -o wide'
	Name string `json:"name,omitempty"`

	operatorv1.ProviderStatus `json:",inline"`
}

CAPIProviderStatus defines the observed state of CAPIProvider.

func (*CAPIProviderStatus) DeepCopy

func (in *CAPIProviderStatus) DeepCopy() *CAPIProviderStatus

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

func (*CAPIProviderStatus) DeepCopyInto

func (in *CAPIProviderStatus) DeepCopyInto(out *CAPIProviderStatus)

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

type ClusterctlConfig added in v0.12.0

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

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

ClusterctlConfig is the Schema for the CAPI Clusterctl config API.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:validation:XValidation:message="Clusterctl Config should be named clusterctl-config.",rule="self.metadata.name == 'clusterctl-config'"

func (*ClusterctlConfig) DeepCopy added in v0.12.0

func (in *ClusterctlConfig) DeepCopy() *ClusterctlConfig

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

func (*ClusterctlConfig) DeepCopyInto added in v0.12.0

func (in *ClusterctlConfig) DeepCopyInto(out *ClusterctlConfig)

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

func (*ClusterctlConfig) DeepCopyObject added in v0.12.0

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

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

type ClusterctlConfigList added in v0.12.0

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

ClusterctlConfigList contains a list of ClusterctlConfigs.

func (*ClusterctlConfigList) DeepCopy added in v0.12.0

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

func (*ClusterctlConfigList) DeepCopyInto added in v0.12.0

func (in *ClusterctlConfigList) DeepCopyInto(out *ClusterctlConfigList)

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

func (*ClusterctlConfigList) DeepCopyObject added in v0.12.0

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

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

type ClusterctlConfigSpec added in v0.12.0

type ClusterctlConfigSpec struct {
	// Images is a list of image overrided for specified providers
	// +optional
	Images []Image `json:"images,omitempty"`

	// Provider overrides
	// +optional
	Providers ProviderList `json:"providers,omitempty"`
}

ClusterctlConfigSpec defines the user overrides for images and known providers with sources

func (*ClusterctlConfigSpec) DeepCopy added in v0.12.0

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

func (*ClusterctlConfigSpec) DeepCopyInto added in v0.12.0

func (in *ClusterctlConfigSpec) DeepCopyInto(out *ClusterctlConfigSpec)

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

type Credentials

type Credentials struct {
	// RancherCloudCredential is the Rancher Cloud Credential name
	RancherCloudCredential string `json:"rancherCloudCredential,omitempty"`

	// RancherCloudCredentialNamespaceName is the Rancher Cloud Credential namespace:name reference
	RancherCloudCredentialNamespaceName string `json:"rancherCloudCredentialNamespaceName,omitempty"`
}

Credentials defines the external credentials information for the provider. +kubebuilder:validation:MaxProperties=1 +kubebuilder:validation:MinProperties=1 +kubebuilder:validation:XValidation:message="rancherCloudCredentialNamespaceName should be in the namespace:name format.",rule="!has(self.rancherCloudCredentialNamespaceName) || self.rancherCloudCredentialNamespaceName.matches('^.+:.+$')" +structType=atomic

func (*Credentials) DeepCopy

func (in *Credentials) DeepCopy() *Credentials

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

func (*Credentials) DeepCopyInto

func (in *Credentials) DeepCopyInto(out *Credentials)

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

type Features

type Features struct {
	// MachinePool if set to true will enable the machine pool feature.
	MachinePool bool `json:"machinePool,omitempty"`

	// ClusterResourceSet if set to true will enable the cluster resource set feature.
	ClusterResourceSet bool `json:"clusterResourceSet,omitempty"`

	// ClusterTopology if set to true will enable the clusterclass feature.
	ClusterTopology bool `json:"clusterTopology,omitempty"`
}

Features defines a collection of features for the CAPI Provider to apply.

func (*Features) DeepCopy

func (in *Features) DeepCopy() *Features

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

func (*Features) DeepCopyInto

func (in *Features) DeepCopyInto(out *Features)

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

type Image added in v0.12.0

type Image struct {
	// Repository sets the container registry override to pull images from.
	// +kubebuilder:example=my-registry/my-org
	Repository string `json:"repository,omitempty"`

	// Tag allows to specify a tag for the images.
	Tag string `json:"tag,omitempty"`

	// Name of the provider image override
	// +required
	// +kubebuilder:example=all
	Name string `json:"name"`
}

Image allows to define transformations to apply to the image contained in the YAML manifests.

func (*Image) DeepCopy added in v0.12.0

func (in *Image) DeepCopy() *Image

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

func (*Image) DeepCopyInto added in v0.12.0

func (in *Image) DeepCopyInto(out *Image)

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

type Phase

type Phase string

Phase defines the current state of the CAPI Provider resource.

const (
	// Pending status identifies a provder which has not yet started provisioning.
	Pending Phase = "Pending"
	// Provisioning status defines provider in a provisioning state.
	Provisioning Phase = "Provisioning"
	// Ready status identifies that the provider is ready to be used.
	Ready Phase = "Ready"
	// Failed status defines a failed state of provider provisioning.
	Failed Phase = "Failed"
)

type Provider added in v0.12.0

type Provider struct {
	// Name of the provider
	// +required
	Name string `json:"name"`

	// URL of the provider components. Will be used unless and override is specified
	// +required
	URL string `json:"url"`

	// Type is the type of the provider
	// +required
	// +kubebuilder:example=InfrastructureProvider
	Type string `json:"type"`
}

Provider allows to define providers with known URLs to pull the components.

func (*Provider) DeepCopy added in v0.12.0

func (in *Provider) DeepCopy() *Provider

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

func (*Provider) DeepCopyInto added in v0.12.0

func (in *Provider) DeepCopyInto(out *Provider)

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

type ProviderList added in v0.12.0

type ProviderList []Provider

ProviderList is a list of providers.

func (ProviderList) DeepCopy added in v0.12.0

func (in ProviderList) DeepCopy() ProviderList

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

func (ProviderList) DeepCopyInto added in v0.12.0

func (in ProviderList) DeepCopyInto(out *ProviderList)

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

type Type

type Type string

Type defines the type of the CAPI Provider.

const (
	// Infrastructure is the name for the infrastructure CAPI Provider.
	Infrastructure Type = "infrastructure"
	// Core is the name for core CAPI Provider.
	Core Type = "core"
	// ControlPlane is the name for the controlPlane CAPI Provider.
	ControlPlane Type = "controlPlane"
	// Bootstrap is the name for the bootstrap CAPI Provider.
	Bootstrap Type = "bootstrap"
	// Addon is the name for the addon CAPI Provider.
	Addon Type = "addon"
	// IPAM is the name for the addon for IPAM CAPI Provider.
	IPAM Type = "ipam"
	// RuntimeExtension is the name for the RuntimeExtension Provider.
	RuntimeExtension Type = "runtimeextension"
)

func (Type) ToKind

func (t Type) ToKind() string

ToKind converts ProviderType to CAPI Operator provider object kind.

type WorkloadIdentityRef

type WorkloadIdentityRef struct {
	// Name of the identity
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Kind of the identity
	Kind string `json:"kind"`
}

WorkloadIdentityRef is a reference to an identity to be used when reconciling the cluster.

func (*WorkloadIdentityRef) DeepCopy

func (in *WorkloadIdentityRef) DeepCopy() *WorkloadIdentityRef

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

func (*WorkloadIdentityRef) DeepCopyInto

func (in *WorkloadIdentityRef) DeepCopyInto(out *WorkloadIdentityRef)

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