53 lines
1.6 KiB
Go
53 lines
1.6 KiB
Go
package node
|
|
|
|
import (
|
|
"context"
|
|
|
|
monov1alpha1 "undecided.project/monok8s/pkg/apis/monok8s/v1alpha1"
|
|
"undecided.project/monok8s/pkg/system"
|
|
)
|
|
|
|
type Step func(context.Context, *NodeContext) error
|
|
|
|
type NodeContext struct {
|
|
Config *monov1alpha1.MonoKSConfig
|
|
SystemRunner *system.Runner
|
|
LocalClusterState *LocalClusterState
|
|
BootstrapState *BootstrapState
|
|
}
|
|
|
|
type LocalMembershipKind string
|
|
|
|
const (
|
|
LocalMembershipFresh LocalMembershipKind = "fresh"
|
|
LocalMembershipExistingWorker LocalMembershipKind = "existing-worker"
|
|
LocalMembershipExistingControlPlane LocalMembershipKind = "existing-control-plane"
|
|
LocalMembershipPartial LocalMembershipKind = "partial"
|
|
)
|
|
|
|
type LocalClusterState struct {
|
|
HasAdminKubeconfig bool
|
|
HasKubeletKubeconfig bool
|
|
MembershipKind LocalMembershipKind
|
|
}
|
|
|
|
type BootstrapAction string
|
|
|
|
const (
|
|
BootstrapActionInitControlPlane BootstrapAction = "init-control-plane"
|
|
BootstrapActionJoinWorker BootstrapAction = "join-worker"
|
|
BootstrapActionJoinControlPlane BootstrapAction = "join-control-plane"
|
|
BootstrapActionReconcileWorker BootstrapAction = "reconcile-worker"
|
|
BootstrapActionReconcileControlPlane BootstrapAction = "reconcile-control-plane"
|
|
BootstrapActionUpgradeWorker BootstrapAction = "upgrade-worker"
|
|
BootstrapActionUpgradeControlPlane BootstrapAction = "upgrade-control-plane"
|
|
)
|
|
|
|
type BootstrapState struct {
|
|
Action BootstrapAction
|
|
DetectedClusterVersion string
|
|
|
|
UnsupportedWorkerVersionSkew bool
|
|
VersionSkewReason string
|
|
}
|