hosts

package
v0.0.0-...-f45d039 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToCleanEtcdDir          = "/var/lib/etcd/"
	ToCleanKubeletDir       = "/var/lib/kubelet"
	ToCleanRookDir          = "/var/lib/rook"
	ToCleanZcloudDir        = "/var/lib/zcloud"
	ToCleanFlannelDir       = "/var/run/flannel/"
	ToCleanSSLDir           = "/etc/kubernetes/"
	ToCleanCNIConf          = "/etc/cni/"
	ToCleanCNIBin           = "/opt/cni/"
	ToCleanCNILib           = "/var/lib/cni/"
	ToCleanCalicoRun        = "/var/run/calico/"
	ToCleanDockerCerts      = "/etc/docker/certs.d"
	ToCleanZKE              = "/opt/zke"
	ToCleanTempCertPath     = "/etc/kubernetes/.tmp/"
	CleanerContainerName    = "kube-cleaner"
	LogCleanerContainerName = "zke-log-cleaner"
	ZKELogsPath             = "/var/lib/zcloud/zke/log"
)
View Source
const (
	DockerAPIVersion = "1.24"
)
View Source
const (
	DockerDialerTimeout = 120
)
View Source
const ZKERemoverEnvName = "PodCIDR"

Variables

This section is empty.

Functions

func CertificatePath

func CertificatePath(sshCertPath string) (string, error)

func CleanHeritageContainers

func CleanHeritageContainers(ctx context.Context, h *Host) error

func CleanHeritageStorge

func CleanHeritageStorge(ctx context.Context, h *Host, removeImage, clusterCIDR string, prsMap map[string]types.PrivateRegistry) error

func DeleteNode

func DeleteNode(ctx context.Context, toDeleteHost *Host, kubeClient *kubernetes.Clientset, hasAnotherRole bool) error

func DoRunLogCleaner

func DoRunLogCleaner(ctx context.Context, host *Host, alpineImage string, prsMap map[string]types.PrivateRegistry) error

func GetSSHConfig

func GetSSHConfig(username, sshPrivateKeyString string) (*ssh.ClientConfig, error)

func IsHostListChanged

func IsHostListChanged(currentHosts, configHosts []*Host) bool

func IsNodeInList

func IsNodeInList(host *Host, hostList []*Host) bool

func LocalConnFactory

func LocalConnFactory(h *Host) (func(network, address string) (net.Conn, error), error)

func NewDialer

func NewDialer(h *Host, kind string) (*dialer, error)

func PrivateKeyPath

func PrivateKeyPath(sshKeyPath string) (string, error)

func RemoveTaintFromHost

func RemoveTaintFromHost(ctx context.Context, host *Host, taintKey string, kubeClient *kubernetes.Clientset) error

func SSHFactory

func SSHFactory(h *Host) (func(network, address string) (net.Conn, error), error)

Types

type DialerFactory

type DialerFactory func(h *Host) (func(network, address string) (net.Conn, error), error)

type DialersOptions

type DialersOptions struct {
	DockerDialerFactory DialerFactory
	K8sWrapTransport    k8s.WrapTransport
}

type Host

type Host struct {
	types.ZKEConfigNode
	DClient             *client.Client
	LocalConnPort       int
	IsControl           bool
	IsWorker            bool
	IsEtcd              bool
	IsStorage           bool
	IsEdge              bool
	IgnoreDockerVersion bool
	ToAddEtcdMember     bool
	ExistingEtcdCluster bool
	SavedKeyPhrase      string
	ToAddLabels         map[string]string
	ToDelLabels         map[string]string
	ToAddTaints         []string
	ToDelTaints         []string
	DockerInfo          dockertypes.Info
	UpdateWorker        bool
	PrefixPath          string
}

func GetToAddHosts

func GetToAddHosts(currentHosts, configHosts []*Host) []*Host

func GetToDeleteHosts

func GetToDeleteHosts(currentHosts, configHosts, inactiveHosts []*Host) []*Host

func GetUniqueHostList

func GetUniqueHostList(etcdHosts, cpHosts, workerHosts, edgeHosts []*Host) []*Host

func NodesToHosts

func NodesToHosts(zkeNodes []types.ZKEConfigNode, nodeRole string) []*Host

func (*Host) CleanUp

func (h *Host) CleanUp(ctx context.Context, toCleanPaths []string, cleanerImage string, storageCleanerImage string, clusterCIDR string, prsMap map[string]types.PrivateRegistry) error

func (*Host) CleanUpAll

func (h *Host) CleanUpAll(ctx context.Context, cleanerImage string, storageCleanerImage string, prsMap map[string]types.PrivateRegistry, externalEtcd bool, clusterCIDR string) error

func (*Host) CleanUpControlHost

func (h *Host) CleanUpControlHost(ctx context.Context, cleanerImage string, storageCleanerImage string, prsMap map[string]types.PrivateRegistry, clusterCIDR string) error

func (*Host) CleanUpEtcdHost

func (h *Host) CleanUpEtcdHost(ctx context.Context, cleanerImage string, storageCleanerImage string, prsMap map[string]types.PrivateRegistry, clusterCIDR string) error

func (*Host) CleanUpWorkerHost

func (h *Host) CleanUpWorkerHost(ctx context.Context, cleanerImage string, storageCleanerImage string, prsMap map[string]types.PrivateRegistry, clusterCIDR string) error

func (*Host) GetSSHClient

func (h *Host) GetSSHClient() (*ssh.Client, error)

func (*Host) GetSSHCmdOutput

func (h *Host) GetSSHCmdOutput(cli *ssh.Client, cmd string) (string, string, error)

func (*Host) GetSftpClient

func (h *Host) GetSftpClient(cli *ssh.Client) (*sftp.Client, error)

func (*Host) TransFile

func (h *Host) TransFile(cli *sftp.Client, srcFilePath string, dstPath string) error

func (*Host) TunnelUp

func (h *Host) TunnelUp(ctx context.Context, dialerFactory DialerFactory, clusterPrefixPath string, clusterVersion string) error

Jump to

Keyboard shortcuts

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