Documentation ¶
Index ¶
- Constants
- type ClusterCfg
- func (cfg *ClusterCfg) GenerateCertSANs(clusterName string) []string
- func (cfg *ClusterCfg) GenerateExternalEtcdCfg() ExternalEtcd
- func (cfg *ClusterCfg) GenerateHosts() []string
- func (cfg *ClusterCfg) GenerateKubeadmCfg() *KubeadmCfg
- func (cfg *ClusterCfg) GroupHosts() (*Hosts, *Hosts, *Hosts, *Hosts, *Hosts)
- type ExternalEtcd
- type File
- type Host
- type HostCfg
- type Hosts
- type KubeadmCfg
- type LBKubeApiserverCfg
- type NetworkConfig
- type NodeInfo
- type SysInfo
- type Taint
- type TaintEffect
Constants ¶
View Source
const ( DefaultPreDir = "/tmp/kubekey" DefaultSSHPort = "22" DefaultDockerSockPath = "/var/run/docker.sock" DefaultLBPort = "6443" DefaultLBDomain = "lb.kubesphere.local" DefaultNetworkPlugin = "calico" DefaultPodsCIDR = "10.233.64.0/18" DefaultServiceCIDR = "10.233.0.0/18" DefaultKubeImageRepo = "kubekey" DefaultClusterName = "cluster.local" DefaultArch = "amd64" DefaultHostName = "allinone" DefaultEtcdRepo = "kubekey/etcd" DefaultEtcdVersion = "v3.3.12" DefaultEtcdPort = "2379" DefaultKubeVersion = "v1.17.4" DefaultCniVersion = "v0.8.2" DefaultHelmVersion = "v3.1.2" ETCDRole = "etcd" MasterRole = "master" WorkerRole = "worker" )
View Source
const (
DefaultSSHModel = "ssh"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterCfg ¶
type ClusterCfg struct { Hosts []HostCfg `yaml:"hosts" json:"hosts,omitempty"` LBKubeApiserver LBKubeApiserverCfg `yaml:"lb_kubeapiserver" json:"lb_kubeapiserver,omitempty"` KubeVersion string `yaml:"kube_version" json:"kube_version,omitempty"` KubeImageRepo string `yaml:"kube_image_repo" json:"kube_image_repo,omitempty"` KubeClusterName string `yaml:"kube_cluster_name" json:"kube_cluster_name,omitempty"` Network NetworkConfig `yaml:"network" json:"network,omitempty"` }
func GetClusterCfg ¶
func GetClusterCfg(clusterCfgFile string) *ClusterCfg
func GetYamlFile ¶
func GetYamlFile(filePath string) (*ClusterCfg, error)
func ResolveClusterInfoFile ¶
func ResolveClusterInfoFile(configFile string) (*ClusterCfg, error)
func (*ClusterCfg) GenerateCertSANs ¶
func (cfg *ClusterCfg) GenerateCertSANs(clusterName string) []string
func (*ClusterCfg) GenerateExternalEtcdCfg ¶
func (cfg *ClusterCfg) GenerateExternalEtcdCfg() ExternalEtcd
func (*ClusterCfg) GenerateHosts ¶
func (cfg *ClusterCfg) GenerateHosts() []string
func (*ClusterCfg) GenerateKubeadmCfg ¶
func (cfg *ClusterCfg) GenerateKubeadmCfg() *KubeadmCfg
func (*ClusterCfg) GroupHosts ¶
type ExternalEtcd ¶
type Host ¶
type Host struct { Host HostCfg IsEtcd bool IsMaster bool IsWorker bool PrivilegeCmd string Cmd string SShMode string SysInfo SysInfo }
func (*Host) NewSysInfo ¶
type HostCfg ¶
type HostCfg struct { HostName string `yaml:"hostName,omitempty" json:"hostName,omitempty"` Address string `yaml:"address" json:"address,omitempty"` Port string `yaml:"port" json:"port,omitempty"` InternalAddress string `yaml:"internal_address" json:"internalAddress,omitempty"` Role []string `yaml:"role" json:"role,omitempty" norman:"type=array[enum],options=etcd|worker|worker"` //HostnameOverride string `yaml:"hostname_override" json:"hostnameOverride,omitempty"` User string `yaml:"user" json:"user,omitempty"` Password string `yaml:"password" json:"password,omitempty"` //SSHAgentAuth bool `yaml:"ssh_agent_auth,omitempty" json:"sshAgentAuth,omitempty"` //SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty" norman:"type=password"` SSHKeyPath string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"` }
type KubeadmCfg ¶
type LBKubeApiserverCfg ¶
type NetworkConfig ¶
type Taint ¶
type Taint struct { Key string `json:"key,omitempty" yaml:"key"` Value string `json:"value,omitempty" yaml:"value"` Effect TaintEffect `json:"effect,omitempty" yaml:"effect"` }
type TaintEffect ¶
type TaintEffect string
const ( TaintEffectNoSchedule TaintEffect = "NoSchedule" TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" TaintEffectNoExecute TaintEffect = "NoExecute" )
Click to show internal directories.
Click to hide internal directories.