Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyAuthzResources(ctx context.Context, zkeConfig types.ZKEConfig, ...) error
- func BuildPortChecksFromPortList(host *hosts.Host, portList []string, proto string) []types.PortCheck
- func BuildZKEConfigNodePlan(ctx context.Context, myCluster *Cluster, host *hosts.Host, ...) types.ZKENodePlan
- func CheckEtcdHostsChanged(kubeCluster, currentCluster *Cluster) error
- func GetAddonsExecuteJob(addonName, nodeName, image string) (string, error)
- func GetK8sVersion(ctx context.Context, k8sClient *kubernetes.Clientset) (string, error)
- func GetTagMajorVersion(tag string) string
- func ParseConfig(ctx context.Context, clusterFile string) (*types.ZKEConfig, error)
- func RebuildKubeconfig(ctx context.Context, kubeCluster *Cluster, clusterState *FullState) error
- func ReconcileCluster(ctx context.Context, kubeCluster, currentCluster *Cluster) error
- func RestartClusterPods(ctx context.Context, kubeCluster *Cluster) error
- func SaveZKEConfigToKubernetes(ctx context.Context, kubeCluster *Cluster, fullState *FullState) error
- func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Cluster, ...)
- func ValidateHostCount(c *Cluster) error
- type AddonError
- type Cluster
- func (c *Cluster) ApplySystemAddonExecuteJob(ctx context.Context, addonJob string, addonUpdated bool) error
- func (c *Cluster) BuildEtcdProcess(host *hosts.Host, etcdHosts []*hosts.Host, prefixPath string) types.Process
- func (c *Cluster) BuildKubeAPIProcess(host *hosts.Host, prefixPath string) types.Process
- func (c *Cluster) BuildKubeControllerProcess(prefixPath string) types.Process
- func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, prefixPath string) types.Process
- func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) types.Process
- func (c *Cluster) BuildProxyProcess() types.Process
- func (c *Cluster) BuildSchedulerProcess(prefixPath string) types.Process
- func (c *Cluster) BuildSidecarProcess() types.Process
- func (c *Cluster) CheckClusterPorts(ctx context.Context, currentCluster *Cluster) error
- func (c *Cluster) CleanDeadLogs(ctx context.Context) error
- func (c *Cluster) CleanupFiles(ctx context.Context) error
- func (c *Cluster) CleanupNodes(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) DoAddonDeploy(ctx context.Context, addonYaml, resourceName string, IsCritical bool) error
- func (c *Cluster) GetClusterState(ctx context.Context, fullState *FullState) (*Cluster, error)
- func (c *Cluster) GetHostInfoMap() map[string]dockertypes.Info
- func (c *Cluster) GetKubernetesServicesOptions() types.KubernetesServicesOptions
- func (c *Cluster) InvertIndexHosts(ctx context.Context) error
- func (c *Cluster) PrePullK8sImages(ctx context.Context) error
- func (c *Cluster) PrepareBackup(ctx context.Context, snapshotPath string) error
- func (c *Cluster) RemoveOldNodes(ctx context.Context) error
- func (c *Cluster) RestoreEtcdSnapshot(ctx context.Context, snapshotPath string) error
- func (c *Cluster) SetUpHosts(ctx context.Context) error
- func (c *Cluster) SetupDialers(ctx context.Context, dailersOptions hosts.DialersOptions) error
- func (c *Cluster) SnapshotEtcd(ctx context.Context, snapshotName string) error
- func (c *Cluster) StoreAddonConfigMap(ctx context.Context, addonYaml string, addonName string) (bool, error)
- func (c *Cluster) SyncLabelsAndTaints(ctx context.Context, currentCluster *Cluster) error
- func (c *Cluster) TunnelHosts(ctx context.Context) error
- func (c *Cluster) UpdateClusterCurrentState(ctx context.Context, fullState *FullState) error
- func (c *Cluster) UpdateClusterCurrentStateForSingleCloud(ctx context.Context, fullState *FullState) (*FullState, error)
- func (c *Cluster) ValidateCluster() error
- type FullState
- type State
Constants ¶
View Source
const ( NginxIngressAddonAppName = "ingress-nginx" CoreDNSAddonAppName = "coredns" )
View Source
const ( PortCheckContainer = "zke-port-checker" EtcdPortListenContainer = "zke-etcd-port-listener" CPPortListenContainer = "zke-cp-port-listener" WorkerPortListenContainer = "zke-worker-port-listener" KubeAPIPort = "6443" EtcdPort1 = "2379" EtcdPort2 = "2380" EtcdPort3 = "2381" ScedulerPort = "10251" ControllerPort = "10252" KubeletPort = "10250" KubeProxyPort = "10256" FlannetVXLANPortUDP = "8472" ProtocolTCP = "TCP" ProtocolUDP = "UDP" NoNetworkPlugin = "none" FlannelNetworkPlugin = "flannel" CalicoNetworkPlugin = "calico" CalicoCloudProvider = "calico_cloud_provider" FlannelInterface = "FlannelInterface" FlannelBackend = "FlannelBackend" FlannelIface = "flannel_iface" FlannelBackendType = "flannel_backend_type" FlannelBackendDirectrouting = "flannel_vxlan_directrouting" // EtcdEndpoints is the server address for Etcd, used by calico EtcdEndpoints = "EtcdEndpoints" // APIRoot is the kubernetes API address APIRoot = "APIRoot" // kubernetes client certificates and kubeconfig paths EtcdClientCert = "EtcdClientCert" EtcdClientKey = "EtcdClientKey" EtcdClientCA = "EtcdClientCA" EtcdClientCertPath = "EtcdClientCertPath" EtcdClientKeyPath = "EtcdClientKeyPath" EtcdClientCAPath = "EtcdClientCAPath" ClientCertPath = "ClientCertPath" ClientKeyPath = "ClientKeyPath" ClientCAPath = "ClientCAPath" RBACConfig = "RBACConfig" ClusterVersion = "ClusterVersion" )
View Source
const ( AuthnX509Provider = "x509" AuthnWebhookProvider = "webhook" StateConfigMapName = "cluster-state" ClusterConfigMapName = "cluster-config" UpdateStateTimeout = 30 GetStateTimeout = 30 KubernetesClientTimeOut = 30 NoneAuthorizationMode = "none" LocalNodeAddress = "127.0.0.1" LocalNodeHostname = "localhost" LocalNodeUser = "root" ControlPlane = "controlPlane" WorkerPlane = "workerPlan" EtcdPlane = "etcd" KubeAppLabel = "k8s-app" AppLabel = "app" NameLabel = "name" )
View Source
const ( DefaultSSHUser = "zcloud" DefaultSSHPort = "22" DefaultSSHKeyPath = "~/.ssh/id_rsa" DefaultDockerSockPath = "/var/run/docker.sock" DefaultClusterName = "local" DefaultK8sVersion = types.DefaultK8s DefaultServiceClusterIPRange = "10.43.0.0/16" DefaultClusterCIDR = "10.42.0.0/16" DefaultNodePortRange = "30000-32767" DefaultClusterDomain = "cluster.local" DefaultClusterDNSService = "10.43.0.10" DefaultNetworkPlugin = "flannel" DefaultFlannelBackendType = "vxlan" DefaultDNSProvider = "coredns" DefaultAuthStrategy = "x509" DefaultAuthorizationMode = "rbac" DefaultIngressController = "nginx" DefaultEtcdBackupCreationPeriod = "12h" DefaultEtcdBackupRetentionPeriod = "72h" DefaultEtcdSnapshot = true DefaultEtcdBackupConfigIntervalHours = 12 DefaultEtcdBackupConfigRetention = 6 DefaultEtcdHeartbeatIntervalName = "heartbeat-interval" DefaultEtcdHeartbeatIntervalValue = "500" DefaultEtcdElectionTimeoutName = "election-timeout" DefaultEtcdElectionTimeoutValue = "5000" DefaultMonitorMetricsProvider = "metrics-server" DefaultIngressNodeSelector = "node-role.kubernetes.io/edge" DefaultAuthnWebhookFile = `` /* 321-byte string literal not displayed */ DefaultAuthnCacheTimeout = "5s" DefaultConfigVersion = "v1.0.10" )
View Source
const ( ContainerName = "file-deployer" ServiceName = "file-deploy" ConfigEnv = "FILE_DEPLOY" )
View Source
const ( EtcdPathPrefix = "/registry" ContainerNameLabel = "zcloud.cn.zke.container.name" CloudConfigSumEnv = "ZKE_CLOUD_CONFIG_CHECKSUM" DefaultToolsEntrypoint = "/opt/zke-tools/entrypoint.sh" DefaultToolsEntrypointVersion = "0.1.13" LegacyToolsEntrypoint = "/opt/zke/entrypoint.sh" KubeletDockerConfigEnv = "ZKE_KUBELET_DOCKER_CONFIG" KubeletDockerConfigFileEnv = "ZKE_KUBELET_DOCKER_FILE" KubeletDockerConfigPath = "/var/lib/kubelet/config.json" )
View Source
const (
SupportedSyncToolsVersion = "0.1.22"
)
Variables ¶
View Source
var ControlPlanePortList = []string{ KubeAPIPort, }
View Source
var DefaultUpstreamDNS = []string{"114.114.114.114", "223.5.5.5"}
View Source
var EtcdClientPortList = []string{ EtcdPort1, }
View Source
var EtcdPortList = []string{ EtcdPort1, EtcdPort2, EtcdPort3, }
View Source
var WorkerPortList = []string{ KubeletPort, }
Functions ¶
func ApplyAuthzResources ¶
func ApplyAuthzResources(ctx context.Context, zkeConfig types.ZKEConfig, k8sClient *kubernetes.Clientset, dailersOptions hosts.DialersOptions) error
func BuildZKEConfigNodePlan ¶
func BuildZKEConfigNodePlan(ctx context.Context, myCluster *Cluster, host *hosts.Host, hostDockerInfo dockertypes.Info) types.ZKENodePlan
func CheckEtcdHostsChanged ¶
func GetAddonsExecuteJob ¶
func GetK8sVersion ¶
func GetTagMajorVersion ¶
func ParseConfig ¶
func RebuildKubeconfig ¶
func ReconcileCluster ¶
func SetUpAuthentication ¶
func ValidateHostCount ¶
Types ¶
type AddonError ¶
type AddonError struct { IsCritical bool // contains filtered or unexported fields }
func (*AddonError) Error ¶
func (e *AddonError) Error() string
type Cluster ¶
type Cluster struct { types.ZKEConfig `yaml:",inline"` KubeConfig string AuthnStrategies map[string]bool Certificates map[string]pki.CertificatePKI DockerDialerFactory hosts.DialerFactory K8sWrapTransport k8s.WrapTransport KubeClient *kubernetes.Clientset KubernetesServiceIP net.IP PrivateRegistriesMap map[string]types.PrivateRegistry ControlPlaneHosts []*hosts.Host EtcdHosts []*hosts.Host EtcdReadyHosts []*hosts.Host InactiveHosts []*hosts.Host WorkerHosts []*hosts.Host EdgeHosts []*hosts.Host }
func InitClusterObject ¶
func (*Cluster) ApplySystemAddonExecuteJob ¶
func (*Cluster) BuildEtcdProcess ¶
func (*Cluster) BuildKubeAPIProcess ¶
func (*Cluster) BuildKubeControllerProcess ¶
func (*Cluster) BuildKubeProxyProcess ¶
func (*Cluster) BuildKubeletProcess ¶
func (*Cluster) BuildProxyProcess ¶
func (*Cluster) BuildSchedulerProcess ¶
func (*Cluster) BuildSidecarProcess ¶
func (*Cluster) CheckClusterPorts ¶
func (*Cluster) DeployControlPlane ¶
func (*Cluster) DoAddonDeploy ¶
func (*Cluster) GetClusterState ¶
func (*Cluster) GetHostInfoMap ¶
func (c *Cluster) GetHostInfoMap() map[string]dockertypes.Info
func (*Cluster) GetKubernetesServicesOptions ¶
func (c *Cluster) GetKubernetesServicesOptions() types.KubernetesServicesOptions
func (*Cluster) PrepareBackup ¶
func (*Cluster) RestoreEtcdSnapshot ¶
func (*Cluster) SetupDialers ¶
func (*Cluster) SnapshotEtcd ¶
func (*Cluster) StoreAddonConfigMap ¶
func (*Cluster) SyncLabelsAndTaints ¶
func (*Cluster) UpdateClusterCurrentState ¶
func (*Cluster) UpdateClusterCurrentStateForSingleCloud ¶
func (*Cluster) ValidateCluster ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.