controller

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: LGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//APIVersionSecret -
	APIVersionSecret = "v1"
	//APIVersionConfigMap -
	APIVersionConfigMap = "v1"
	//APIVersionPersistentVolumeClaim -
	APIVersionPersistentVolumeClaim = "v1"
	//APIVersionStatefulSet -
	APIVersionStatefulSet = "apps/v1"
	//APIVersionDeployment -
	APIVersionDeployment = "apps/v1"
	//APIVersionJob -
	APIVersionJob = "batch/v1"
	//APIVersionCronJob -
	APIVersionCronJob = "batch/v1"
	//APIVersionBetaCronJob -
	APIVersionBetaCronJob = "batch/v1beta1"
	//APIVersionService -
	APIVersionService = "v1"
	//APIVersionV1Ingress -
	APIVersionV1Ingress = "networking.k8s.io/v1"
	//APIVersionV1beta1Ingress -
	APIVersionV1beta1Ingress = "networking.k8s.io/v1beta1"
	//APIVersionHorizontalPodAutoscaler -q
	APIVersionHorizontalPodAutoscaler = "autoscaling/v2"
	//APIVersionGateway -
	APIVersionGateway = "gateway.networking.k8s.io/v1beta1"
	//APIVersionHTTPRoute -
	APIVersionHTTPRoute = "gateway.networking.k8s.io/v1beta1"
)
View Source
var ErrPodStatus = errors.New("pod status error")

ErrPodStatus pod status error

View Source
var ErrWaitCancel = errors.New("wait cancel")

ErrWaitCancel wait cancel

View Source
var ErrWaitTimeOut = errors.New("wait time out")

ErrWaitTimeOut wait time out

Functions

func CheckFileExist added in v1.1.0

func CheckFileExist(fileName string) bool

CheckFileExist check whether the file exists

func CreateKubeService

func CreateKubeService(client kubernetes.Interface, namespace string, services ...*corev1.Service) error

CreateKubeService create kube service

func Replicas

func Replicas(n int) []byte

Replicas petch replicas to n

func WaitReady

func WaitReady(store store.Storer, a *v1.AppService, timeout time.Duration, logger event.Logger, cancel chan struct{}) (err error)

WaitReady wait ready

func WaitStop

func WaitStop(store store.Storer, a *v1.AppService, timeout time.Duration, logger event.Logger, cancel chan struct{}) error

WaitStop wait service stop complete

func WaitUpgradeReady

func WaitUpgradeReady(store store.Storer, a *v1.AppService, timeout time.Duration, logger event.Logger, cancel chan struct{}) (err error)

WaitUpgradeReady wait upgrade success

Types

type Controller

type Controller interface {
	Begin()
	Stop() error
}

Controller service operating controller interface

type Manager

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

Manager controller manager

func NewManager

func NewManager(store store.Storer, client kubernetes.Interface, runtimeClient client.Client) *Manager

NewManager new manager

func (*Manager) GetControllerSize

func (m *Manager) GetControllerSize() int

GetControllerSize get running controller number

func (*Manager) StartController

func (m *Manager) StartController(controllerType TypeController, apps ...v1.AppService) error

StartController create and start service controller

func (*Manager) StartExportHelmChartController added in v1.1.0

func (m *Manager) StartExportHelmChartController(appName, appVersion string, end bool, apps ...v1.AppService) error

func (*Manager) StartExportK8sYamlController added in v1.1.0

func (m *Manager) StartExportK8sYamlController(appName, appVersion string, end bool, apps ...v1.AppService) error

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stop all controller

type TypeController

type TypeController string

TypeController controller type

var TypeApplyConfigController TypeController = "apply_config"

TypeApplyConfigController -

var TypeApplyRuleController TypeController = "apply_rule"

TypeApplyRuleController -

var TypeControllerExportHelmChart TypeController = "export_helm_chart"

TypeControllerExportHelmChart -

var TypeControllerExportK8sYaml TypeController = "export_k8s_yaml"

TypeControllerExportK8sYaml -

var TypeControllerRefreshHPA TypeController = "refreshhpa"

TypeControllerRefreshHPA -

var TypeRestartController TypeController = "restart"

TypeRestartController restart service type

var TypeScalingController TypeController = "scaling"

TypeScalingController start service type

var TypeStartController TypeController = "start"

TypeStartController start service type

var TypeStopController TypeController = "stop"

TypeStopController start service type

var TypeUpgradeController TypeController = "upgrade"

TypeUpgradeController start service type

type WutongExport added in v1.1.0

type WutongExport struct {
	ImageDomain     string                       `json:"imageDomain"`
	StorageClass    string                       `json:"storageClass"`
	ExternalDomains map[string]map[string]string `json:"externalDomains"`
	ConfigGroups    map[string]map[string]string `json:"secretEnvs"`
}

WutongExport -

Jump to

Keyboard shortcuts

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