kubeadm

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderKubeadm = "kubeadm"

Variables

This section is empty.

Functions

func NewKubeClient

func NewKubeClient(config runtime.RawExtension) (*kubernetes.Clientset, error)

func NewKubeadm

func NewKubeadm(operator clustermanage.Operator, provider v1.CloudProvider) (clustermanage.CloudProvider, error)

Types

type APIServer

type APIServer struct {
	// CertSANs sets extra Subject Alternative Names for the API Server signing cert.
	CertSANs []string `yaml:"certSANs,omitempty"`
}

type ClusterConfiguration

type ClusterConfiguration struct {
	Kind string `yaml:"kind,omitempty"`

	// Etcd holds configuration for etcd.
	Etcd KubeEtcd `yaml:"etcd,omitempty"`

	// Networking holds configuration for the networking topology of the cluster.
	Networking Network `yaml:"networking,omitempty"`

	// KubernetesVersion is the target version of the control plane.
	KubernetesVersion string `yaml:"kubernetesVersion,omitempty"`

	// APIServer contains extra settings for the API server control plane component
	APIServer APIServer `yaml:"apiServer,omitempty"`

	// ImageRepository sets the container registry to pull images from.
	ImageRepository string `yaml:"imageRepository,omitempty"`

	// The cluster name
	ClusterName string `yaml:"clusterName,omitempty"`
}

type Config

type Config struct {
	// APIEndpoint kubeadm apiServer address
	APIEndpoint string `json:"apiEndpoint,omitempty"`
	KubeConfig  string `json:"kubeConfig"`
	ClusterName string `json:"clusterName"`
}

func ParseConf

func ParseConf(config runtime.RawExtension) (*Config, error)

type KubeEtcd

type KubeEtcd struct {
	// Local provides configuration knobs for configuring the local etcd instance
	// Local and External are mutually exclusive
	Local *LocalEtcd `yaml:"local,omitempty"`
}

type KubeNode

type KubeNode struct {
	// contains filtered or unexported fields
}

type Kubeadm

type Kubeadm struct {
	Operator  clustermanage.Operator
	Provider  v1.CloudProvider
	Config    Config
	Clientset kubernetes.Clientset
}

func (*Kubeadm) Cleanup

func (r *Kubeadm) Cleanup(ctx context.Context) error

Cleanup clean provider's all cluster & node in kc.

1.list kc clusters 2.drain cluster's node 3.delete cluster

func (*Kubeadm) ClusterType

func (r *Kubeadm) ClusterType() string

ClusterType get cluster type

func (*Kubeadm) GetCertification

func (r *Kubeadm) GetCertification(ctx context.Context, clusterName string) ([]v1.Certification, error)

GetCertification get it by kc's own kubeadm method, without any processing here

func (*Kubeadm) GetKubeConfig

func (r *Kubeadm) GetKubeConfig(ctx context.Context, clusterName string) (string, error)

GetKubeConfig get it by kc's own kubeadm method, without any processing here

func (*Kubeadm) InitCloudProvider

func (r *Kubeadm) InitCloudProvider(operator clustermanage.Operator, provider v1.CloudProvider) (clustermanage.CloudProvider, error)

InitCloudProvider init cloud provider

func (*Kubeadm) NodeDiff

func (r *Kubeadm) NodeDiff(clu *v1.Cluster) (addNodes []*v1.WorkerNode, delNodes []*v1.Node, err error)

NodeDiff Comparison of prior and subsequent cluster nodes

func (*Kubeadm) PreCheck

func (r *Kubeadm) PreCheck(ctx context.Context) (bool, error)

PreCheck precheck import-cluster

func (*Kubeadm) Sync

func (r *Kubeadm) Sync(ctx context.Context) error

Sync keep cluster consistent in kc and kubeadm.

1. client-go connect kube-apiServer 2. get cluster info 3. create or update kc cluster

func (*Kubeadm) ToWrapper

func (r *Kubeadm) ToWrapper() (Wrapper, error)

ToWrapper init wrapper param

type LocalEtcd

type LocalEtcd struct {
	// DataDir is the directory etcd will place its data.
	// Defaults to "/var/lib/etcd".
	DataDir string `yaml:"dataDir"`
}

type Network

type Network struct {
	// ServiceSubnet is the subnet used by k8s services. Defaults to "10.96.0.0/12".
	ServiceSubnet string `yaml:"serviceSubnet,omitempty"`
	// PodSubnet is the subnet used by pods.
	PodSubnet string `yaml:"podSubnet,omitempty"`
	// DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local".
	DNSDomain string `yaml:"dnsDomain,omitempty"`
}

type Wrapper

type Wrapper struct {
	ProviderName string `json:"providerName"`
	APIEndpoint  string `json:"apiEndpoint,omitempty"`
	KubeConfig   string `json:"kubeConfig"`
	Region       string `json:"region"`
	ClusterName  string `json:"clusterName"`
	KubeCli      *kubernetes.Clientset
}

func (*Wrapper) ClusterInfo

func (w *Wrapper) ClusterInfo() (*v1.Cluster, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL