v1beta1

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package v1beta1 contains ControlPlane resources. +kubebuilder:object:generate=true +groupName=spaces.upbound.io +versionName=v1beta1

Index

Constants

View Source
const (
	// ConditionTypeHealthy indicates that the control plane is healthy.
	ConditionTypeHealthy xpcommonv1.ConditionType = "Healthy"
	// ReasonHealthy indicates that the control plane is healthy.
	ReasonHealthy xpcommonv1.ConditionReason = "HealthyControlPlane"
	// ReasonUnhealthy indicates that the control plane is unhealthy.
	ReasonUnhealthy xpcommonv1.ConditionReason = "UnhealthyControlPlane"

	// ConditionTypeControlPlaneProvisioned indicates that the control plane is provisioned.
	ConditionTypeControlPlaneProvisioned xpcommonv1.ConditionType = "ControlPlaneProvisioned"
	// ReasonProvisioned indicates that the control plane is provisioned.
	ReasonProvisioned xpcommonv1.ConditionReason = "Provisioned"
	// ReasonProvisioningError indicates that the control plane provisioning has failed.
	ReasonProvisioningError xpcommonv1.ConditionReason = "ProvisioningError"

	// ConditionTypeSourceSynced indicates that the git source is in sync.
	ConditionTypeSourceSynced xpcommonv1.ConditionType = "SourceSynced"
	// ReasonSourceCompleted indicates that the git sync has been completed.
	ReasonSourceCompleted xpcommonv1.ConditionReason = "Completed"
	// ReasonSourceInProgress indicates that the git sync is still in progress.
	ReasonSourceInProgress xpcommonv1.ConditionReason = "InProgress"

	// ConditionTypeSupported indicates that the control plane is running a
	// supported version of Crossplane.
	ConditionTypeSupported xpcommonv1.ConditionType = "Supported"
	// ReasonSupported indicates that the control plane is running
	// a supported version of Crossplane.
	ReasonSupported xpcommonv1.ConditionReason = "SupportedCrossplaneVersion"
	// ReasonUnsupported indicates that the control plane is running a version
	// of Crossplane that is not supported.
	ReasonUnsupported xpcommonv1.ConditionReason = "UnsupportedCrossplaneVersion"

	// ConditionTypeRestored indicates that the control plane has been restored from backup.
	ConditionTypeRestored xpcommonv1.ConditionType = "Restored"
	// ReasonRestoreCompleted indicates that the control plane has been successfully restored from backup.
	ReasonRestoreCompleted xpcommonv1.ConditionReason = "Completed"
	// ReasonRestoreFailed indicates that the control plane failed to restore from backup.
	ReasonRestoreFailed xpcommonv1.ConditionReason = "Failed"

	// ReasonRestorePending indicates that the control plane restore is pending.
	ReasonRestorePending xpcommonv1.ConditionReason = "RestorePending"

	// ConditionTypeRunning indicates whether the workloads on the Control Plane
	// are running or not.
	ConditionTypeRunning xpcommonv1.ConditionType = "CrossplaneRunning"
	// ReasonPausing indicates that the crossplane and provider workloads are being paused.
	ReasonPausing xpcommonv1.ConditionReason = "Pausing"
	// ReasonPaused indicates that the crossplane and provider workloads have been paused.
	ReasonPaused xpcommonv1.ConditionReason = "Paused"
	// ReasonStarting indicates that the crossplane and provider workloads are being started.
	ReasonStarting xpcommonv1.ConditionReason = "Starting"
	// ReasonStarted indicates that the crossplane and provider workloads have been started.
	ReasonStarted xpcommonv1.ConditionReason = "Started"
)
View Source
const (
	// ResourceCredentialsSecretInClusterKubeconfigKey is the key in the
	// connection secret of the ControlPlane that contains the kubeconfig
	// to be used by running pods in the cluster.
	ResourceCredentialsSecretInClusterKubeconfigKey = "kubeconfig-incluster"

	// ConditionMessageAnnotationKey is the key for the message shown in the
	// message column in kubectl.
	ConditionMessageAnnotationKey = "internal.spaces.upbound.io/message"

	// ControlPlaneGroupLabelKey is the key used to identify namespaces as groups. The
	// value will be "true".
	ControlPlaneGroupLabelKey = "spaces.upbound.io/group"
	// ControlPlaneGroupProtectionKey is the key used to prevent deletion of groups
	// via the Spaces API. Deletion will not be protected if the underlying namespace
	// is deleted.
	ControlPlaneGroupProtectionKey = "spaces.upbound.io/group-deletion-protection"
)
View Source
const (
	GitAuthTypeNone        = "None"
	GitAuthTypeBasic       = "Basic"
	GitAuthTypeBearerToken = "BearerToken"
	GitAuthTypeSSH         = "SSH"

	AuthSecretKeyUsername      = "username"
	AuthSecretKeyPassword      = "password"
	AuthSecretKeyBearerToken   = "bearerToken"
	AuthSecretKeySSHIdentity   = "identity"
	AuthSecretKeySSHKnownHosts = "knownHosts"

	CASecretKeyCAFile = "ca.crt"
)

