services

package
v0.0.0-...-0a488ca Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdSnapshotPath                = "/opt/rke/etcd-snapshots/"
	EtcdRestorePath                 = "/opt/rke/etcd-snapshots-restore/"
	EtcdDataDir                     = "/var/lib/rancher/etcd/"
	EtcdInitWaitTime                = 10
	EtcdSnapshotWaitTime            = 5
	EtcdSnapshotCompressedExtension = "zip"
)
View Source
const (
	HealthzAddress   = "localhost"
	HealthzEndpoint  = "/healthz"
	HTTPProtoPrefix  = "http://"
	HTTPSProtoPrefix = "https://"
)
View Source
const (
	NginxProxyImage   = "rancher/rke-nginx-proxy:0.1.0"
	NginxProxyEnvName = "CP_HOSTS"
)
View Source
const (
	ETCDRole    = "etcd"
	ControlRole = "controlplane"
	WorkerRole  = "worker"

	SidekickServiceName   = "sidekick"
	RBACAuthorizationMode = "rbac"

	KubeAPIContainerName            = "kube-apiserver"
	KubeletContainerName            = "kubelet"
	KubeproxyContainerName          = "kube-proxy"
	KubeControllerContainerName     = "kube-controller-manager"
	SchedulerContainerName          = "kube-scheduler"
	EtcdContainerName               = "etcd"
	EtcdSnapshotContainerName       = "etcd-rolling-snapshots"
	EtcdSnapshotOnceContainerName   = "etcd-snapshot-once"
	EtcdSnapshotRemoveContainerName = "etcd-remove-snapshot"
	EtcdRestoreContainerName        = "etcd-restore"
	EtcdDownloadBackupContainerName = "etcd-download-backup"
	EtcdServeBackupContainerName    = "etcd-Serve-backup"
	EtcdChecksumContainerName       = "etcd-checksum-checker"
	NginxProxyContainerName         = "nginx-proxy"
	SidekickContainerName           = "service-sidekick"
	LogLinkContainerName            = "rke-log-linker"
	LogCleanerContainerName         = "rke-log-cleaner"

	KubeAPIPort        = 6443
	SchedulerPort      = 10251
	KubeControllerPort = 10252
	KubeletPort        = 10250
	KubeproxyPort      = 10256

	WorkerThreads = util.WorkerThreads
)

Variables

This section is empty.

Functions

func AddEtcdMember

func AddEtcdMember(ctx context.Context, toAddEtcdHost *hosts.Host, etcdHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, cert, key []byte) error

func DownloadEtcdSnapshotFromBackupServer

func DownloadEtcdSnapshotFromBackupServer(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdSnapshotImage, name string, backupServer *hosts.Host) error

func DownloadEtcdSnapshotFromS3

func DownloadEtcdSnapshotFromS3(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdSnapshotImage string, name string, es v3.ETCDService) error

func GetEtcdConnString

func GetEtcdConnString(hosts []*hosts.Host, hostAddress string) string

func GetEtcdInitialCluster

func GetEtcdInitialCluster(hosts []*hosts.Host) string

func GetEtcdSnapshotChecksum

func GetEtcdSnapshotChecksum(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, alpineImage, snapshotName string) (string, error)

func GetHealthCheckURL

func GetHealthCheckURL(useTLS bool, port int) string

func GetProcessConfig

func GetProcessConfig(process v3.Process) (*container.Config, *container.HostConfig, string)

func IsEtcdMember

func IsEtcdMember(ctx context.Context, etcdHost *hosts.Host, etcdHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, cert, key []byte) (bool, error)

func ReloadEtcdCluster

func ReloadEtcdCluster(ctx context.Context, readyEtcdHosts []*hosts.Host, newHost *hosts.Host, localConnDialerFactory hosts.DialerFactory, cert, key []byte, prsMap map[string]v3.PrivateRegistry, etcdNodePlanMap map[string]v3.RKEConfigNodePlan, alpineImage string) error

func RemoveControlPlane

func RemoveControlPlane(ctx context.Context, controlHosts []*hosts.Host, force bool) error

func RemoveEtcdMember

func RemoveEtcdMember(ctx context.Context, etcdHost *hosts.Host, etcdHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, cert, key []byte) error

func RemoveEtcdPlane

func RemoveEtcdPlane(ctx context.Context, etcdHosts []*hosts.Host, force bool) error

func RemoveWorkerPlane

func RemoveWorkerPlane(ctx context.Context, workerHosts []*hosts.Host, force bool) error

func RestartControlPlane

func RestartControlPlane(ctx context.Context, controlHosts []*hosts.Host) error

func RestartEtcdPlane

func RestartEtcdPlane(ctx context.Context, etcdHosts []*hosts.Host) error

func RestartKubeAPI

func RestartKubeAPI(ctx context.Context, host *hosts.Host) error

func RestartKubeController

func RestartKubeController(ctx context.Context, host *hosts.Host) error

func RestartKubelet

func RestartKubelet(ctx context.Context, host *hosts.Host) error

func RestartKubeproxy

func RestartKubeproxy(ctx context.Context, host *hosts.Host) error

func RestartNginxProxy

func RestartNginxProxy(ctx context.Context, host *hosts.Host) error

func RestartScheduler

func RestartScheduler(ctx context.Context, host *hosts.Host) error

func RestartWorkerPlane

func RestartWorkerPlane(ctx context.Context, workerHosts []*hosts.Host) error

func RestoreEtcdSnapshot

func RestoreEtcdSnapshot(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdRestoreImage, snapshotName, initCluster string) error

func RunControlPlane

func RunControlPlane(ctx context.Context, controlHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, prsMap map[string]v3.PrivateRegistry, cpNodePlanMap map[string]v3.RKEConfigNodePlan, updateWorkersOnly bool, alpineImage string, certMap map[string]pki.CertificatePKI) error

func RunEtcdPlane

func RunEtcdPlane(
	ctx context.Context,
	etcdHosts []*hosts.Host,
	etcdNodePlanMap map[string]v3.RKEConfigNodePlan,
	localConnDialerFactory hosts.DialerFactory,
	prsMap map[string]v3.PrivateRegistry,
	updateWorkersOnly bool,
	alpineImage string,
	es v3.ETCDService,
	certMap map[string]pki.CertificatePKI) error

func RunEtcdSnapshotRemove

func RunEtcdSnapshotRemove(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdSnapshotImage string, name string, once bool, es v3.ETCDService) error

func RunEtcdSnapshotSave

func RunEtcdSnapshotSave(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdSnapshotImage string, name string, once bool, es v3.ETCDService) error

func RunWorkerPlane

func RunWorkerPlane(ctx context.Context, allHosts []*hosts.Host, localConnDialerFactory hosts.DialerFactory, prsMap map[string]v3.PrivateRegistry, workerNodePlanMap map[string]v3.RKEConfigNodePlan, certMap map[string]pki.CertificatePKI, updateWorkersOnly bool, alpineImage string) error

func StartBackupServer

func StartBackupServer(ctx context.Context, etcdHost *hosts.Host, prsMap map[string]v3.PrivateRegistry, etcdSnapshotImage string, name string) error

Types

type RestartFunc

type RestartFunc func(context.Context, *hosts.Host) error

Jump to

Keyboard shortcuts

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