Documentation
¶
Index ¶
- Constants
- type AttachedClusterController
- type ClusterController
- type ClusterInfo
- type ConfigTemplateContent
- type CustomClusterController
- func (r *CustomClusterController) ClusterToCustomClusterMapFunc(o client.Object) []ctrl.Request
- func (r *CustomClusterController) CreateClusterConfig(ctx context.Context, c *clusterv1.Cluster, ...) (*corev1.ConfigMap, error)
- func (r *CustomClusterController) CreateClusterHosts(ctx context.Context, customMachine *v1alpha1.CustomMachine, ...) (*corev1.ConfigMap, error)
- func (r *CustomClusterController) CreateConfigMapWithTemplate(ctx context.Context, name, namespace, fileName, configMapData string) (*corev1.ConfigMap, error)
- func (r *CustomClusterController) CustomMachineToCustomClusterMapFunc(o client.Object) []ctrl.Request
- func (r *CustomClusterController) KcpToCustomClusterMapFunc(o client.Object) []ctrl.Request
- func (r *CustomClusterController) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *CustomClusterController) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
- func (r *CustomClusterController) WorkerToCustomClusterMapFunc(o client.Object) []ctrl.Request
- type CustomMachineController
- type HostTemplateContent
- type NodeInfo
Constants ¶
const ( // ClusterFinalizer allows ClusterController to clean up associated resources before removing it from apiserver. ClusterFinalizer = "cluster.cluster.kurator.dev" KindCluster = "Cluster" )
const ( ClusterHostsName = "cluster-hosts" ClusterConfigName = "cluster-config" SecreteName = "cluster-secret" ProvisionedKubeConfigPath = "/etc/kubernetes/admin.conf" ClusterKind = "Cluster" CustomClusterKind = "CustomCluster" ManageActionLabel = "customcluster.kurator.dev/action" KubesprayCMDPrefix = "ansible-playbook -i inventory/" + ClusterHostsName + " --private-key /root/.ssh/ssh-privatekey " CustomClusterInitAction customClusterManageAction = "init" KubesprayInitCMD customClusterManageCMD = KubesprayCMDPrefix + "cluster.yml -vvv " CustomClusterTerminateAction customClusterManageAction = "terminate" KubesprayTerminateCMD customClusterManageCMD = KubesprayCMDPrefix + "reset.yml -vvv -e reset_confirmation=yes" CustomClusterScaleUpAction customClusterManageAction = "scale-up" KubesprayScaleUpCMD customClusterManageCMD = KubesprayCMDPrefix + "scale.yml -vvv " CustomClusterScaleDownAction customClusterManageAction = "scale-down" KubesprayScaleDownCMDPrefix customClusterManageCMD = KubesprayCMDPrefix + "remove-node.yml -vvv -e skip_confirmation=yes" CustomClusterUpgradeAction customClusterManageAction = "upgrade" KubesprayUpgradeCMDPrefix customClusterManageCMD = KubesprayCMDPrefix + "upgrade-cluster.yml -vvv " // CustomClusterFinalizer is the finalizer applied to crd. CustomClusterFinalizer = "customcluster.cluster.kurator.dev" // custom configmap finalizer requires at least one slash. CustomClusterConfigMapFinalizer = CustomClusterFinalizer + "/configmap" // KubeVersionPrefix is the prefix string of version of kubernetes KubeVersionPrefix = "kube_version: " )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachedClusterController ¶
type AttachedClusterController struct { client.Client APIReader client.Reader Scheme *runtime.Scheme }
AttachedClusterController reconciles a AttachedCluster object
func (*AttachedClusterController) SetupWithManager ¶
func (a *AttachedClusterController) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager sets up the controller with the Manager.
type ClusterController ¶
ClusterController reconciles a Cluster object
func (*ClusterController) SecretToClusterFunc ¶
func (r *ClusterController) SecretToClusterFunc(o client.Object) []ctrl.Request
func (*ClusterController) SetupWithManager ¶
func (r *ClusterController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ClusterInfo ¶
ClusterInfo represents the information of the cluster on VMs.
type ConfigTemplateContent ¶
type ConfigTemplateContent struct { KubeVersion string // The default value is 10.233.0.0/18, must be unused block of space. ServiceCIDR string // The default value is 10.233.64.0/18, must be unused in your network infrastructure. PodCIDR string // CNIType is the CNI plugin of the cluster on VMs. The default plugin is calico and can be ["calico", "cilium", "canal", "flannel"] CNIType string // ControlPlaneConfigAddress same as `ControlPlaneEndpoint`. ControlPlaneAddress string // ControlPlaneCertSANs sets extra Subject Alternative Names for the API Server signing cert. ControlPlaneCertSANs string ClusterName string DnsDomain string KubeImageRepo string // FeatureGates is a map that stores the names and boolean values of Kubernetes feature gates. // The keys of the map are the names of the feature gates, and the values are boolean values that indicate whether // the feature gate is enabled (true) or disabled (false). FeatureGates map[string]bool // LoadBalancerDomainName is a variable used to set the endpoint for a Kubernetes cluster when a load balancer is enabled. LoadBalancerDomainName string }
func GetConfigContent ¶
func GetConfigContent(c *clusterv1.Cluster, kcp *controlplanev1.KubeadmControlPlane, cc *v1alpha1.CustomCluster) *ConfigTemplateContent
type CustomClusterController ¶
type CustomClusterController struct { client.Client APIReader client.Reader Scheme *runtime.Scheme }
CustomClusterController reconciles a CustomCluster object.
func (*CustomClusterController) ClusterToCustomClusterMapFunc ¶
func (r *CustomClusterController) ClusterToCustomClusterMapFunc(o client.Object) []ctrl.Request
func (*CustomClusterController) CreateClusterConfig ¶
func (r *CustomClusterController) CreateClusterConfig(ctx context.Context, c *clusterv1.Cluster, kcp *controlplanev1.KubeadmControlPlane, cc *v1alpha1.CustomCluster) (*corev1.ConfigMap, error)
func (*CustomClusterController) CreateClusterHosts ¶
func (r *CustomClusterController) CreateClusterHosts(ctx context.Context, customMachine *v1alpha1.CustomMachine, customCluster *v1alpha1.CustomCluster) (*corev1.ConfigMap, error)
func (*CustomClusterController) CreateConfigMapWithTemplate ¶
func (*CustomClusterController) CustomMachineToCustomClusterMapFunc ¶
func (r *CustomClusterController) CustomMachineToCustomClusterMapFunc(o client.Object) []ctrl.Request
func (*CustomClusterController) KcpToCustomClusterMapFunc ¶
func (r *CustomClusterController) KcpToCustomClusterMapFunc(o client.Object) []ctrl.Request
func (*CustomClusterController) Reconcile ¶
func (r *CustomClusterController) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*CustomClusterController) SetupWithManager ¶
func (r *CustomClusterController) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager sets up the controller with the Manager.
func (*CustomClusterController) WorkerToCustomClusterMapFunc ¶
func (r *CustomClusterController) WorkerToCustomClusterMapFunc(o client.Object) []ctrl.Request
type CustomMachineController ¶
type CustomMachineController struct { client.Client APIReader client.Reader Scheme *runtime.Scheme // contains filtered or unexported fields }
CustomMachineController reconciles a CustomMachine object
func (*CustomMachineController) SetupWithManager ¶
func (r *CustomMachineController) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager sets up the controller with the Manager.
type HostTemplateContent ¶
type HostTemplateContent struct { NodeAndIP []string MasterName []string NodeName []string EtcdNodeName []string // default: NodeName + MasterName }
func GetHostsContent ¶
func GetHostsContent(customMachine *v1alpha1.CustomMachine) *HostTemplateContent
type NodeInfo ¶
type NodeInfo struct { // NodeName, also called as HostName, is the unique identifier that distinguishes it from other nodes under the same cluster. kubespray uses the Hostname as the parameter to delete the node. NodeName string PublicIP string PrivateIP string }
NodeInfo represents the information of the node on VMs.