zdpgo_k8s

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 8 Imported by: 0

README

zdpgo_k8s

使用Golang快捷操作k8s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8S

type K8S struct {
	// contains filtered or unexported fields
}

k8s核心结构体

func New

func New(config K8SConfig) *K8S

func (*K8S) CreateMysql

func (k *K8S) CreateMysql(version uint8, in bool) (string, error)

CreateMysql 创建MySQL @param version 版本号,可选8或者5 @param in 是否只在k8s集群内部访问

func (*K8S) CreateRC

func (k *K8S) CreateRC(fileName string) (string, error)

CreateRC 创建RC @param fileName 配置文件的名称

func (*K8S) CreateService

func (k *K8S) CreateService(fileName string) (string, error)

CreateRC 创建Service @param fileName 配置文件的名称

func (*K8S) InstallKafka

func (k *K8S) InstallKafka() (string, error)

安装kafka

func (*K8S) InstallKafkaManager

func (k *K8S) InstallKafkaManager() (string, error)

安装kafka manager

func (*K8S) InstallStorageClass

func (k *K8S) InstallStorageClass() (string, error)

安装StorageClass

func (*K8S) InstallZookeeper

func (k *K8S) InstallZookeeper() (string, error)

安装zookeeper

func (*K8S) IsDebug

func (k *K8S) IsDebug() bool

判断是否为debug模式

func (*K8S) IsHealth

func (k *K8S) IsHealth() bool

判断是否为健康状态

func (*K8S) SetDebug

func (k *K8S) SetDebug(debug bool)

设置debug模式

func (*K8S) UploadFlannelConfig

func (k *K8S) UploadFlannelConfig()

上传k8s Flannel配置文件

func (*K8S) UploadInstallDockerOnCentos

func (k *K8S) UploadInstallDockerOnCentos()

在centos8上安装docker @param host: 主机地址 @param username: 用户名 @param password: 密码 @param port: 端口号,默认是200

type K8SConfig

type K8SConfig struct {
	Host        string // 主机地址
	Port        int    // SSH端口号
	Username    string // 登录用户名
	Password    string // 登录密码
	LogFilePath string // 日志文件路径
	Debug       bool   // 是否为debug模式
}

k8s配置结构体

Jump to

Keyboard shortcuts

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