cluster

package
v0.0.11-dev Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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 CheckEtcdHostsChanged(kubeCluster, currentCluster *Cluster) error

func GetK8sVersion

func GetK8sVersion(localConfigPath string) (string, error)

func GetLocalKubeConfig

func GetLocalKubeConfig(configPath, configDir string) string

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
}

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) ClusterRemove

func (c *Cluster) ClusterRemove(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) 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) 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