cluster

package
v0.1.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeDNSAddonResourceName = "rke-kubedns-addon"
	UserAddonResourceName    = "rke-user-addon"
	IngressAddonResourceName = "rke-ingress-controller"
)
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 (
	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            = "rancher/pause-amd64:3.0"
	DefaultAplineImage                    = "alpine:latest"
	DefaultNginxProxyImage                = "rancher/rke-nginx-proxy:v0.1.1"
	DefaultCertDownloaderImage            = "rancher/rke-cert-deployer:v0.1.1"
	DefaultKubernetesServicesSidecarImage = "rancher/rke-service-sidekick:v0.1.0"
	DefaultIngressController              = "nginx"

	DefaultEtcdImage = "rancher/etcd:v3.0.17"
	DefaultK8sImage  = "rancher/k8s:v1.8.7-rancher1-1"

	DefaultFlannelImage    = "rancher/coreos-flannel:v0.9.1"
	DefaultFlannelCNIImage = "rancher/coreos-flannel-cni:v0.2.0"

	DefaultCalicoNodeImage        = "rancher/calico-node:v2.6.2"
	DefaultCalicoCNIImage         = "rancher/calico-cni:v1.11.0"
	DefaultCalicoControllersImage = "rancher/calico-kube-controllers:v1.0.0"
	DefaultCalicoctlImage         = "rancher/calico-ctl:v1.6.2"

	DefaultWeaveImage    = "weaveworks/weave-kube:2.1.2"
	DefaultWeaveCNIImage = "weaveworks/weave-npc:2.1.2"

	DefaultCanalNodeImage    = "rancher/calico-node:v2.6.2"
	DefaultCanalCNIImage     = "rancher/calico-cni:v1.11.0"
	DefaultCanalFlannelImage = "rancher/coreos-flannel:v0.9.1"

	DefaultKubeDNSImage           = "rancher/k8s-dns-kube-dns-amd64:1.14.5"
	DefaultDNSmasqImage           = "rancher/k8s-dns-dnsmasq-nanny-amd64:1.14.5"
	DefaultKubeDNSSidecarImage    = "rancher/k8s-dns-sidecar-amd64:1.14.5"
	DefaultKubeDNSAutoScalerImage = "rancher/cluster-proportional-autoscaler-amd64:1.0.0"
)
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"

	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"
	ClientCertPath = "ClientCertPath"
	ClientKey      = "ClientKey"
	ClientKeyPath  = "ClientKeyPath"
	ClientCA       = "ClientCA"
	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"
)

Variables

This section is empty.

Functions

func CheckEtcdHostsChanged

func CheckEtcdHostsChanged(kubeCluster, currentCluster *Cluster) error

func GetK8sVersion

func GetK8sVersion(localConfigPath string) (string, error)

func GetLocalKubeConfig

func GetLocalKubeConfig(configPath, configDir string) string

func GetLocalRKEConfig

func GetLocalRKEConfig() *v3.RancherKubernetesEngineConfig

func GetLocalRKENodeConfig

func GetLocalRKENodeConfig() *v3.RKEConfigNode

func ParseConfig

func ParseConfig(clusterFile string) (*v3.RancherKubernetesEngineConfig, error)

func ReconcileCluster

func ReconcileCluster(ctx context.Context, kubeCluster, currentCluster *Cluster) error

func SetUpAuthentication

func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Cluster) error

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
	PrivateRegistriesMap             map[string]v3.PrivateRegistry
}

func ParseCluster

func ParseCluster(
	ctx context.Context,
	rkeConfig *v3.RancherKubernetesEngineConfig,
	clusterFilePath, configDir string,
	dockerDialerFactory,
	localConnDialerFactory hosts.DialerFactory) (*Cluster, error)

func (*Cluster) ApplyAuthzResources

func (c *Cluster) ApplyAuthzResources(ctx context.Context) error

func (*Cluster) ApplySystemAddonExcuteJob

func (c *Cluster) ApplySystemAddonExcuteJob(addonJob string) error

func (*Cluster) CheckClusterPorts

func (c *Cluster) CheckClusterPorts(ctx context.Context, currentCluster *Cluster) error

func (*Cluster) ClusterRemove

func (c *Cluster) ClusterRemove(ctx context.Context) error

func (*Cluster) DeployAddons added in v0.1.1

func (c *Cluster) DeployAddons(ctx context.Context) error

func (*Cluster) DeployControlPlane

func (c *Cluster) DeployControlPlane(ctx context.Context) error

func (*Cluster) DeployK8sAddOns

func (c *Cluster) DeployK8sAddOns(ctx context.Context) error

func (*Cluster) DeployNetworkPlugin

func (c *Cluster) DeployNetworkPlugin(ctx context.Context) error

func (*Cluster) DeployUserAddOns

func (c *Cluster) DeployUserAddOns(ctx context.Context) error

func (*Cluster) DeployWorkerPlane

func (c *Cluster) DeployWorkerPlane(ctx context.Context) error

func (*Cluster) GetClusterState

func (c *Cluster) GetClusterState(ctx context.Context) (*Cluster, error)

func (*Cluster) InvertIndexHosts

func (c *Cluster) InvertIndexHosts() error

func (*Cluster) PrePullK8sImages added in v0.1.1

func (c *Cluster) PrePullK8sImages(ctx context.Context) error

func (*Cluster) SaveClusterState

func (c *Cluster) SaveClusterState(ctx context.Context, rkeConfig *v3.RancherKubernetesEngineConfig) error

func (*Cluster) SetUpHosts

func (c *Cluster) SetUpHosts(ctx context.Context) error

func (*Cluster) StoreAddonConfigMap

func (c *Cluster) StoreAddonConfigMap(ctx context.Context, addonYaml string, addonName string) error

func (*Cluster) SyncLabelsAndTaints added in v0.1.1

func (c *Cluster) SyncLabelsAndTaints(ctx context.Context) error

func (*Cluster) TunnelHosts

func (c *Cluster) TunnelHosts(ctx context.Context, local bool) error

func (*Cluster) ValidateCluster

func (c *Cluster) ValidateCluster() error

Jump to

Keyboard shortcuts

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