biz

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeInitShell           string = "init.sh"
	KubernetesSowfwareShell string = "kubernetes-software.sh"
)
View Source
var ARCH_MAP = map[string]string{
	"x86_64":  "amd64",
	"aarch64": "arm64",
}
View Source
var KubeProxyConfig = `apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration`
View Source
var KubeadmClusterConfig = `` /* 243-byte string literal not displayed */

kubeadm-cluster.conf

View Source
var KubeadmInitConfig = fmt.Sprintf(`apiVersion: kubeadm.k8s.io/v1beta4
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: %s
  bindPort: 6443`, "192.168.1.1")

kubeadm-init.conf

View Source
var KubeadmJoinConfig = `` /* 146-byte string literal not displayed */

kubeadm-join.conf

View Source
var KubeadmResetConfig = `apiVersion: kubeadm.k8s.io/v1beta4
kind: ResetConfiguration`
View Source
var KubeadmUpgradeConfig = `apiVersion: kubeadm.k8s.io/v1beta4
kind: UpgradeConfiguration`
View Source
var KubeletConfig = `apiVersion: kubelet.config.k8s.io/v1
kind: KubeletConfiguration`

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Cloud

type Cloud struct {
	ID                       int64  `json:"id" gorm:"column:id;primaryKey;AUTO_INCREMENT"`
	NodeID                   int64  `json:"node_id" gorm:"column:node_id"`
	NodeName                 string `json:"node_name" gorm:"column:node_name"`
	ClusterVersion           string `json:"cluster_version" gorm:"column:cluster_version"`
	Token                    string `json:"token" gorm:"column:token"`
	DiscoveryTokenCACertHash string `json:"discovery_token_ca_cert_hash" gorm:"column:discovery_token_ca_cert_hash"`
	ControlPlaneEndpoint     string `json:"control_plane_endpoint" gorm:"column:control_plane_endpoint"`
	JoinConfig               string `json:"join_config" gorm:"column:join_config"`
}

type CloudRepo

type CloudRepo interface{}

type CloudUsecase

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

func NewCloudUseCase

func NewCloudUseCase(conf *conf.Server, cloudRepo CloudRepo, logger log.Logger) *CloudUsecase

func (*CloudUsecase) InstallKubeadmKubeletCriO

func (uc *CloudUsecase) InstallKubeadmKubeletCriO(ctx context.Context, cloud *Cloud) error

func (*CloudUsecase) KubeadmInit

func (uc *CloudUsecase) KubeadmInit(ctx context.Context, cloud *Cloud) error

func (*CloudUsecase) KubeadmJoin

func (uc *CloudUsecase) KubeadmJoin(ctx context.Context, cloud *Cloud) error

func (*CloudUsecase) KubeadmReset

func (uc *CloudUsecase) KubeadmReset(ctx context.Context, cloud *Cloud) error

kubeadm reset

func (*CloudUsecase) KubeadmUpgrade

func (uc *CloudUsecase) KubeadmUpgrade(ctx context.Context, cloud *Cloud) error

kubeadm upgrade

func (*CloudUsecase) KubeadmUpgradePlan

func (uc *CloudUsecase) KubeadmUpgradePlan(ctx context.Context, cloud *Cloud) error

kubeadm upgrade plan

func (*CloudUsecase) NodeInit

func (uc *CloudUsecase) NodeInit(ctx context.Context, cloud *Cloud) error

type System

type System struct {
	ID         int64  `json:"id" gorm:"column:id;primaryKey;AUTO_INCREMENT"`
	OS         string `json:"os" gorm:"column:os; default:''; NOT NULL"`
	OSInfo     string `json:"os_info" gorm:"column:os_info; default:''; NOT NULL"`
	ARCH       string `json:"arch" gorm:"column:arch; default:''; NOT NULL"`
	CPU        int32  `json:"cpu" gorm:"column:cpu; default:0; NOT NULL"`
	Memory     int32  `json:"memory" gorm:"column:memory; default:0; NOT NULL"`
	GPU        int32  `json:"gpu" gorm:"column:gpu; default:0; NOT NULL"`
	GpuSpec    string `json:"gpu_spec" gorm:"column:gpu_spec; default:''; NOT NULL"`
	DataDisk   int32  `json:"data_disk" gorm:"column:data_disk; default:0; NOT NULL"`
	Kernel     string `json:"kernel" gorm:"column:kernel; default:''; NOT NULL"`
	Container  string `json:"container" gorm:"column:container; default:''; NOT NULL"`
	Kubelet    string `json:"kubelet" gorm:"column:kubelet; default:''; NOT NULL"`
	KubeProxy  string `json:"kube_proxy" gorm:"column:kube_proxy; default:''; NOT NULL"`
	InternalIP string `json:"internal_ip" gorm:"column:internal_ip; default:''; NOT NULL"`
	MachineID  string `json:"machine_id" gorm:"column:machine_id; default:''; NOT NULL"`
}

type SystemRepo

type SystemRepo interface {
	GetSystem(ctx context.Context) (*System, error)
	SaveSystem(ctx context.Context, system *System) error
}

type SystemUsecase

type SystemUsecase struct {
	SystemRepo SystemRepo
	// contains filtered or unexported fields
}

func NewSystemUseCase

func NewSystemUseCase(systemRepo SystemRepo, logger log.Logger) *SystemUsecase

func (*SystemUsecase) GetSystem

func (s *SystemUsecase) GetSystem(ctx context.Context) (*System, error)

func (*SystemUsecase) InstallSoftware

func (s *SystemUsecase) InstallSoftware(softwares ...string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