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) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host) v3.Process
- func (c *Cluster) BuildKubeAPIProcess() v3.Process
- func (c *Cluster) BuildKubeControllerProcess() v3.Process
- func (c *Cluster) BuildKubeProxyProcess() v3.Process
- func (c *Cluster) BuildKubeletProcess(host *hosts.Host) v3.Process
- func (c *Cluster) BuildProxyProcess() v3.Process
- func (c *Cluster) BuildSchedulerProcess() 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) InvertIndexHosts() error
- func (c *Cluster) PrePullK8sImages(ctx context.Context) 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" )
View Source
const ( DefaultServiceClusterIPRange = "10.233.0.0/18" DefaultClusterCIDR = "10.233.64.0/18" DefaultClusterDNSService = "10.233.0.3" DefaultClusterDomain = "cluster.local" DefaultClusterName = "local" DefaultClusterSSHKeyPath = "~/.ssh/id_rsa" DefaultK8sVersion = v3.K8sV18 DefaultSSHPort = "22" DefaultDockerSockPath = "/var/run/docker.sock" DefaultAuthStrategy = "x509" DefaultAuthorizationMode = "rbac" DefaultNetworkPlugin = "flannel" DefaultNetworkCloudProvider = "none" DefaultIngressController = "nginx" )
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" FlannelImage = "flannel_image" FlannelCNIImage = "flannel_cni_image" FlannelIface = "flannel_iface" CalicoNetworkPlugin = "calico" CalicoNodeImage = "calico_node_image" CalicoCNIImage = "calico_cni_image" CalicoControllersImage = "calico_controllers_image" CalicoctlImage = "calicoctl_image" CalicoCloudProvider = "calico_cloud_provider" CanalNetworkPlugin = "canal" CanalNodeImage = "canal_node_image" CanalCNIImage = "canal_cni_image" CanalFlannelImage = "canal_flannel_image" WeaveNetworkPlugin = "weave" WeaveImage = "weave_node_image" WeaveCNIImage = "weave_cni_image" // 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" CloudProvider = "CloudProvider" AWSCloudProvider = "aws" RBACConfig = "RBACConfig" )
View Source
const (
EtcdPathPrefix = "/registry"
)
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 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 }
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) 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) InvertIndexHosts ¶
func (*Cluster) PrePullK8sImages ¶ added in v0.1.1
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.