Documentation ¶
Index ¶
- Constants
- func CheckEtcdHostsChanged(kubeCluster, currentCluster *Cluster) error
- func GetK8sVersion(localConfigPath string) (string, error)
- func GetLocalKubeConfig(configPath, configDir string) string
- func GetLocalRKENodeConfig() *v3.RKEConfigNode
- func ParseConfig(clusterFile string) (*v3.RancherKubernetesEngineConfig, error)
- func ReconcileCluster(ctx context.Context, kubeCluster, currentCluster *Cluster) error
- func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Cluster) error
- type Cluster
- func (c *Cluster) ApplyAuthzResources(ctx context.Context) error
- func (c *Cluster) ApplySystemAddonExcuteJob(addonJob string) error
- func (c *Cluster) ClusterRemove(ctx context.Context) error
- func (c *Cluster) DeployControlPlane(ctx context.Context) error
- func (c *Cluster) DeployK8sAddOns(ctx context.Context) error
- func (c *Cluster) DeployNetworkPlugin(ctx context.Context) error
- func (c *Cluster) DeployUserAddOns(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) 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) TunnelHosts(ctx context.Context, local bool) error
- func (c *Cluster) ValidateCluster() error
Constants ¶
View Source
const ( KubeDNSAddonResourceName = "rke-kubedns-addon" UserAddonResourceName = "rke-user-addon" )
View Source
const ( X509AuthenticationProvider = "x509" StateConfigMapName = "cluster-state" UpdateStateTimeout = 30 GetStateTimeout = 30 KubernetesClientTimeOut = 30 AplineImage = "alpine" NginxProxyImage = "nginx_proxy" CertDownloaderImage = "cert_downloader" KubeDNSImage = "kubedns_image" DNSMasqImage = "dnsmasq_image" KubeDNSSidecarImage = "kubedns_sidecar_image" KubeDNSAutoScalerImage = "kubedns_autoscaler_image" ServiceSidekickImage = "service_sidekick_image" NoneAuthorizationMode = "none" LocalNodeAddress = "127.0.0.1" LocalNodeHostname = "localhost" LocalNodeUser = "root" )
View Source
const ( DefaultClusterConfig = "cluster.yml" DefaultServiceClusterIPRange = "10.233.0.0/18" DefaultClusterCIDR = "10.233.64.0/18" DefaultClusterDNSService = "10.233.0.3" DefaultClusterDomain = "cluster.local" DefaultClusterSSHKeyPath = "~/.ssh/id_rsa" DefaultDockerSockPath = "/var/run/docker.sock" DefaultAuthStrategy = "x509" DefaultAuthorizationMode = "rbac" DefaultNetworkPlugin = "flannel" DefaultNetworkCloudProvider = "none" DefaultInfraContainerImage = "gcr.io/google_containers/pause-amd64:3.0" DefaultAplineImage = "alpine:latest" DefaultNginxProxyImage = "rancher/rke-nginx-proxy:0.1.0" DefaultCertDownloaderImage = "rancher/rke-cert-deployer:0.1.0" DefaultServiceSidekickImage = "rancher/rke-service-sidekick:0.1.0" DefaultEtcdImage = "quay.io/coreos/etcd:latest" DefaultK8sImage = "rancher/k8s:v1.8.3-rancher2" DefaultFlannelImage = "quay.io/coreos/flannel:v0.9.1" DefaultFlannelCNIImage = "quay.io/coreos/flannel-cni:v0.2.0" DefaultCalicoNodeImage = "quay.io/calico/node:v2.6.2" DefaultCalicoCNIImage = "quay.io/calico/cni:v1.11.0" DefaultCalicoControllersImage = "quay.io/calico/kube-controllers:v1.0.0" DefaultCalicoctlImage = "quay.io/calico/ctl:v1.6.2" DefaultWeaveImage = "weaveworks/weave-kube:2.1.2" DefaultWeaveCNIImage = "weaveworks/weave-npc:2.1.2" DefaultCanalNodeImage = "quay.io/calico/node:v2.6.2" DefaultCanalCNIImage = "quay.io/calico/cni:v1.11.0" DefaultCanalFlannelImage = "quay.io/coreos/flannel:v0.9.1" DefaultKubeDNSImage = "gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5" DefaultDNSMasqImage = "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5" DefaultKubeDNSSidecarImage = "gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5" DefaultKubeDNSAutoScalerImage = "gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0" )
View Source
const ( NetworkPluginResourceName = "rke-network-plugin" 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" ClientCert = "ClientCert" ClientKey = "ClientKey" ClientCA = "ClientCA" KubeCfg = "KubeCfg" ClusterCIDR = "ClusterCIDR" Image = "Image" CNIImage = "CNIImage" NodeImage = "NodeImage" ControllersImage = "ControllersImage" CanalFlannelImg = "CanalFlannelImg" Calicoctl = "Calicoctl" FlannelInterface = "FlannelInterface" CloudProvider = "CloudProvider" AWSCloudProvider = "aws" RBACConfig = "RBACConfig" )
Variables ¶
This section is empty.
Functions ¶
func CheckEtcdHostsChanged ¶
func GetK8sVersion ¶
func GetLocalKubeConfig ¶
func GetLocalRKENodeConfig ¶
func GetLocalRKENodeConfig() *v3.RKEConfigNode
func ParseConfig ¶
func ParseConfig(clusterFile string) (*v3.RancherKubernetesEngineConfig, error)
func ReconcileCluster ¶
Types ¶
type Cluster ¶
type Cluster struct { v3.RancherKubernetesEngineConfig `yaml:",inline"` ConfigPath string LocalKubeConfigPath string EtcdHosts []*hosts.Host WorkerHosts []*hosts.Host ControlPlaneHosts []*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 }
func ParseCluster ¶
func ParseCluster( ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig, clusterFilePath, configDir string, dockerDialerFactory, localConnDialerFactory hosts.DialerFactory) (*Cluster, error)
func (*Cluster) ApplyAuthzResources ¶
func (*Cluster) ApplySystemAddonExcuteJob ¶
func (*Cluster) DeployControlPlane ¶
func (*Cluster) DeployNetworkPlugin ¶
func (*Cluster) GetClusterState ¶
func (*Cluster) InvertIndexHosts ¶
func (*Cluster) SaveClusterState ¶
func (*Cluster) StoreAddonConfigMap ¶
func (*Cluster) ValidateCluster ¶
Click to show internal directories.
Click to hide internal directories.