hosts

package
v1.4.8-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 26 Imported by: 234

Documentation

Index

Constants

View Source
const (
	ToCleanEtcdDir          = "/var/lib/etcd/"
	ToCleanSSLDir           = "/etc/kubernetes/"
	ToCleanCNIConf          = "/etc/cni/"
	ToCleanCNIBin           = "/opt/cni/"
	ToCleanCNILib           = "/var/lib/cni/"
	ToCleanCalicoRun        = "/var/run/calico/"
	ToCleanTempCertPath     = "/etc/kubernetes/.tmp/"
	CleanerContainerName    = "kube-cleaner"
	LogCleanerContainerName = "rke-log-cleaner"
	RKELogsPath             = "/var/lib/rancher/rke/log"
	SELinuxLabel            = "label=type:rke_container_t"

	B2DOS               = "Boot2Docker"
	B2DPrefixPath       = "/mnt/sda1/rke"
	ROS                 = "RancherOS"
	ROSPrefixPath       = "/opt/rke"
	CoreOS              = "CoreOS"
	CoreOSPrefixPath    = "/opt/rke"
	FlatcarOS           = "Flatcar"
	FlatcarOSPrefixPath = "/opt/rke"
	WindowsOS           = "Windows"
	WindowsPrefixPath   = "c:/"
)
View Source
const (
	DINDPort = "2375"
)
View Source
const (
	DockerDialerTimeout = 50
)

Variables

This section is empty.

Functions

func BastionHostWrapTransport added in v0.1.7

func BastionHostWrapTransport(bastionHost v3.BastionHost) (transport.WrapperFunc, error)

func DeleteNode

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

func DindConnFactory added in v0.1.9

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

func DindHealthcheckConnFactory added in v0.1.9

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

func DoRunLogCleaner added in v0.1.8

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

func GetInternalAddressForHosts added in v1.0.7

func GetInternalAddressForHosts(hostList []*Host) []string

func IsDockerSELinuxEnabled added in v1.1.3

func IsDockerSELinuxEnabled(host *Host) bool

func IsEnterpriseLinuxDocker added in v1.1.3

func IsEnterpriseLinuxDocker(host *Host) bool

func IsEnterpriseLinuxHost added in v1.1.3

func IsEnterpriseLinuxHost(host *Host) bool

func IsHostListChanged

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

func IsNodeInList added in v0.1.10

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

func LocalConnFactory

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

func LocalHealthcheckFactory

func LocalHealthcheckFactory(h *Host) (func(network, address string) (net.Conn, error), 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 added in v0.2.0

type DialersOptions struct {
	DockerDialerFactory    DialerFactory
	LocalConnDialerFactory DialerFactory
	K8sWrapTransport       transport.WrapperFunc
}

func GetDialerOptions added in v0.2.0

func GetDialerOptions(d, l DialerFactory, w transport.WrapperFunc) DialersOptions

type Host

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

func GetHostListIntersect added in v0.2.0

func GetHostListIntersect(a []*Host, b []*Host) []*Host

func GetToAddHosts

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

func GetToDeleteHosts

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

func GetUniqueHostList added in v0.1.2

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

func NodesToHosts added in v0.1.2

func NodesToHosts(rkeNodes []v3.RKEConfigNode, nodeRole string) []*Host

func (*Host) CleanUp

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

func (*Host) CleanUpAll

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

func (*Host) CleanUpControlHost

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

func (*Host) CleanUpEtcdHost

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

func (*Host) CleanUpWorkerHost

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

func (*Host) GetExtraArgs added in v1.1.5

func (h *Host) GetExtraArgs(service v3.BaseService) map[string]string

func (*Host) GetExtraArgsArray added in v1.3.12

func (h *Host) GetExtraArgsArray(service v3.BaseService) map[string][]string

func (*Host) GetExtraBinds added in v1.1.5

func (h *Host) GetExtraBinds(service v3.BaseService) []string

func (*Host) GetExtraEnv added in v1.1.5

func (h *Host) GetExtraEnv(service v3.BaseService) []string

func (*Host) IsLinux added in v1.1.5

func (h *Host) IsLinux() bool

func (*Host) IsWindows added in v1.1.5

func (h *Host) IsWindows() bool

func (*Host) OS added in v1.1.5

func (h *Host) OS() string

func (*Host) ProcessFilter added in v1.1.5

func (h *Host) ProcessFilter(processes map[string]v3.Process) map[string]v3.Process

func (*Host) SetPrefixPath added in v1.1.5

func (h *Host) SetPrefixPath(clusterPrefixPath string)

func (*Host) TunnelUp

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

func (*Host) TunnelUpLocal

func (h *Host) TunnelUpLocal(ctx context.Context, clusterVersion string) error

Jump to

Keyboard shortcuts

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