Documentation ¶
Index ¶
- Constants
- type ClusterDefConfig
- type ClusterDefReconciler
- func (r *ClusterDefReconciler) ApplyData(ctx context.Context, env *Env, resource string, data []byte, ...) error
- func (r *ClusterDefReconciler) ApplyFile(ctx context.Context, env *Env, url string, cache *ClusterDefStateCache) error
- func (r *ClusterDefReconciler) MapClusterToClusterDef(cluster client.Object) []reconcile.Request
- func (r *ClusterDefReconciler) MapObjectToClusterDef(object client.Object) []reconcile.Request
- func (r *ClusterDefReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ClusterDefReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *ClusterDefReconciler) StoreTargetClusterInfo(ctx context.Context, cache *ClusterDefStateCache, ...) error
- func (r *ClusterDefReconciler) UpdateArgoCDConfig(ctx context.Context, cache *ClusterDefStateCache, log logr.Logger) error
- func (r *ClusterDefReconciler) UpdatePivotStatus(nsName types.NamespacedName, pivotStatus gitopsv1.PivotState) error
- func (r *ClusterDefReconciler) UpdateStatus(nsName types.NamespacedName, phase gitopsv1.ClusterDefState, cpVersion string, ...) error
- type ClusterDefStateCache
- type Env
- type TransientState
Constants ¶
const ( ANNOTATION = "clusterdef.kanod.io/progression" TIMEOUT = 3600 )
const CAPI_VERSION = "v1beta1"
const LocalK8sApiServer = "https://kubernetes.default.svc"
LocalK8sApiServer is the address of the API server got the local cluster
const MilliResyncPeriod = 10000
MilliResyncPeriod is the duration between two synchronization attempt of a given resource
const PivotMilliResyncPeriod = 5000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterDefConfig ¶
type ClusterDefConfig struct { ArgoCDNamespace string ClusterFileName string PluginName string InfraNamespace string KanodOperatorCrd string MilliResyncPeriod int }
ClusterDefConfig contains global parameters of the ClusterDef operator. Typical operators are the location and credentials of the snapshot repository, location of base cluster models and infrastructure parameters.
func MakeConfig ¶ added in v0.7.0
func MakeConfig() *ClusterDefConfig
MakeConfig initializes the global configuration of the controller
type ClusterDefReconciler ¶
type ClusterDefReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Config *ClusterDefConfig State map[string]*ClusterDefStateCache }
ClusterDefReconciler reconciles a ClusterDef object
func (*ClusterDefReconciler) ApplyData ¶ added in v0.8.0
func (r *ClusterDefReconciler) ApplyData(ctx context.Context, env *Env, resource string, data []byte, cache *ClusterDefStateCache) error
func (*ClusterDefReconciler) ApplyFile ¶ added in v0.8.0
func (r *ClusterDefReconciler) ApplyFile(ctx context.Context, env *Env, url string, cache *ClusterDefStateCache) error
func (*ClusterDefReconciler) MapClusterToClusterDef ¶ added in v0.7.0
func (r *ClusterDefReconciler) MapClusterToClusterDef(cluster client.Object) []reconcile.Request
MapObjectToClusterDef associates the ClusterDef that triggered the creation of the cluster given as object
func (*ClusterDefReconciler) MapObjectToClusterDef ¶ added in v0.7.2
func (r *ClusterDefReconciler) MapObjectToClusterDef(object client.Object) []reconcile.Request
MapObjectToClusterDef associates the ClusterDef that triggered the creation of the cluster that owns this object.
func (*ClusterDefReconciler) Reconcile ¶
func (r *ClusterDefReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile implements the core logic
func (*ClusterDefReconciler) SetupWithManager ¶
func (r *ClusterDefReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller for ClusterDef
func (*ClusterDefReconciler) StoreTargetClusterInfo ¶ added in v0.8.0
func (r *ClusterDefReconciler) StoreTargetClusterInfo( ctx context.Context, cache *ClusterDefStateCache, cdefName *types.NamespacedName, log logr.Logger, ) error
func (*ClusterDefReconciler) UpdateArgoCDConfig ¶ added in v0.8.0
func (r *ClusterDefReconciler) UpdateArgoCDConfig( ctx context.Context, cache *ClusterDefStateCache, log logr.Logger, ) error
Create in the cluster the secret for ArgoCD
func (*ClusterDefReconciler) UpdatePivotStatus ¶ added in v0.8.0
func (r *ClusterDefReconciler) UpdatePivotStatus( nsName types.NamespacedName, pivotStatus gitopsv1.PivotState, ) error
UpdateConditions method update the status of a clusterDef resource
func (*ClusterDefReconciler) UpdateStatus ¶ added in v0.7.2
func (r *ClusterDefReconciler) UpdateStatus( nsName types.NamespacedName, phase gitopsv1.ClusterDefState, cpVersion string, versions []string, pivotStatus gitopsv1.PivotState, ) error
UpdateConditions method update the status of a clusterDef resource
type ClusterDefStateCache ¶
type ClusterDefStateCache struct { // ClusterName is the name of target cluster-api definition ClusterName string // ClusterNamespace is the namespace of target cluster-api definition ClusterNamespace string // Kubeconfig is the config of target Kubeconfig *clientapi.Config // ServerURL is the cached URL of the workload cluster API endpoint ServerURL string // TargetClient is a kubernetes client for the target (workload) cluster TargetClient *clientgo.Clientset // isClusterPivoted IsClusterPivoted bool // isClusterReady IsClusterReady bool // PivotStatus PivotStatus gitopsv1.PivotState }
type TransientState ¶
type TransientState int
TransientState is the state of reconciler during the pivoting process
const ( // TSNotPivoted TSNotPivoted TransientState = iota // TSStoreTargetClusterInfo TSStoreTargetClusterInfo // TSUndeployLocalIronic TSUndeployLocalIronic // TSCheckIronicIsUndeployed TSCheckIronicIsUndeployed // TSInstallKanodOperator TSInstallKanodOperator // TSWaitForKanodOperator TSWaitForKanodOperator // TSMoveKanod TSMoveKanod // TSWaitForStackDeployed TSWaitForStackDeployed // TSDeleteArgoCdApp TSDeleteArgoCdApp // TSLabelResources TSLabelResources // TSPauseBaremetalpool TSPauseBaremetalpool // TSPauseNetwork TSPauseNetwork // TSPivotResources TSPivotResources // TSUnlabelResources TSUnlabelResources // TSPivotBmpResources TSPivotBmpResources // TSPivotNetworkResources TSPivotNetworkResources // TSActivateBaremetalpool TSActivateBaremetalpool // TSActivateNetwork TSActivateNetwork // TSRedeployLocalIronic TSRedeployLocalIronic // TSCheckIronicIsdeployed TSCheckIronicIsdeployed // TSConfigureArgoApp TSConfigureArgoApp // ClusterPivoted TSClusterPivoted )