GitAuthType constants.

View Source
const (
	// KubeCompositionAnnotation is an optional, alpha-level annotation that
	// selects the KubeControlPlane composition for a specific ControlPlane.
	// The default value is "k8s".
	//
	// It is gated by the "EnableKine" feature gate.
	KubeCompositionAnnotation = "internal.spaces.upbound.io/kube-composition"
	// FeaturesAnnotation is an optional annotation that enables features
	// gates within the control plane compositions. Value should be defined
	// as an inline map of key value pairs expressing features to be enabled.
	// For example: `{"featureA": true,"featureB": false}`. The default value is
	// empty (no features enabled).
	FeaturesAnnotation = "internal.spaces.upbound.io/features"
	// TierLimitsAnnotation is an optional annotation that specifies the limits
	// applied to the control plane, as metered by the mxp-account-gate. These
	// limits are only applicable when the account gate is enabled using the
	// features annotation.
	TierLimitsAnnotation = "internal.spaces.upbound.io/tier-limits"
)
View Source
const (
	Group   = "spaces.upbound.io"
	Version = "v1beta1"
)

Package type metadata.

View Source
const (
	// ClassDefault is the default class for the control plane.
	ClassDefault = "default"
)

Variables

View Source
var (
	// ControlPlaneKind is the kind of the ControlPlane.
	ControlPlaneKind = reflect.TypeOf(ControlPlane{}).Name()
	// ControlPlaneListKind is the kind of a list of ControlPlane.
	ControlPlaneListKind = reflect.TypeOf(ControlPlaneList{}).Name()
)

ManagedControlPlane type metadata.

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func ControlPlaneProvisionInProgress

func ControlPlaneProvisionInProgress() xpcommonv1.Condition

ControlPlaneProvisionInProgress returns a condition that indicates the control plane is still being provisioned.

func ControlPlaneProvisioned

func ControlPlaneProvisioned() xpcommonv1.Condition

ControlPlaneProvisioned returns a condition that indicates the control plane has been provisioned.

func ControlPlaneProvisioningError

func ControlPlaneProvisioningError(err error) xpcommonv1.Condition

ControlPlaneProvisioningError returns a condition that indicates the control plane provisioning has failed.

func Healthy

func Healthy() xpcommonv1.Condition

Healthy returns a condition that indicates the control plane is healthy.

func PauseCompleted

func PauseCompleted() xpcommonv1.Condition

PauseCompleted returns a condition that indicates that the crossplane and provider workloads have been paused.

func PauseInProgress

func PauseInProgress() xpcommonv1.Condition

PauseInProgress returns a condition that indicates that the crossplane and provider workloads are being paused.

func RestoreCompleted

func RestoreCompleted() xpcommonv1.Condition

RestoreCompleted returns a condition that indicates that the control plane has been restored from backup.

func RestoreFailed

func RestoreFailed(err error) xpcommonv1.Condition

RestoreFailed returns a condition that indicates that the control plane failed to restore from backup.

func RestorePending

func RestorePending() xpcommonv1.Condition

RestorePending returns a condition that indicates that the control plane restore is pending.

