Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyAuthzResources(ctx context.Context, rkeConfig v3.RancherKubernetesEngineConfig, ...) error
- func BuildPortChecksFromPortList(host *hosts.Host, portList []string, proto string) []v3.PortCheck
- func BuildRKEConfigNodePlan(ctx context.Context, myCluster *Cluster, host *hosts.Host, ...) v3.RKEConfigNodePlan
- func CheckEtcdHostsChanged(kubeCluster, currentCluster *Cluster) error
- func ConfigureCluster(ctx context.Context, rkeConfig v3.RancherKubernetesEngineConfig, ...) error
- func GeneratePlan(ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig, ...) (v3.RKEPlan, error)
- func GetK8sVersion(localConfigPath string, k8sWrapTransport k8s.WrapTransport) (string, error)
- func GetLocalRKEConfig() *v3.RancherKubernetesEngineConfig
- func GetLocalRKENodeConfig() *v3.RKEConfigNode
- func ParseConfig(clusterFile string) (*v3.RancherKubernetesEngineConfig, error)
- func ReconcileCluster(ctx context.Context, kubeCluster, currentCluster *Cluster, updateOnly bool) error
- func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Cluster) error
- func ValidateHostCount(c *Cluster) error
- type Cluster
- func (c *Cluster) ApplySystemAddonExcuteJob(addonJob string) error
- func (c *Cluster) BackupEtcd(ctx context.Context, backupName string) error
- func (c *Cluster) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host, prefixPath string) v3.Process
- func (c *Cluster) BuildKubeAPIProcess(prefixPath string) v3.Process
- func (c *Cluster) BuildKubeControllerProcess(prefixPath string) v3.Process
- func (c *Cluster) BuildKubeProxyProcess(prefixPath string) v3.Process
- func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Process
- func (c *Cluster) BuildProxyProcess() v3.Process
- func (c *Cluster) BuildSchedulerProcess(prefixPath string) v3.Process
- func (c *Cluster) BuildSidecarProcess() v3.Process
- func (c *Cluster) CheckClusterPorts(ctx context.Context, currentCluster *Cluster) error
- func (c *Cluster) CleanDeadLogs(ctx context.Context) error
- func (c *Cluster) ClusterRemove(ctx context.Context) error
- func (c *Cluster) DeployControlPlane(ctx context.Context) error
- func (c *Cluster) DeployWorkerPlane(ctx context.Context) error
- func (c *Cluster) GetClusterState(ctx context.Context) (*Cluster, error)
- func (c *Cluster) GetKubernetesServicesOptions() v3.KubernetesServicesOptions
- func (c *Cluster) InvertIndexHosts() error
- func (c *Cluster) PrePullK8sImages(ctx context.Context) error
- func (c *Cluster) RestoreEtcdBackup(ctx context.Context, backupPath string) error
- func (c *Cluster) SaveClusterState(ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig) error
- func (c *Cluster) SetUpHosts(ctx context.Context) error
- func (c *Cluster) StoreAddonConfigMap(ctx context.Context, addonYaml string, addonName string) error
- func (c *Cluster) SyncLabelsAndTaints(ctx context.Context) error
- func (c *Cluster) TunnelHosts(ctx context.Context, local bool) error
- func (c *Cluster) ValidateCluster() error
Constants ¶
View Source
const ( KubeDNSAddonResourceName = "rke-kubedns-addon" UserAddonResourceName = "rke-user-addon" IngressAddonResourceName = "rke-ingress-controller" UserAddonsIncludeResourceName = "rke-user-includes-addons" )
View Source
const ( CloudConfigDeployer = "cloud-config-deployer" CloudConfigServiceName = "cloud" CloudConfigPath = "/etc/kubernetes/cloud-config.json" CloudConfigEnv = "RKE_CLOUD_CONFIG" )
View Source
const ( X509AuthenticationProvider = "x509" StateConfigMapName = "cluster-state" UpdateStateTimeout = 30 GetStateTimeout = 30 KubernetesClientTimeOut = 30 NoneAuthorizationMode = "none" LocalNodeAddress = "127.0.0.1" LocalNodeHostname = "localhost" LocalNodeUser = "root" CloudProvider = "CloudProvider" AzureCloudProvider = "azure" AWSCloudProvider = "aws" ControlPlane = "controlPlane" WorkerPlane = "workerPlan" EtcdPlane = "etcd" )
View Source
const ( DefaultServiceClusterIPRange = "10.43.0.0/16" DefaultClusterCIDR = "10.42.0.0/16" DefaultClusterDNSService = "10.43.0.10" DefaultClusterDomain = "cluster.local" DefaultClusterName = "local" DefaultClusterSSHKeyPath = "~/.ssh/id_rsa" DefaultK8sVersion = v3.DefaultK8s DefaultSSHPort = "22" DefaultDockerSockPath = "/var/run/docker.sock" DefaultAuthStrategy = "x509" DefaultAuthorizationMode = "rbac" DefaultNetworkPlugin = "canal" DefaultNetworkCloudProvider = "none" DefaultIngressController = "nginx" DefaultEtcdBackupCreationPeriod = "5m0s" DefaultEtcdBackupRetentionPeriod = "24h" )
View Source
const ( NetworkPluginResourceName = "rke-network-plugin" PortCheckContainer = "rke-port-checker" EtcdPortListenContainer = "rke-etcd-port-listener" CPPortListenContainer = "rke-cp-port-listener" WorkerPortListenContainer = "rke-worker-port-listener" KubeAPIPort = "6443" EtcdPort1 = "2379" EtcdPort2 = "2380" ScedulerPort = "10251" ControllerPort = "10252" KubeletPort = "10250" KubeProxyPort = "10256" FlannetVXLANPortUDP = "8472" ProtocolTCP = "TCP" ProtocolUDP = "UDP" FlannelNetworkPlugin = "flannel" FlannelIface = "flannel_iface" CalicoNetworkPlugin = "calico" CalicoCloudProvider = "calico_cloud_provider" CanalNetworkPlugin = "canal" CanalIface = "canal_iface" WeaveNetworkPlugin = "weave" // EtcdEndpoints is the server address for Etcd, used by calico EtcdEndpoints = "EtcdEndpoints" // APIRoot is the kubernetes API address APIRoot = "APIRoot" EtcdClientCert = "EtcdClientCert" EtcdClientKey = "EtcdClientKey" EtcdClientCA = "EtcdClientCA" EtcdClientCertPath = "EtcdClientCertPath" EtcdClientKeyPath = "EtcdClientKeyPath" EtcdClientCAPath = "EtcdClientCAPath" ClientCertPath = "ClientCertPath" ClientKeyPath = "ClientKeyPath" ClientCAPath = "ClientCAPath" KubeCfg = "KubeCfg" ClusterCIDR = "ClusterCIDR" Image = "Image" CNIImage = "CNIImage" NodeImage = "NodeImage" ControllersImage = "ControllersImage" CanalFlannelImg = "CanalFlannelImg" Calicoctl = "Calicoctl" FlannelInterface = "FlannelInterface" CanalInterface = "CanalInterface" RBACConfig = "RBACConfig" )
View Source
const ( EtcdPathPrefix = "/registry" B2DOS = "Boot2Docker" B2DPrefixPath = "/mnt/sda1/rke" ROS = "RancherOS" ROSPrefixPath = "/opt/rke" ContainerNameLabel = "io.rancher.rke.container.name" )
Variables ¶
View Source
var ControlPlanePortList = []string{ KubeAPIPort, }
View Source
var EtcdPortList = []string{ EtcdPort1, EtcdPort2, }
View Source
var WorkerPortList = []string{ KubeletPort, }
Functions ¶
func ApplyAuthzResources ¶ added in v0.1.2
func ApplyAuthzResources(ctx context.Context, rkeConfig v3.RancherKubernetesEngineConfig, clusterFilePath, configDir string, k8sWrapTransport k8s.WrapTransport) error
func BuildPortChecksFromPortList ¶ added in v0.1.2
func BuildRKEConfigNodePlan ¶ added in v0.1.2
func CheckEtcdHostsChanged ¶
func ConfigureCluster ¶ added in v0.1.2
func ConfigureCluster( ctx context.Context, rkeConfig v3.RancherKubernetesEngineConfig, crtBundle map[string]pki.CertificatePKI, clusterFilePath, configDir string, k8sWrapTransport k8s.WrapTransport, useKubectl bool) error
func GeneratePlan ¶ added in v0.1.2
func GetK8sVersion ¶
func GetK8sVersion(localConfigPath string, k8sWrapTransport k8s.WrapTransport) (string, error)
func GetLocalRKEConfig ¶
func GetLocalRKEConfig() *v3.RancherKubernetesEngineConfig
func GetLocalRKENodeConfig ¶
func GetLocalRKENodeConfig() *v3.RKEConfigNode
func ParseConfig ¶
func ParseConfig(clusterFile string) (*v3.RancherKubernetesEngineConfig, error)
func ReconcileCluster ¶
func SetUpAuthentication ¶
func ValidateHostCount ¶ added in v0.1.2
Types ¶
type Cluster ¶
type Cluster struct { v3.RancherKubernetesEngineConfig `yaml:",inline"` ConfigPath string LocalKubeConfigPath string EtcdHosts []*hosts.Host WorkerHosts []*hosts.Host ControlPlaneHosts []*hosts.Host InactiveHosts []*hosts.Host EtcdReadyHosts []*hosts.Host KubeClient *kubernetes.Clientset KubernetesServiceIP net.IP Certificates map[string]pki.CertificatePKI ClusterDomain string ClusterCIDR string ClusterDNSServer string DockerDialerFactory hosts.DialerFactory LocalConnDialerFactory hosts.DialerFactory PrivateRegistriesMap map[string]v3.PrivateRegistry K8sWrapTransport k8s.WrapTransport UseKubectlDeploy bool UpdateWorkersOnly bool CloudConfigFile string }
func ParseCluster ¶
func ParseCluster( ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig, clusterFilePath, configDir string, dockerDialerFactory, localConnDialerFactory hosts.DialerFactory, k8sWrapTransport k8s.WrapTransport) (*Cluster, error)
func (*Cluster) ApplySystemAddonExcuteJob ¶
func (*Cluster) BackupEtcd ¶
func (*Cluster) BuildEtcdProcess ¶ added in v0.1.2
func (*Cluster) BuildKubeAPIProcess ¶ added in v0.1.2
func (*Cluster) BuildKubeControllerProcess ¶ added in v0.1.2
func (*Cluster) BuildKubeProxyProcess ¶ added in v0.1.2
func (*Cluster) BuildKubeletProcess ¶ added in v0.1.2
func (*Cluster) BuildProxyProcess ¶ added in v0.1.2
func (*Cluster) BuildSchedulerProcess ¶ added in v0.1.2
func (*Cluster) BuildSidecarProcess ¶ added in v0.1.2
func (*Cluster) CheckClusterPorts ¶
func (*Cluster) CleanDeadLogs ¶ added in v0.1.3
func (*Cluster) DeployControlPlane ¶
func (*Cluster) GetClusterState ¶
func (*Cluster) GetKubernetesServicesOptions ¶ added in v0.1.6
func (c *Cluster) GetKubernetesServicesOptions() v3.KubernetesServicesOptions
func (*Cluster) InvertIndexHosts ¶
func (*Cluster) PrePullK8sImages ¶ added in v0.1.1
func (*Cluster) RestoreEtcdBackup ¶
func (*Cluster) SaveClusterState ¶
func (*Cluster) StoreAddonConfigMap ¶
func (*Cluster) SyncLabelsAndTaints ¶ added in v0.1.1
func (*Cluster) ValidateCluster ¶
Click to show internal directories.
Click to hide internal directories.