Documentation ¶
Index ¶
- Variables
- func ExecuteCommand()
- func ExecuteDomainCheck()
- func ExecuteRequest()
- func ExecuteSql()
- func GetConfig() (*rest.Config, error)
- func GetKubeClient(kubeconfig string) (kubeClient *kubernetes.Clientset, err error)
- func GetKubeInterface() *kubeInterface
- func GetPublicIP() string
- func InitC7nLogs(client *kubernetes.Clientset, namespace string)
- func InitConfiguration(kubeconfig, namespace string) *action.Configuration
- func InstallC7nTools(namespace string)
- func RunHelmInstall(client *action.Install, chart string, vals map[string]interface{}, ...) (*release.Release, error)
- type BackendTask
- type C7nLogs
- type ChartArgs
- type ChartValue
- type Children
- type Cli
- type Group
- type Helm3Client
- func (h *Helm3Client) Install(cArgs ChartArgs, vals map[string]interface{}, out io.Writer) (*release.Release, error)
- func (h *Helm3Client) Template(chartFile string, out io.Writer) (string, error)
- func (h *Helm3Client) Upgrade(cArgs ChartArgs, vals map[string]interface{}, out io.Writer) (*release.Release, error)
- type Host
- type Hostname
- type Interface
- type Inventory
- func (i *Inventory) AddHosts(IPs []string)
- func (i *Inventory) AddNewEtcd(ip string)
- func (i *Inventory) AddNewMasters(IPs []string)
- func (i *Inventory) AddNewWorkers(IPs []string)
- func (i *Inventory) GetHosts() []string
- func (i *Inventory) GetKubeMaster() []string
- func (i *Inventory) MoveToEtcd()
- func (i *Inventory) MoveToKubeMasters()
- func (i *Inventory) MoveToKubeWorkers()
- type K8sClient
- func (k *K8sClient) CreateImagePullSecret(server, username, password, secretName string) (*v1.Secret, error)
- func (k *K8sClient) CreateNamespace(namespace string) error
- func (k *K8sClient) CreatePv(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
- func (k *K8sClient) CreatePvc(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
- func (k *K8sClient) DeleteDaemonSet(namespace, daemonSet string) error
- func (k *K8sClient) DeletePvc(namespace, pvc string) error
- func (k *K8sClient) ExecCommand(podName, command string) error
- func (k *K8sClient) GetClientSet() *kubernetes.Clientset
- func (k *K8sClient) GetClusterResource() (int64, int64)
- func (k *K8sClient) GetNamespace(namespace string) (ns *v1.Namespace, err error)
- func (k *K8sClient) GetPv(pvName string) (pv *v1.PersistentVolume, err error)
- func (k *K8sClient) GetPvc(namespace, pvcName string) (pvc *v1.PersistentVolumeClaim, err error)
- func (k *K8sClient) GetServerVersion() (*version.Info, error)
- func (k *K8sClient) PatchServiceAccount(sa, ips string)
- type Metrics
- type PreValue
- type PreValueList
- type TaskInfo
- type Vars
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAnsibleVar = Vars{ SkipVerifyNode: false, KubeVersion: "1.16.9", LbMode: "openresty", LbKubeApiserverPort: 8443, KubePodSubnet: "10.244.0.0/18", KubeServiceSubnet: "10.244.64.0/18", KubeNetworkNodePrefix: 24, KubeMaxPods: 110, NetworkPlugin: "calico", KubeletRootDir: "/var/lib/kubelet", DockerStorageDir: "/var/lib/docker", EtcdDataDir: "/var/lib/etcd", }
Functions ¶
func ExecuteCommand ¶
func ExecuteCommand()
func ExecuteDomainCheck ¶
func ExecuteDomainCheck()
func ExecuteRequest ¶
func ExecuteRequest()
func ExecuteSql ¶
func ExecuteSql()
func GetKubeClient ¶
func GetKubeClient(kubeconfig string) (kubeClient *kubernetes.Clientset, err error)
创建 kubernetes 的客户端
func GetPublicIP ¶
func GetPublicIP() string
func InitC7nLogs ¶
func InitC7nLogs(client *kubernetes.Clientset, namespace string)
func InitConfiguration ¶
func InitConfiguration(kubeconfig, namespace string) *action.Configuration
func InstallC7nTools ¶
func InstallC7nTools(namespace string)
Types ¶
type BackendTask ¶
type ChartValue ¶
type Cli ¶
type Cli struct { IP string //IP地址 Username string //用户名 Password string //密码 Port int //端口号 LastResult string //最近一次Run的结果 // contains filtered or unexported fields }
func NewSSHClient ¶
创建命令行对象 @param ip IP地址 @param username 用户名 @param password 密码 @param port 端口号,默认22
type Helm3Client ¶
type Helm3Client struct {
*action.Configuration
}
helmClient 使用单例模式,
func NewHelm3Client ¶
func NewHelm3Client(cfg *action.Configuration) *Helm3Client
type Interface ¶
type Interface interface { GetConfig() *config.C7nConfig GetHelmClient() *Helm3Client }
Interface represents a client capable of
type Inventory ¶
type Inventory struct {
All Group `yaml:"all"`
}
func (*Inventory) AddNewEtcd ¶
func (*Inventory) AddNewMasters ¶
func (*Inventory) AddNewWorkers ¶
func (*Inventory) GetKubeMaster ¶
func (*Inventory) MoveToEtcd ¶
func (i *Inventory) MoveToEtcd()
func (*Inventory) MoveToKubeMasters ¶
func (i *Inventory) MoveToKubeMasters()
func (*Inventory) MoveToKubeWorkers ¶
func (i *Inventory) MoveToKubeWorkers()
type K8sClient ¶
type K8sClient struct { Namespace string // contains filtered or unexported fields }
func NewK8sClient ¶
func NewK8sClient(kclient *kubernetes.Clientset, ns string) *K8sClient
func (*K8sClient) CreateImagePullSecret ¶
func (*K8sClient) CreateNamespace ¶
func (*K8sClient) CreatePv ¶
func (k *K8sClient) CreatePv(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
func (*K8sClient) CreatePvc ¶
func (k *K8sClient) CreatePvc(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
func (*K8sClient) DeleteDaemonSet ¶
func (*K8sClient) ExecCommand ¶
func (*K8sClient) GetClientSet ¶
func (k *K8sClient) GetClientSet() *kubernetes.Clientset
func (*K8sClient) GetClusterResource ¶
func (*K8sClient) GetNamespace ¶
func (*K8sClient) GetPv ¶
func (k *K8sClient) GetPv(pvName string) (pv *v1.PersistentVolume, err error)
Get exist pv
func (*K8sClient) GetPvc ¶
func (k *K8sClient) GetPvc(namespace, pvcName string) (pvc *v1.PersistentVolumeClaim, err error)
Get exist pvc
func (*K8sClient) PatchServiceAccount ¶
type Metrics ¶
type PreValueList ¶
type PreValueList []*PreValue
type TaskInfo ¶
type TaskInfo struct { // 唯一值 Name string Namespace string RefName string // 任务类型: Release, task, persistence Type string // 资源对象的状态 Status string // 错误原因 Reason string Date time.Time // 保存的配置项 Values []ChartValue Resource config.Resource TaskType string Version string Prefix string }
TaskInfo 用于保存安装过程中的信息,包括 Release 的配置项,以及其他的状态等
保存到 k8s cm 中,Type 将 task 分为3类:release,task,persistent
func NewReleaseJobTask ¶
func NewReleaseTask ¶
type Vars ¶
type Vars struct { SkipVerifyNode bool `yaml:"skip_verify_node"` KubeVersion string `yaml:"kube_version,omitempty"` LbMode string `yaml:"lb_mode,omitempty"` LbKubeApiserverPort int `yaml:"lb_kube_apiserver_port,omitempty"` KubePodSubnet string `yaml:"kube_pod_subnet,omitempty"` KubeServiceSubnet string `yaml:"kube_service_subnet,omitempty"` KubeNetworkNodePrefix int `yaml:"kube_network_node_prefix,omitempty"` KubeMaxPods int `yaml:"kube_max_pods,omitempty"` NetworkPlugin string `yaml:"network_plugin,omitempty"` KubeletRootDir string `yaml:"kubelet_root_dir,omitempty"` DockerStorageDir string `yaml:"docker_storage_dir,omitempty"` EtcdDataDir string `yaml:"etcd_data_dir,omitempty"` }
Click to show internal directories.
Click to hide internal directories.