func SourceError

func SourceError(err error) xpcommonv1.Condition

SourceError returns a condition that indicates the source operation of the control plane has failed.

func SourceInProgress

func SourceInProgress(revision string) xpcommonv1.Condition

SourceInProgress returns a condition that indicates the control plane is still processing resources coming from the source.

func SourceSynced

func SourceSynced(revision string) xpcommonv1.Condition

SourceSynced returns a condition that indicates the control plane is in sync with the source.

func StartCompleted

func StartCompleted() xpcommonv1.Condition

StartCompleted returns a condition that indicates that the crossplane and provider workloads have been restarted.

func StartInProgress

func StartInProgress() xpcommonv1.Condition

StartInProgress returns a condition that indicates that the crossplane and provider workloads are being restarted.

func SupportedCrossplaneVersion

func SupportedCrossplaneVersion() xpcommonv1.Condition

SupportedCrossplaneVersion returns a condition that indicates that the control plane is running a supported version of Crossplane.

func Unhealthy

func Unhealthy() xpcommonv1.Condition

Unhealthy returns a condition that indicates the control plane is unhealthy.

func UnsupportedCrossplaneVersion

func UnsupportedCrossplaneVersion(msg string) xpcommonv1.Condition

UnsupportedCrossplaneVersion returns a condition that indicates that the control plane is running an unsupported version of Crossplane.

Types

type ControlPlane

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

	Spec   ControlPlaneSpec   `json:"spec"`
	Status ControlPlaneStatus `json:"status,omitempty"`
}

ControlPlane defines a managed Crossplane instance.

func (*ControlPlane) DeepCopy

func (in *ControlPlane) DeepCopy() *ControlPlane

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

func (*ControlPlane) DeepCopyInto

func (in *ControlPlane) DeepCopyInto(out *ControlPlane)

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

func (*ControlPlane) DeepCopyObject

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

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

func (*ControlPlane) GetCondition

func (mg *ControlPlane) GetCondition(ct xpv1.ConditionType) xpv1.Condition

GetCondition of this ControlPlane.

func (*ControlPlane) GetWriteConnectionSecretToReference

func (mg *ControlPlane) GetWriteConnectionSecretToReference() *xpv1.SecretReference

GetWriteConnectionSecretToReference of this ControlPlane.

func (*ControlPlane) SetConditions

func (mg *ControlPlane) SetConditions(c ...xpv1.Condition)

SetConditions of this ControlPlane.

func (*ControlPlane) SetWriteConnectionSecretToReference

func (mg *ControlPlane) SetWriteConnectionSecretToReference(r *xpv1.SecretReference)

SetWriteConnectionSecretToReference of this ControlPlane.

type ControlPlaneList

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

ControlPlaneList contains a list of ControlPlane

func (*ControlPlaneList) DeepCopy

func (in *ControlPlaneList) DeepCopy() *ControlPlaneList

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

func (*ControlPlaneList) DeepCopyInto

func (in *ControlPlaneList) DeepCopyInto(out *ControlPlaneList)

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

func (*ControlPlaneList) DeepCopyObject

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

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

type ControlPlaneSpec

type ControlPlaneSpec struct {
	// WriteConnectionSecretToReference specifies the namespace and name of a
	// Secret to which any connection details for this managed resource should
	// be written. Connection details frequently include the endpoint, username,
	// and password required to connect to the managed resource.
	// This field is planned to be replaced in a future release in favor of
	// PublishConnectionDetailsTo. Currently, both could be set independently
	// and connection details would be published to both without affecting
	// each other.
	//
	// If omitted, it is defaulted to the namespace of the ControlPlane.
	// Deprecated: Use Hub or Upbound identities instead.
	// +optional
	WriteConnectionSecretToReference *SecretReference `json:"writeConnectionSecretToRef,omitempty"`

	// Crossplane defines the configuration for Crossplane.
	Crossplane CrossplaneSpec `json:"crossplane,omitempty"`

	// [[GATE:EnableSharedBackup]] THIS IS AN ALPHA FIELD. Do not use it in production.
	// Restore specifies details about the control planes restore configuration.
	// +optional
	// +kubebuilder:validation:XValidation:rule="!has(oldSelf.finishedAt) || oldSelf.finishedAt == self.finishedAt",message="finishedAt is immutable once set"
	Restore *Restore `json:"restore,omitempty"`

	// [[GATE:EnableControlPlaneClasses]]
	// Class specifies the class of the control plane. This affects the
	// control plane sizing, including component replicas and resource
	// requirements. There are multiple predefined classes, with "default"
	// being the standard Spaces control plane without any additional class
	// configuration. Check the Upbound Cloud documentation for a list of all
	// available classes. Defaults to "default".
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="class is immutable"
	// +kubebuilder:default=default
	Class string `json:"class,omitempty"`
}

