Documentation ¶
Index ¶
- Constants
- Variables
- func GetClientFromConfig(adminConfPath string) (runtimeClient.Client, error)
- func NewKubeDriver(kubeConfig string) (runtime.Driver, error)
- func NewKubeadmRuntime(clusterFileKubeConfig kubeadm.KubeadmConfig, infra infradriver.InfraDriver, ...) (runtime.Installer, error)
- type CommandType
- type Config
- type Runtime
- func (k *Runtime) Command(name CommandType, nodeNameOverride string) (string, error)
- func (k *Runtime) GetCurrentRuntimeDriver() (runtime.Driver, error)
- func (k *Runtime) Install() error
- func (k *Runtime) Reset() error
- func (k *Runtime) ScaleDown(mastersToDelete, workersToDelete []net.IP) error
- func (k *Runtime) ScaleUp(newMasters, newWorkers []net.IP) error
- func (k *Runtime) Upgrade() error
- type StaticFile
Constants ¶
View Source
const ( AuditPolicyYml = "audit-policy.yml" KubeadmFileYml = "/etc/kubernetes/kubeadm.yaml" AdminConf = "admin.conf" ControllerConf = "controller-manager.conf" SchedulerConf = "scheduler.conf" KubeletConf = "kubelet.conf" // kube file KUBECONTROLLERCONFIGFILE = "/etc/kubernetes/controller-manager.conf" KUBESCHEDULERCONFIGFILE = "/etc/kubernetes/scheduler.conf" AdminKubeConfPath = "/etc/kubernetes/admin.conf" LvscarePodFileName = "kube-lvscare.yaml" )
View Source
const ( GetCustomizeCRISocket = "cat /etc/sealerio/cri/socket-path" RemoteCleanCustomizeCRISocket = "rm -f /etc/sealerio/cri/socket-path" RemoteAddEtcHosts = "cat /etc/hosts |grep '%s' || echo '%s' >> /etc/hosts" RemoteReplaceKubeConfig = `` /* 128-byte string literal not displayed */ RemoveKubeConfig = "rm -rf /usr/bin/kube* && rm -rf ~/.kube/" RemoteCleanK8sOnHost = `` /* 529-byte string literal not displayed */ RemoteRemoveAPIServerEtcHost = "echo \"$(sed \"/%s/d\" /etc/hosts)\" > /etc/hosts" KubeDeleteNode = "kubectl delete node %s" RemoteCheckRoute = "seautil route check --host %s" RemoteAddRoute = "seautil route add --host %s --gateway %s" RemoteDelRoute = "if command -v seautil > /dev/null 2>&1; then seautil route del --host %s --gateway %s; fi" )
Variables ¶
View Source
var MasterStaticFiles = []*StaticFile{ { DestinationDir: "/etc/kubernetes", Name: AuditPolicyYml, }, }
MasterStaticFiles Put static files here, can be moved to all master nodes before kubeadm execution
Functions ¶
func GetClientFromConfig ¶
func GetClientFromConfig(adminConfPath string) (runtimeClient.Client, error)
func NewKubeadmRuntime ¶
func NewKubeadmRuntime(clusterFileKubeConfig kubeadm.KubeadmConfig, infra infradriver.InfraDriver, containerRuntimeInfo containerruntime.Info, registryInfo registry.Info) (runtime.Installer, error)
Types ¶
type CommandType ¶
type CommandType string
const InitMaster CommandType = "initMaster"
const JoinMaster CommandType = "joinMaster"
const JoinNode CommandType = "joinNode"
type Runtime ¶
type Runtime struct { Config *Config // contains filtered or unexported fields }
Runtime struct is the runtime interface for kubernetes
func (*Runtime) Command ¶
func (k *Runtime) Command(name CommandType, nodeNameOverride string) (string, error)
func (*Runtime) GetCurrentRuntimeDriver ¶
type StaticFile ¶
StaticFile :static file should not be template, will never be changed while initialization.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.