Documentation
¶
Overview ¶
Package v1beta1 contains API Schema definitions for the v1beta1 API group. +kubebuilder:object:generate=true +groupName=fleetconfig.open-cluster-management.io
Index ¶
- Constants
- Variables
- type AddOn
- type AddOnConfig
- type CleanupConfig
- type ClusterManager
- type Condition
- type ConfigMapRef
- type Helm
- type Hub
- type HubAddOn
- type HubList
- type HubRef
- type HubSpec
- type HubStatus
- type InstalledHubAddOn
- type Klusterlet
- type KlusterletChartConfig
- type Kubeconfig
- type ManagedClusterType
- type OCMSource
- type RegistrationAuth
- type ResourceSpec
- type ResourceValues
- type SecretReference
- type SingletonControlPlane
- type Spoke
- func (s *Spoke) BaseArgs() []string
- func (in *Spoke) DeepCopy() *Spoke
- func (in *Spoke) DeepCopyInto(out *Spoke)
- func (in *Spoke) DeepCopyObject() runtime.Object
- func (s *Spoke) GetCondition(cType string) *Condition
- func (s *Spoke) IsHubAsSpoke() bool
- func (s *Spoke) IsManagedBy(om metav1.ObjectMeta) bool
- func (s *Spoke) PivotComplete() bool
- func (s *Spoke) SetConditions(cover bool, c ...Condition)
- type SpokeList
- type SpokeSpec
- type SpokeStatus
Constants ¶
const ( // HubCleanupPreflightFinalizer is the finalizer for cleanup preflight checks hub cluster's controller instance. Used to signal to the spoke's controller that unjoin can proceed. HubCleanupPreflightFinalizer = "fleetconfig.open-cluster-management.io/hub-cleanup-preflight" // HubCleanupFinalizer is the finalizer for cleanup by the hub cluster's controller instance. HubCleanupFinalizer = "fleetconfig.open-cluster-management.io/hub-cleanup" // SpokeCleanupFinalizer is the finalizer for cleanup by the spoke cluster's controller instance. SpokeCleanupFinalizer = "fleetconfig.open-cluster-management.io/spoke-cleanup" )
const ( // HubInitialized means that the Hub has been initialized. HubInitialized = "HubInitialized" // AddonsConfigured means that all addons have been configured on the Hub, or enabled/disabled on a Spoke. AddonsConfigured = "AddonsConfigured" // CleanupFailed means that a failure occurred during cleanup. CleanupFailed = "CleanupFailed" // SpokeJoined means that the Spoke has successfully joined the Hub. SpokeJoined = "SpokeJoined" // PivotComplete means that the spoke cluster has successfully started managing itself. PivotComplete = "PivotComplete" // KlusterletSynced means that Klusterlet's OCM bundle version and values are up to date. KlusterletSynced = "KlusterletSynced" // HubUpgradeFailed means that the ClusterManager version upgrade failed. HubUpgradeFailed = "HubUpgradeFailed" )
Hub and Spoke condition types
const ( // HubStarting means that the Hub is being initialized. HubStarting = "Initializing" // HubRunning means that the Hub is initialized successfully. HubRunning = "Running" // SpokeJoining means that the Spoke is being joined to the Hub. SpokeJoining = "Joining" // SpokeRunning means that the Spoke has successfully joined the Hub. SpokeRunning = "Running" // Unhealthy means that a failure occurred during Hub initialization and/or Spoke join attempt. Unhealthy = "Unhealthy" // Deleting means that the Hub or Spoke is being deleted. Deleting = "Deleting" )
Hub and Spoke phases
const ( // ManagedClusterTypeHub is the type of managed cluster that is a hub. ManagedClusterTypeHub = "hub" // ManagedClusterTypeSpoke is the type of managed cluster that is a spoke. ManagedClusterTypeSpoke = "spoke" // ManagedClusterTypeHubAsSpoke is the type of managed cluster that is both a hub and a spoke. ManagedClusterTypeHubAsSpoke = "hub-as-spoke" )
const ( // InstanceTypeManager indicates that the controller is running in a Hub cluster and only handles day 1 Spoke operations. InstanceTypeManager = "manager" // InstanceTypeAgent indicates that the controller is running in a Spoke cluster and only handles day 2 Spoke operations. InstanceTypeAgent = "agent" // InstanceTypeUnified indicates that the controller is running in a Hub cluster and handles the entire lifecycle of Spoke resources. InstanceTypeUnified = "unified" // HubKubeconfigEnvVar is the environment variable containing the path to the mounted Hub kubeconfig. HubKubeconfigEnvVar = "HUB_KUBECONFIG" // DefaultHubKubeconfigPath is the path of the mounted kubeconfig when the controller is running in a Spoke cluster. Used if the environment variable is not set. DefaultHubKubeconfigPath = "/managed/hub-kubeconfig/kubeconfig" // SpokeNameEnvVar is the environment variable containing the name of the Spoke resource. SpokeNameEnvVar = "CLUSTER_NAME" // SpokeNamespaceEnvVar is the environment variable containing the namespace of the Spoke resource. SpokeNamespaceEnvVar = "CLUSTER_NAMESPACE" // HubNamespaceEnvVar is the environment variable containing the namespace of the Hub resource. HubNamespaceEnvVar = "HUB_NAMESPACE" // ControllerNamespaceEnvVar is the environment variable containing the namespace that the controller is deployed to. ControllerNamespaceEnvVar = "CONTROLLER_NAMESPACE" // ClusterRoleNameEnvVar is the environment variable containing the name of the ClusterRole for fleetconfig-controller-manager. ClusterRoleNameEnvVar = "CLUSTER_ROLE_NAME" // PurgeAgentNamespaceEnvVar is the environment variable used to signal to the agent whether or not it should garbage collect it install namespace. PurgeAgentNamespaceEnvVar = "PURGE_AGENT_NAMESPACE" // FCCAddOnName is the name of the fleetconfig-controller addon. FCCAddOnName = "fleetconfig-controller-agent" // DefaultFCCManagerRole is the default name of the fleetconfig-controller-manager ClusterRole. DefaultFCCManagerRole = "fleetconfig-controller-manager-role" // NamespaceOCM is the open-cluster-management namespace. NamespaceOCM = "open-cluster-management" // NamespaceOCMAgent is the namespace for the open-cluster-management agent. NamespaceOCMAgent = "open-cluster-management-agent" // NamespaceOCMAgentAddOn is the namespace for open-cluster-management agent addons. NamespaceOCMAgentAddOn = "open-cluster-management-agent-addon" // AgentCleanupWatcherName is the name of the watcher for cleaning up the spoke agent. AgentCleanupWatcherName = "agent-cleanup-watcher" // ManagedClusterWorkloadCleanupTaint is applied to a ManagedCluster to remove non-addon workloads. // Addons can tolerate this taint to continue running during initial cleanup phase. ManagedClusterWorkloadCleanupTaint = "fleetconfig.open-cluster-management.io/workload-cleanup" // ManagedClusterTerminatingTaint is applied to remove all workloads including addons. // Nothing should tolerate this taint - it signals final cluster termination. ManagedClusterTerminatingTaint = "fleetconfig.open-cluster-management.io/terminating" )
Addon mode
const ( // LabelManagedClusterType is the label key for the managed cluster type. LabelManagedClusterType = "fleetconfig.open-cluster-management.io/managedClusterType" // LabelAddOnManagedBy is the label key for the lifecycle manager of an add-on resource. LabelAddOnManagedBy = "addon.open-cluster-management.io/managedBy" )
FleetConfig labels
const ( // CSRRegistrationDriver is the default CSR-based registration driver. CSRRegistrationDriver = "csr" // AWSIRSARegistrationDriver is the AWS IAM Role for Service Accounts (IRSA) registration driver. AWSIRSARegistrationDriver = "awsirsa" )
Registration driver types
const ( // AddonConfigMapNamePrefix is the common name prefix for all configmaps containing addon configurations. AddonConfigMapNamePrefix = "fleet-addon" // AddonConfigMapManifestRawKey is the data key containing raw manifests. AddonConfigMapManifestRawKey = "manifestsRaw" // AddonConfigMapManifestRawKey is the data key containing a URL to download manifests. AddonConfigMapManifestURLKey = "manifestsURL" )
Addon ConfigMap constants
const ( // AddonArgoCD is the name of the built-in ArgoCD hub addon. AddonArgoCD = "argocd" // AddonGPF is the name of the built-in Governance Policy Framework hub addon. AddonGPF = "governance-policy-framework" )
const ( // BundleVersionLatest is the latest OCM source version BundleVersionLatest = "latest" // BundleVersionDefault is the default OCM source version BundleVersionDefault = "default" )
const ( // NamespaceManagedClusterSetGlobal is the namespace for the global managed cluster set NamespaceManagedClusterSetGlobal = "managed-cluster-set-global" // NamespaceManagedClusterSetDefault is the namespace for the default managed cluster set NamespaceManagedClusterSetDefault = "managed-cluster-set-default" // NamespaceManagedClusterSetSpokes is the namespace for the spokes managed cluster set NamespaceManagedClusterSetSpokes = "managed-cluster-set-spokes" // ManagedClusterSetGlobal is the name of the global managed cluster set ManagedClusterSetGlobal = "global" // ManagedClusterSetDefault is the name of the default managed cluster set ManagedClusterSetDefault = "default" // ManagedClusterSetSpokes is the name of the spokes managed cluster set ManagedClusterSetSpokes = "spokes" // PlacementSpokes is the name of the spokes placement PlacementSpokes = "spokes" )
Topology resource names
const ( // AnnotationAddOnDeploymentConfigHash is the annotation key for storing the hash of an addon's deployment configuration. // Used to detect when the configuration changes and trigger a redeploy. AnnotationAddOnDeploymentConfigHash = "fleetconfig.open-cluster-management.io/configHash" )
FleetConfig addon annotations
const (
ReconcileSuccess = "ReconcileSuccess"
)
Hub and Spoke condition reasons
const (
// SpokeDefaultMaxConcurrentReconciles is the default maximum number of Spoke resources that may be reconciled in parallel.
SpokeDefaultMaxConcurrentReconciles = 5
)
Reconcile parameters
Variables ¶
var ( // ManagedByLabels are labeles applies to resources to denote that fleetconfig-controller is managing the lifecycle. ManagedByLabels = map[string]string{ LabelAddOnManagedBy: "fleetconfig-controller", } // ManagedBySelector is a label selector for filtering add-on resources managed fleetconfig-controller. ManagedBySelector = labels.SelectorFromSet(labels.Set(ManagedByLabels)) )
var ( // HubGroupKind is the group kind for the Hub API HubGroupKind = schema.GroupKind{Group: group, Kind: "Hub"} // SpokeGroupKind is the group kind for the Spoke API SpokeGroupKind = schema.GroupKind{Group: group, Kind: "Spoke"} // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: group, Version: "v1beta1"} // 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 )
var AllowedAddonURLSchemes = []string{"http", "https"}
AllowedAddonURLSchemes are the URL schemes which can be used to provide manifests for configuring addons.
var OCMSpokeNamespaces = []string{ NamespaceOCM, NamespaceOCMAgent, NamespaceOCMAgentAddOn, }
OCMSpokeNamespaces are the namespaces created on an OCM managed cluster.
var SupportedHubAddons = []string{ AddonArgoCD, AddonGPF, }
SupportedHubAddons are the built-in hub addons which clusteradm and fleetconfig-controller support.
var SupportedInstanceTypes = []string{ InstanceTypeManager, InstanceTypeAgent, InstanceTypeUnified, }
SupportedInstanceTypes are the valid cluster types that the controller can be installed in.
Functions ¶
This section is empty.
Types ¶
type AddOn ¶ added in v0.1.0
type AddOn struct {
// The name of the add-on being enabled. Must match one of the AddOnConfigs or HubAddOns names.
// +required
ConfigName string `json:"configName"`
// Annotations to apply to the add-on.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// DeploymentConfig provides additional configuration for the add-on deployment.
// If specified, this will be used to create an AddOnDeploymentConfig resource.
// +optional
DeploymentConfig *addonv1alpha1.AddOnDeploymentConfigSpec `json:"deploymentConfig,omitempty"`
}
AddOn enables add-on installation on the cluster.
func (*AddOn) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOn.
func (*AddOn) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddOnConfig ¶ added in v0.1.0
type AddOnConfig struct {
// The name of the add-on.
// +required
Name string `json:"name"`
// The add-on version. Optional, defaults to "v0.0.1"
// +kubebuilder:default:="v0.0.1"
// +optional
Version string `json:"version,omitempty"`
// The rolebinding to the clusterrole in the cluster namespace for the addon agent
// +optional
ClusterRoleBinding string `json:"clusterRoleBinding,omitempty"`
// Enable the agent to register to the hub cluster. Optional, defaults to false.
// +kubebuilder:default:=false
// +optional
HubRegistration bool `json:"hubRegistration,omitempty"`
// Whether to overwrite the add-on if it already exists. Optional, defaults to false.
// +kubebuilder:default:=false
// +optional
Overwrite bool `json:"overwrite,omitempty"`
}
AddOnConfig is the configuration of a custom AddOn that can be installed on a cluster.
func (*AddOnConfig) DeepCopy ¶ added in v0.1.0
func (in *AddOnConfig) DeepCopy() *AddOnConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnConfig.
func (*AddOnConfig) DeepCopyInto ¶ added in v0.1.0
func (in *AddOnConfig) DeepCopyInto(out *AddOnConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CleanupConfig ¶ added in v0.1.0
type CleanupConfig struct {
// If set, the agent will attempt to garbage collect its own namespace after the spoke cluster is unjoined.
// +kubebuilder:default:=false
// +optional
PurgeAgentNamespace bool `json:"purgeAgentNamespace,omitempty"`
// If set, the klusterlet operator will be purged and all open-cluster-management namespaces deleted
// when the klusterlet is unjoined from its Hub cluster.
// +kubebuilder:default:=true
// +optional
PurgeKlusterletOperator bool `json:"purgeKlusterletOperator,omitempty"`
// If set, the kubeconfig secret will be automatically deleted after the agent has taken over managing the Spoke.
// +kubebuilder:default:=false
// +optional
PurgeKubeconfigSecret bool `json:"purgeKubeconfigSecret,omitempty"`
// If set, all ManifestWorks which were created using a Placement will be automatically descheduled from the Spoke cluster during deletion.
// This includes AddOns installed using installStrategy.type=Placements. If an AddOn must stay running to reconcile deletion of other ManifestWorks,
// it should tolerate the `fleetconfig.open-cluster-management.io/workload-cleanup` taint.
// Manually created ManifestWorks will not be affected and must be manually cleaned up for Spoke deletion to proceed.
// +kubebuilder:default:=false
// +optional
ForceClusterDrain bool `json:"forceClusterDrain,omitempty"`
}
CleanupConfig is the configuration for cleaning up resources during Spoke cleanup.
func (*CleanupConfig) DeepCopy ¶ added in v0.1.0
func (in *CleanupConfig) DeepCopy() *CleanupConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupConfig.
func (*CleanupConfig) DeepCopyInto ¶ added in v0.1.0
func (in *CleanupConfig) DeepCopyInto(out *CleanupConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterManager ¶ added in v0.1.0
type ClusterManager struct {
// A set of comma-separated pairs of the form 'key1=value1,key2=value2' that describe feature gates for alpha/experimental features.
// Options are:
// - AddonManagement (ALPHA - default=true)
// - AllAlpha (ALPHA - default=false)
// - AllBeta (BETA - default=false)
// - CloudEventsDrivers (ALPHA - default=false)
// - DefaultClusterSet (ALPHA - default=false)
// - ManagedClusterAutoApproval (ALPHA - default=false)
// - ManifestWorkReplicaSet (ALPHA - default=false)
// - NilExecutorValidating (ALPHA - default=false)
// - ResourceCleanup (BETA - default=true)
// - V1beta1CSRAPICompatibility (ALPHA - default=false)
// +kubebuilder:default:="AddonManagement=true"
// +optional
FeatureGates string `json:"featureGates,omitempty"`
// If set, the cluster manager operator will be purged and the open-cluster-management namespace deleted
// when the FleetConfig CR is deleted.
// +kubebuilder:default:=true
// +optional
PurgeOperator bool `json:"purgeOperator,omitempty"`
// Resource specifications for all clustermanager-managed containers.
// +kubebuilder:default:={}
// +optional
Resources ResourceSpec `json:"resources,omitzero"`
// Version and image registry details for the cluster manager.
// +kubebuilder:default:={}
// +optional
Source OCMSource `json:"source,omitzero"`
// If set, the bootstrap token will used instead of a service account token.
// +optional
UseBootstrapToken bool `json:"useBootstrapToken,omitempty"`
}
ClusterManager is the configuration for a cluster manager.
func (*ClusterManager) DeepCopy ¶ added in v0.1.0
func (in *ClusterManager) DeepCopy() *ClusterManager
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterManager.
func (*ClusterManager) DeepCopyInto ¶ added in v0.1.0
func (in *ClusterManager) DeepCopyInto(out *ClusterManager)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Condition ¶ added in v0.1.0
type Condition struct {
metav1.Condition `json:",inline"`
WantStatus metav1.ConditionStatus `json:"wantStatus"`
}
Condition describes the state of a FleetConfig.
func NewCondition ¶ added in v0.1.0
func NewCondition(msg, cType string, status, wantStatus metav1.ConditionStatus) Condition
NewCondition returns a new v1beta1.Condition.
func (*Condition) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConfigMapRef ¶ added in v0.1.0
type ConfigMapRef struct {
// Name is the name of the ConfigMap
// +required
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// Key is the key under which the data is stored.
// +required
// +kubebuilder:validation:MinLength=1
Key string `json:"key"`
}
ConfigMapRef is a reference to data inside a ConfigMap, in the same namespace as the controller pod.
func (*ConfigMapRef) DeepCopy ¶ added in v0.1.0
func (in *ConfigMapRef) DeepCopy() *ConfigMapRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapRef.
func (*ConfigMapRef) DeepCopyInto ¶ added in v0.1.0
func (in *ConfigMapRef) DeepCopyInto(out *ConfigMapRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Helm ¶ added in v0.1.0
type Helm struct {
// Raw, YAML-formatted Helm values.
// +optional
Values string `json:"values,omitempty"`
// Comma-separated Helm values, e.g., key1=val1,key2=val2.
// +optional
Set []string `json:"set,omitempty"`
// Comma-separated Helm JSON values, e.g., key1=jsonval1,key2=jsonval2.
// +optional
SetJSON []string `json:"setJson,omitempty"`
// Comma-separated Helm literal STRING values.
// +optional
SetLiteral []string `json:"setLiteral,omitempty"`
// Comma-separated Helm STRING values, e.g., key1=val1,key2=val2.
// +optional
SetString []string `json:"setString,omitempty"`
}
Helm is the configuration for helm.
func (*Helm) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Helm.
func (*Helm) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Hub ¶
type Hub struct {
metav1.TypeMeta `json:",inline"`
// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
// spec defines the desired state of Hub
// +required
Spec HubSpec `json:"spec"`
// status defines the observed state of Hub
// +optional
Status HubStatus `json:"status,omitempty,omitzero"`
}
Hub is the Schema for the hubs API
func (*Hub) BaseArgs ¶ added in v0.1.0
BaseArgs returns the base arguments for all clusteradm commands.
func (*Hub) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hub.
func (*Hub) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Hub) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Hub) GetCondition ¶ added in v0.1.0
GetCondition gets the condition with the supplied type, if it exists.
func (*Hub) SetConditions ¶ added in v0.1.0
SetConditions sets the supplied conditions on a Hub, replacing any existing conditions.
type HubAddOn ¶ added in v0.1.0
type HubAddOn struct {
// Name is the name of the HubAddOn.
// +kubebuilder:validation:Enum=argocd;governance-policy-framework
// +required
Name string `json:"name"`
// The namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace.
// +optional
InstallNamespace string `json:"installNamespace,omitempty"`
// Whether or not the selected namespace should be created. If left empty, defaults to false.
// +kubebuilder:default:=false
// +optional
CreateNamespace bool `json:"createNamespace,omitempty"`
}
HubAddOn is the configuration for enabling a built-in AddOn.
func (*HubAddOn) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HubAddOn.
func (*HubAddOn) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HubList ¶
type HubList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Hub `json:"items"`
}
HubList contains a list of Hub
func (*HubList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HubList.
func (*HubList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*HubList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type HubRef ¶ added in v0.1.0
type HubRef struct {
// Name is the name of the Hub that this Spoke is managed by.
// +required
Name string `json:"name"`
// Namespace is namespace of the Hub that this Spoke is managed by.
// +required
Namespace string `json:"namespace"`
}
HubRef is the information required to get a Hub resource.
func (*HubRef) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HubRef.
func (*HubRef) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HubSpec ¶
type HubSpec struct {
// APIServer is the API server URL for the Hub cluster. If provided, spokes clusters will
// join the hub using this API server instead of the one in the bootstrap kubeconfig.
// Spoke clusters with ForceInternalEndpointLookup set to true will ignore this field.
// +optional
APIServer string `json:"apiServer,omitempty"`
// Hub cluster CA certificate, optional
// +optional
Ca string `json:"ca,omitempty"`
// ClusterManager configuration.
// +optional
ClusterManager *ClusterManager `json:"clusterManager,omitempty"`
// If true, create open-cluster-management namespace, otherwise use existing one.
// +kubebuilder:default:=true
// +optional
CreateNamespace bool `json:"createNamespace,omitempty"`
// If set, the hub will be reinitialized.
// +optional
Force bool `json:"force,omitempty"`
// Kubeconfig details for the Hub cluster.
// +required
Kubeconfig Kubeconfig `json:"kubeconfig"`
// Singleton control plane configuration. If provided, deploy a singleton control plane instead of clustermanager.
// This is an alpha stage flag.
// +optional
SingletonControlPlane *SingletonControlPlane `json:"singleton,omitempty"`
// +kubebuilder:default:={}
// +optional
RegistrationAuth RegistrationAuth `json:"registrationAuth,omitzero"`
// +optional
AddOnConfigs []AddOnConfig `json:"addOnConfigs,omitempty"`
// +optional
HubAddOns []HubAddOn `json:"hubAddOns,omitempty"`
// Timeout is the timeout in seconds for all clusteradm operations, including init, accept, join, upgrade, etc.
// +kubebuilder:default:=300
// +optional
Timeout int `json:"timeout,omitempty"`
// LogVerbosity is the verbosity of the logs.
// +kubebuilder:validation:Enum=0;1;2;3;4;5;6;7;8;9;10
// +kubebuilder:default:=0
// +optional
LogVerbosity int `json:"logVerbosity,omitempty"`
}
HubSpec defines the desired state of Hub
func (*HubSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HubSpec.
func (*HubSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HubStatus ¶
type HubStatus struct {
// Phase is the current phase of the Hub reconcile.
Phase string `json:"phase,omitempty"`
// Conditions are the current conditions of the Hub.
Conditions []Condition `json:"conditions,omitempty"`
InstalledHubAddOns []InstalledHubAddOn `json:"installedHubAddOns,omitempty"`
}
HubStatus defines the observed state of Hub.
func (*HubStatus) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HubStatus.
func (*HubStatus) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*HubStatus) GetCondition ¶ added in v0.1.0
GetCondition returns the condition with the supplied type, if it exists.
func (*HubStatus) SetConditions ¶ added in v0.1.0
SetConditions sets the supplied conditions, adding net-new conditions and replacing any existing conditions of the same type. This is a no-op if all supplied conditions are identical (ignoring the last transition time) to those already set. If cover is false, existing conditions are not replaced.
type InstalledHubAddOn ¶ added in v0.1.0
type InstalledHubAddOn struct {
// BundleVersion is the bundle version used when installing the addon.
BundleVersion string `json:"bundleVersion"`
// Name is the name of the addon.
Name string `json:"name"`
// Namespace is the namespace that the addon was installed into.
Namespace string `json:"namespace,omitempty"`
}
InstalledHubAddOn tracks metadata for each hubAddon that is successfully installed on the hub.
func (*InstalledHubAddOn) DeepCopy ¶ added in v0.1.0
func (in *InstalledHubAddOn) DeepCopy() *InstalledHubAddOn
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstalledHubAddOn.
func (*InstalledHubAddOn) DeepCopyInto ¶ added in v0.1.0
func (in *InstalledHubAddOn) DeepCopyInto(out *InstalledHubAddOn)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Klusterlet ¶ added in v0.1.0
type Klusterlet struct {
// Annotations to apply to the spoke cluster. If not present, the 'agent.open-cluster-management.io/' prefix is added to each key.
// Each annotation is added to klusterlet.spec.registrationConfiguration.clusterAnnotations on the spoke and subsequently to the ManagedCluster on the hub.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
// A set of comma-separated pairs of the form 'key1=value1,key2=value2' that describe feature gates for alpha/experimental features.
// Options are:
// - AddonManagement (ALPHA - default=true)
// - AllAlpha (ALPHA - default=false)
// - AllBeta (BETA - default=false)
// - ClusterClaim (ALPHA - default=true)
// - ExecutorValidatingCaches (ALPHA - default=false)
// - RawFeedbackJsonString (ALPHA - default=false)
// - V1beta1CSRAPICompatibility (ALPHA - default=false)
// +kubebuilder:default:="AddonManagement=true,ClusterClaim=true"
// +optional
FeatureGates string `json:"featureGates,omitempty"`
// Deployent mode for klusterlet
// +kubebuilder:validation:Enum=Default;Hosted
// +kubebuilder:default:="Default"
// +optional
Mode string `json:"mode,omitempty"`
// If true, the installed klusterlet agent will start the cluster registration process by looking for the
// internal endpoint from the public cluster-info in the Hub cluster instead of using hubApiServer.
// +optional
ForceInternalEndpointLookup bool `json:"forceInternalEndpointLookup,omitempty"`
// External managed cluster kubeconfig, required if using hosted mode.
// +optional
ManagedClusterKubeconfig Kubeconfig `json:"managedClusterKubeconfig,omitzero"`
// If true, the klusterlet accesses the managed cluster using the internal endpoint from the public
// cluster-info in the managed cluster instead of using managedClusterKubeconfig.
// +optional
ForceInternalEndpointLookupManaged bool `json:"forceInternalEndpointLookupManaged,omitempty"`
// Resource specifications for all klusterlet-managed containers.
// +kubebuilder:default:={}
// +optional
Resources ResourceSpec `json:"resources,omitzero"`
// If true, deploy klusterlet in singleton mode, with registration and work agents running in a single pod.
// This is an alpha stage flag.
// +optional
Singleton bool `json:"singleton,omitempty"`
// ValuesFrom is an optional reference to a ConfigMap containing values for the klusterlet Helm chart.
// optional
ValuesFrom *ConfigMapRef `json:"valuesFrom,omitempty"`
// Values for the klusterlet Helm chart. Values defined here override values which are defined in ValuesFrom.
// +optional
Values *KlusterletChartConfig `json:"values,omitempty"`
}
Klusterlet is the configuration for a klusterlet.
func (*Klusterlet) DeepCopy ¶ added in v0.1.0
func (in *Klusterlet) DeepCopy() *Klusterlet
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Klusterlet.
func (*Klusterlet) DeepCopyInto ¶ added in v0.1.0
func (in *Klusterlet) DeepCopyInto(out *Klusterlet)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KlusterletChartConfig ¶ added in v0.1.0
type KlusterletChartConfig struct {
chart.KlusterletChartConfig `json:",inline"`
}
KlusterletChartConfig is a wrapper around the external chart.KlusterletChartConfig to provide the required DeepCopy methods for code generation.
func (*KlusterletChartConfig) DeepCopy ¶ added in v0.1.0
func (k *KlusterletChartConfig) DeepCopy() *KlusterletChartConfig
DeepCopy returns a deep copy of the KlusterletChartConfig.
func (*KlusterletChartConfig) DeepCopyInto ¶ added in v0.1.0
func (k *KlusterletChartConfig) DeepCopyInto(out *KlusterletChartConfig)
DeepCopyInto copies all properties of this object into another object of the same type that is provided as a pointer.
func (*KlusterletChartConfig) IsEmpty ¶ added in v0.1.0
func (k *KlusterletChartConfig) IsEmpty() bool
IsEmpty checks if the KlusterletChartConfig is empty/default/zero-valued
type Kubeconfig ¶ added in v0.1.0
type Kubeconfig struct {
// A reference to an existing secret containing a kubeconfig.
// Must be provided for remote clusters.
// For same-cluster, must be provided unless InCluster is set to true.
// +optional
SecretReference *SecretReference `json:"secretReference,omitempty"`
// If set, the kubeconfig will be read from the cluster.
// Only applicable for same-cluster operations.
// Defaults to false.
// +optional
InCluster bool `json:"inCluster,omitempty"`
// The context to use in the kubeconfig file.
// +optional
Context string `json:"context,omitempty"`
}
Kubeconfig is the configuration for a kubeconfig.
func (*Kubeconfig) DeepCopy ¶ added in v0.1.0
func (in *Kubeconfig) DeepCopy() *Kubeconfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kubeconfig.
func (*Kubeconfig) DeepCopyInto ¶ added in v0.1.0
func (in *Kubeconfig) DeepCopyInto(out *Kubeconfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedClusterType ¶ added in v0.1.0
type ManagedClusterType string
ManagedClusterType is the type of a managed cluster.
type OCMSource ¶ added in v0.1.0
type OCMSource struct {
// The version of predefined compatible image versions (e.g. v0.6.0). Defaults to the latest released version.
// You can also set "latest" to install the latest development version.
// +kubebuilder:default:="default"
// +optional
BundleVersion string `json:"bundleVersion,omitempty"`
// The name of the image registry serving OCM images, which will be used for all OCM components."
// +kubebuilder:default:="quay.io/open-cluster-management"
// +optional
Registry string `json:"registry,omitempty"`
}
OCMSource is the configuration for an OCM source.
func (*OCMSource) DeepCopy ¶ added in v0.1.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCMSource.
func (*OCMSource) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RegistrationAuth ¶ added in v0.1.0
type RegistrationAuth struct {
// The registration authentication driver to use.
// Options are:
// - csr: Use the default CSR-based registration authentication.
// - awsirsa: Use AWS IAM Role for Service Accounts (IRSA) registration authentication.
// The set of valid options is open for extension.
// +kubebuilder:validation:Enum=csr;awsirsa
// +kubebuilder:default:="csr"
// +optional
Driver string `json:"driver,omitempty"`
// The Hub cluster ARN for awsirsa registration authentication. Required when Type is awsirsa, otherwise ignored.
// +optional
HubClusterARN string `json:"hubClusterARN,omitempty"`
// List of AWS EKS ARN patterns so any EKS clusters with these patterns will be auto accepted to join with hub cluster.
// Example pattern: "arn:aws:eks:us-west-2:123456789013:cluster/.*"
// +optional
AutoApprovedARNPatterns []string `json:"autoApprovedARNPatterns,omitempty"`
}
RegistrationAuth provides specifications for registration authentication.
func (*RegistrationAuth) DeepCopy ¶ added in v0.1.0
func (in *RegistrationAuth) DeepCopy() *RegistrationAuth
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrationAuth.
func (*RegistrationAuth) DeepCopyInto ¶ added in v0.1.0
func (in *RegistrationAuth) DeepCopyInto(out *RegistrationAuth)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSpec ¶ added in v0.1.0
type ResourceSpec struct {
// The resource limits of all the containers managed by the Cluster Manager or Klusterlet operators.
// +optional
Limits *ResourceValues `json:"limits,omitempty"`
// The resource requests of all the containers managed by the Cluster Manager or Klusterlet operators.
// +optional
Requests *ResourceValues `json:"requests,omitempty"`
// The resource QoS class of all the containers managed by the Cluster Manager or Klusterlet operators.
// One of Default, BestEffort or ResourceRequirement.
// +kubebuilder:validation:Enum=Default;BestEffort;ResourceRequirement
// +kubebuilder:default:="Default"
// +optional
QosClass string `json:"qosClass,omitempty"`
}
ResourceSpec defines resource limits and requests for all managed clusters.
func (*ResourceSpec) DeepCopy ¶ added in v0.1.0
func (in *ResourceSpec) DeepCopy() *ResourceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.
func (*ResourceSpec) DeepCopyInto ¶ added in v0.1.0
func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ResourceSpec) GetLimits ¶ added in v0.1.0
func (r ResourceSpec) GetLimits() args.ResourceValues
GetLimits returns the resource limits.
func (ResourceSpec) GetQosClass ¶ added in v0.1.0
func (r ResourceSpec) GetQosClass() string
GetQosClass returns the QoS class.
func (ResourceSpec) GetRequests ¶ added in v0.1.0
func (r ResourceSpec) GetRequests() args.ResourceValues
GetRequests returns the resource requests.
type ResourceValues ¶ added in v0.1.0
type ResourceValues struct {
// The number of CPU units to request, e.g., '800m'.
// +optional
CPU string `json:"cpu,omitempty"`
// The amount of memory to request, e.g., '8Gi'.
// +optional
Memory string `json:"memory,omitempty"`
}
ResourceValues detail container resource constraints.
func (*ResourceValues) DeepCopy ¶ added in v0.1.0
func (in *ResourceValues) DeepCopy() *ResourceValues
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceValues.
func (*ResourceValues) DeepCopyInto ¶ added in v0.1.0
func (in *ResourceValues) DeepCopyInto(out *ResourceValues)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceValues) String ¶ added in v0.1.0
func (r *ResourceValues) String() string
String returns a string representation of the resource values.
type SecretReference ¶ added in v0.1.0
type SecretReference struct {
// The name of the secret.
// +required
Name string `json:"name"`
// The map key to access the kubeconfig. Defaults to 'kubeconfig'.
// +kubebuilder:default:="kubeconfig"
// +optional
KubeconfigKey string `json:"kubeconfigKey,omitempty"`
}
SecretReference describes how to retrieve a kubeconfig stored as a secret in the same namespace as the resource.
func (*SecretReference) DeepCopy ¶ added in v0.1.0
func (in *SecretReference) DeepCopy() *SecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretReference.
func (*SecretReference) DeepCopyInto ¶ added in v0.1.0
func (in *SecretReference) DeepCopyInto(out *SecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SingletonControlPlane ¶ added in v0.1.0
type SingletonControlPlane struct {
// The name of the singleton control plane.
// +kubebuilder:default:="singleton-controlplane"
// +optional
Name string `json:"name,omitempty"`
// Helm configuration for the multicluster-controlplane Helm chart.
// For now https://open-cluster-management.io/helm-charts/ocm/multicluster-controlplane is always used - no private registry support.
// See: https://github.com/open-cluster-management-io/multicluster-controlplane/blob/main/charts/multicluster-controlplane/values.yaml
// +optional
Helm *Helm `json:"helm,omitempty"`
}
SingletonControlPlane is the configuration for a singleton control plane
func (*SingletonControlPlane) DeepCopy ¶ added in v0.1.0
func (in *SingletonControlPlane) DeepCopy() *SingletonControlPlane
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingletonControlPlane.
func (*SingletonControlPlane) DeepCopyInto ¶ added in v0.1.0
func (in *SingletonControlPlane) DeepCopyInto(out *SingletonControlPlane)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Spoke ¶
type Spoke struct {
metav1.TypeMeta `json:",inline"`
// metadata is a standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`
// spec defines the desired state of Spoke
// +required
Spec SpokeSpec `json:"spec"`
// status defines the observed state of Spoke
// +optional
Status SpokeStatus `json:"status,omitempty,omitzero"`
}
Spoke is the Schema for the spokes API
func (*Spoke) BaseArgs ¶ added in v0.1.0
BaseArgs returns the base arguments for all clusteradm commands.
func (*Spoke) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spoke.
func (*Spoke) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Spoke) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Spoke) GetCondition ¶ added in v0.1.0
GetCondition gets the condition with the supplied type, if it exists.
func (*Spoke) IsHubAsSpoke ¶ added in v0.1.0
IsHubAsSpoke returns true if the cluster is a hub-as-spoke. Determined either by name `hub-as-spoke` or an InCluster kubeconfig
func (*Spoke) IsManagedBy ¶ added in v0.1.0
func (s *Spoke) IsManagedBy(om metav1.ObjectMeta) bool
IsManagedBy checks whether or not the Spoke is managed by a particular Hub.
func (*Spoke) PivotComplete ¶ added in v0.1.0
PivotComplete return true if the spoke's agent has successfully started managing day 2 operations.
func (*Spoke) SetConditions ¶ added in v0.1.0
SetConditions sets the supplied conditions on a Spoke, replacing any existing conditions.
type SpokeList ¶
type SpokeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Spoke `json:"items"`
}
SpokeList contains a list of Spoke
func (*SpokeList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeList.
func (*SpokeList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SpokeList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SpokeSpec ¶
type SpokeSpec struct {
// If true, create open-cluster-management namespace and agent namespace (open-cluster-management-agent for Default mode,
// <klusterlet-name> for Hosted mode), otherwise use existing one.
// +kubebuilder:default:=true
// +optional
CreateNamespace bool `json:"createNamespace,omitempty"`
// HubRef is a reference to the Hub that this Spoke is managed by.
// +required
HubRef HubRef `json:"hubRef"`
// If true, sync the labels from klusterlet to all agent resources.
// +optional
SyncLabels bool `json:"syncLabels,omitempty"`
// Kubeconfig details for the Spoke cluster.
// +required
Kubeconfig Kubeconfig `json:"kubeconfig"`
// Proxy CA certificate, optional
// +optional
ProxyCa string `json:"proxyCa,omitempty"`
// URL of a forward proxy server used by agents to connect to the Hub cluster.
// +optional
ProxyURL string `json:"proxyUrl,omitempty"`
// Klusterlet configuration.
// +kubebuilder:default:={}
// +optional
Klusterlet Klusterlet `json:"klusterlet,omitzero"`
// ClusterARN is the ARN of the spoke cluster.
// This field is optionally used for AWS IRSA registration authentication.
// +optional
ClusterARN string `json:"clusterARN,omitempty"`
// AddOns are the add-ons to enable for the spoke cluster.
// +optional
AddOns []AddOn `json:"addOns,omitempty"`
// Timeout is the timeout in seconds for all clusteradm operations, including init, accept, join, upgrade, etc.
// If not set, defaults to the Hub's timeout.
// +kubebuilder:default:=300
// +optional
Timeout int `json:"timeout,omitempty"`
// LogVerbosity is the verbosity of the logs.
// If not set, defaults to the Hub's logVerbosity.
// +kubebuilder:validation:Enum=0;1;2;3;4;5;6;7;8;9;10
// +kubebuilder:default:=0
// +optional
LogVerbosity int `json:"logVerbosity,omitempty"`
// CleanupConfig is used to configure which resources should be automatically garbage collected during cleanup.
// +kubebuilder:default:={}
// +required
CleanupConfig CleanupConfig `json:"cleanupConfig"`
}
SpokeSpec defines the desired state of Spoke
func (*SpokeSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeSpec.
func (*SpokeSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SpokeStatus ¶
type SpokeStatus struct {
// Phase is the current phase of the Spoke reconcile.
Phase string `json:"phase,omitempty"`
// Conditions are the current conditions of the Spoke.
Conditions []Condition `json:"conditions,omitempty"`
// EnabledAddons is the list of addons that are currently enabled on the Spoke.
// +kubebuilder:default:={}
// +optional
EnabledAddons []string `json:"enabledAddons,omitempty"`
// KlusterletHash is a hash of the Spoke's .spec.klusterlet.values.
// +kubebuilder:default:=""
// +optional
KlusterletHash string `json:"klusterletHash,omitempty"`
}
SpokeStatus defines the observed state of Spoke.
func (*SpokeStatus) DeepCopy ¶
func (in *SpokeStatus) DeepCopy() *SpokeStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeStatus.
func (*SpokeStatus) DeepCopyInto ¶
func (in *SpokeStatus) DeepCopyInto(out *SpokeStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SpokeStatus) GetCondition ¶ added in v0.1.0
func (s *SpokeStatus) GetCondition(cType string) *Condition
GetCondition returns the condition with the supplied type, if it exists.
func (*SpokeStatus) SetConditions ¶ added in v0.1.0
func (s *SpokeStatus) SetConditions(cover bool, c ...Condition)
SetConditions sets the supplied conditions, adding net-new conditions and replacing any existing conditions of the same type. This is a no-op if all supplied conditions are identical (ignoring the last transition time) to those already set. If cover is false, existing conditions are not replaced.