A ControlPlaneSpec represents the desired state of the ControlPlane. +kubebuilder:validation:XValidation:rule="!has(oldSelf.restore) || has(self.restore)",message="[[GATE:EnableSharedBackup]] restore source can not be unset" +kubebuilder:validation:XValidation:rule="has(oldSelf.restore) || !has(self.restore)",message="[[GATE:EnableSharedBackup]] restore source can not be set after creation" +kubebuilder:validation:XValidation:rule="!has(self.crossplane.autoUpgrade) || self.crossplane.autoUpgrade.channel != \"None\" || self.crossplane.version != \"\"",message="\"version\" cannot be empty when upgrade channel is \"None\""

func (*ControlPlaneSpec) DeepCopy

func (in *ControlPlaneSpec) DeepCopy() *ControlPlaneSpec

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

func (*ControlPlaneSpec) DeepCopyInto

func (in *ControlPlaneSpec) DeepCopyInto(out *ControlPlaneSpec)

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

type ControlPlaneStatus

type ControlPlaneStatus struct {
	xpv1.ResourceStatus `json:",inline"`
	// Message is a human-readable message indicating details about why the
	// ControlPlane is in this condition.
	Message        string `json:"message,omitempty"`
	ControlPlaneID string `json:"controlPlaneID,omitempty"`
}

A ControlPlaneStatus represents the observed state of a ControlPlane.

func (*ControlPlaneStatus) DeepCopy

func (in *ControlPlaneStatus) DeepCopy() *ControlPlaneStatus

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

func (*ControlPlaneStatus) DeepCopyInto

func (in *ControlPlaneStatus) DeepCopyInto(out *ControlPlaneStatus)

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

type CrossplaneAutoUpgradeSpec

type CrossplaneAutoUpgradeSpec struct {
	// Channel defines the upgrade channels for Crossplane. We support the following channels where 'Stable' is the
	// default:
	// - None: disables auto-upgrades and keeps the control plane at its current version of Crossplane.
	// - Patch: automatically upgrades the control plane to the latest supported patch version when it
	//   becomes available while keeping the minor version the same.
	// - Stable: automatically upgrades the control plane to the latest supported patch release on minor
	//   version N-1, where N is the latest supported minor version.
	// - Rapid: automatically upgrades the cluster to the latest supported patch release on the latest
	//   supported minor version.
	// +optional
	// +kubebuilder:default="Stable"
	// +kubebuilder:validation:Enum="None";"Patch";"Stable";"Rapid"
	Channel *CrossplaneUpgradeChannel `json:"channel,omitempty"`
}

CrossplaneAutoUpgradeSpec defines the auto upgrade policy for Crossplane.

func (*CrossplaneAutoUpgradeSpec) DeepCopy

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

func (*CrossplaneAutoUpgradeSpec) DeepCopyInto

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

type CrossplaneSpec

type CrossplaneSpec struct {
	// Version is the version of Universal Crossplane to install.
	// +optional
	Version *string `json:"version,omitempty"`

	// AutoUpgrades defines the auto upgrade configuration for Crossplane.
	// +optional
	// +kubebuilder:default={"channel":"Stable"}
	AutoUpgradeSpec *CrossplaneAutoUpgradeSpec `json:"autoUpgrade,omitempty"`

	// State defines the state for crossplane and provider workloads. We support
	// the following states where 'Running' is the default:
	// - Running: Starts/Scales up all crossplane and provider workloads in the ControlPlane
	// - Paused: Pauses/Scales down all crossplane and provider workloads in the ControlPlane
	// +optional
	// +kubebuilder:validation:Enum=Running;Paused
	// +kubebuilder:default=Running
	State *CrossplaneState `json:"state,omitempty"`
}

CrossplaneSpec defines the configuration for Crossplane.

func (*CrossplaneSpec) DeepCopy

func (in *CrossplaneSpec) DeepCopy() *CrossplaneSpec

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

func (*CrossplaneSpec) DeepCopyInto

func (in *CrossplaneSpec) DeepCopyInto(out *CrossplaneSpec)

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

type CrossplaneState

type CrossplaneState string

CrossplaneState is the running state for the crossplane and provider workloads.

const (
	// CrossplaneStateRunning switches the crossplane and provider workloads to
	// the running state by scaling up them.
	CrossplaneStateRunning CrossplaneState = "Running"

	// CrossplaneStatePaused switches the crossplane and provider workloads to
	// the paused state by scaling down them.
	CrossplaneStatePaused CrossplaneState = "Paused"
)

type CrossplaneUpgradeChannel

type CrossplaneUpgradeChannel string

CrossplaneUpgradeChannel is the channel for Crossplane upgrades.

const (
	// CrossplaneUpgradeNone disables auto-upgrades and keeps the control plane at its current version of Crossplane.
	CrossplaneUpgradeNone CrossplaneUpgradeChannel = "None"

	// CrossplaneUpgradePatch automatically upgrades the control plane to the latest supported patch version when it
	// becomes available while keeping the minor version the same.
	CrossplaneUpgradePatch CrossplaneUpgradeChannel = "Patch"

	// CrossplaneUpgradeStable automatically upgrades the control plane to the latest supported patch release on minor
	// version N-1, where N is the latest supported minor version.
	CrossplaneUpgradeStable CrossplaneUpgradeChannel = "Stable"

	// CrossplaneUpgradeRapid automatically upgrades the cluster to the latest supported patch release on the latest
	// supported minor version.
	CrossplaneUpgradeRapid CrossplaneUpgradeChannel = "Rapid"
)

type GitAuthType

type GitAuthType string

GitAuthType is the type of authentication to use to access a Git repository.

type Restore

type Restore struct {
	// Source of the Backup or BackupSchedule to restore from.
	// Require "restore" permission on the referenced Backup or BackupSchedule.
	// ApiGroup is optional and defaults to "spaces.upbound.io".
	// Kind is required, and the only supported kinds are Backup and
	// BackupSchedule at the moment.
	// Name is required.
	// +kubebuilder:validation:XValidation:rule="(!has(self.apiGroup) || self.apiGroup == 'spaces.upbound.io') && (self.kind == 'Backup' || self.kind == 'BackupSchedule')",message="source must be a reference to a Backup or BackupSchedule (v1alpha1)"
	// +kubebuilder:validation:XValidation:rule="oldSelf == self",message="source is immutable"
	Source common.TypedLocalObjectReference `json:"source"`

	// FinishedAt is the time at which the control plane was restored, it's not
	// meant to be set by the user, but rather by the system when the control
	// plane is restored.
	FinishedAt *metav1.Time `json:"finishedAt,omitempty"`
}

Restore specifies details about the backup to restore from.

func (*Restore) DeepCopy

func (in *Restore) DeepCopy() *Restore

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

func (*Restore) DeepCopyInto

func (in *Restore) DeepCopyInto(out *Restore)

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

type SecretReference

type SecretReference struct {
	// Name of the secret.
	Name string `json:"name"`

	// Namespace of the secret. If omitted, it is equal to
	// the namespace of the resource containing this reference as a field.
	// +optional
	Namespace string `json:"namespace"`
}

A SecretReference is a reference to a secret in an arbitrary namespace.

func (*SecretReference) DeepCopy

func (in *SecretReference) DeepCopy() *SecretReference

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

func (*SecretReference) DeepCopyInto

func (in *SecretReference) DeepCopyInto(out *SecretReference)

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