setupcluster

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotInstalled = iota
	ShouldBeInstalled
	Installed
	ShouldBeDeleted

	Unselected = NotInstalled
	Selected   = ShouldBeInstalled
)
View Source
const (
	ConfigMap      = "ConfigMap"
	Service        = "Service"
	VirtualService = "VirtualService"
	Secret         = "Secret"
	Deployment     = "Deployment"

	ApplicationIndex       = "nocalhostApplication"
	ApplicationConfigIndex = "nocalhostApplicationConfig"

	ClusterInformerFactory = "ClusterInformerFactory"
)
View Source
const (
	DefaultClusterDomain = "cluster.local"
)

Variables

This section is empty.

Functions

func IndexAppConfig

func IndexAppConfig(obj interface{}) ([]string, error)

func IndexByAppName

func IndexByAppName(obj interface{}) ([]string, error)

Types

type ClusterDevsSetUp

type ClusterDevsSetUp interface {
	CreateNS(namespace string, labels map[string]string) *clusterDevsSetUp
	CreateServiceAccount(name, namespace string) *clusterDevsSetUp
	CreateRole(name, namespace string) *clusterDevsSetUp
	CreateRoleBinding(name, namespace, clusterRole, toServiceAccount string) *clusterDevsSetUp
	GetServiceAccountSecret(name, namespace string) (*corev1.Secret, error)
	CreateResourceQuota(
		name, namespace, reqMem, reqCpu, limitsMem, limitsCpu, storageCapacity,
		ephemeralStorage, pvcCount, lbCount string,
	) *clusterDevsSetUp
	DeleteResourceQuota(name, namespace string) *clusterDevsSetUp
	CreateLimitRange(name, namespace, reqMem, limitsMem, reqCpu, limitsCpu, ephemeralStorage string) *clusterDevsSetUp
	DeleteLimitRange(name, namespace string) *clusterDevsSetUp
}

func NewClusterDevsSetUp

func NewClusterDevsSetUp(c *clientgo.GoClient) ClusterDevsSetUp

type DevKubeConfigReader

type DevKubeConfigReader interface {
	GetToken() *devKubeConfigReader
	GetCA() *devKubeConfigReader
	AssembleDevKubeConfig() *devKubeConfigReader
	ToYamlString() (string, error, error)
	ToStruct() (*clientcmdapi.Config, error, error)
}

func NewDevKubeConfigReader

func NewDevKubeConfigReader(s *corev1.Secret, server, namespace string) DevKubeConfigReader

type ExtendInformer

type ExtendInformer interface {
	informers.GenericInformer
	ByIndex(indexName, indexedValue string) []unstructured.Unstructured
	GetList() []unstructured.Unstructured
}

type Informer

type Informer struct {
	informers.GenericInformer
}

func (*Informer) ByIndex

func (informer *Informer) ByIndex(indexName, indexedValue string) []unstructured.Unstructured

func (*Informer) GetList

func (informer *Informer) GetList() []unstructured.Unstructured

type MeshDevApp

type MeshDevApp struct {
	Name      string            `json:"name"`
	Workloads []MeshDevWorkload `json:"workloads"`
}

type MeshDevInfo

type MeshDevInfo struct {
	BaseNamespace    string       `json:"-"`
	MeshDevNamespace string       `json:"namespace"`
	IsUpdateHeader   bool         `json:"-"`
	Header           model.Header `json:"header"`
	Apps             []MeshDevApp `json:"apps"`
	ReCreate         bool         `json:"-"`
	// contains filtered or unexported fields
}

func (*MeshDevInfo) SortApps

func (info *MeshDevInfo) SortApps()

func (*MeshDevInfo) Validate

func (info *MeshDevInfo) Validate() bool

type MeshDevWorkload

type MeshDevWorkload struct {
	Kind   string `json:"kind"`
	Name   string `json:"name"`
	Status int    `json:"status"`
}

type MeshManager

type MeshManager interface {
	InitMeshDevSpace(*MeshDevInfo) error
	UpdateMeshDevSpace(*MeshDevInfo) error
	DeleteTracingHeader(*MeshDevInfo) error
	GetBaseDevSpaceAppInfo(*MeshDevInfo) []MeshDevApp
	GetAPPInfo(*MeshDevInfo) ([]MeshDevApp, error)
	Rollback(*MeshDevInfo) error
	GetMeshNamespaceNames() []string
	// contains filtered or unexported methods
}

func NewMeshManager

func NewMeshManager(client *clientgo.GoClient) MeshManager

type SetUpCluster

type SetUpCluster interface {
	IsAdmin() (bool, error)
	CreateNs(namespace string, labels map[string]string) *setUpCluster
	CreateConfigMap(name, namespace, key, value string) *setUpCluster
	DeployNocalhostDep(namespace, serviceAccount, tag string) *setUpCluster
	GetClusterNode() *setUpCluster
	GetClusterVersion() *setUpCluster
	GetClusterInfo() *setUpCluster
	CreateServiceAccount(name, namespace string) *setUpCluster
	CreateClusterRoleBinding(name, namespace, role, toServiceAccount string) *setUpCluster
	CreateNocalhostPriorityClass() *setUpCluster
	GetErr() (string, error, error)
	InitCluster(tag string) (string, error, error)
	UpgradeCluster() (bool, error)
}

func NewSetUpCluster

func NewSetUpCluster(client *clientgo.GoClient) SetUpCluster

NewSetUpCluster cluster set up is a simple builder to operate the cluster, if err occur, we should store the err msg in err and errCode and then take it out at the end then we can skip same error while operate the k8s cluster

type SharedMeshManagerFactory

type SharedMeshManagerFactory interface {
	Manager(string) (MeshManager, error)
	Delete(string)
}

func GetSharedMeshManagerFactory

func GetSharedMeshManagerFactory() SharedMeshManagerFactory

func NewSharedMeshManagerFactory

func NewSharedMeshManagerFactory() SharedMeshManagerFactory

type SortAppsByName

type SortAppsByName []MeshDevApp

func (SortAppsByName) Len

func (a SortAppsByName) Len() int

func (SortAppsByName) Less

func (a SortAppsByName) Less(i, j int) bool

func (SortAppsByName) Swap

func (a SortAppsByName) Swap(i, j int)

type SortWorkloadsByKindAndName

type SortWorkloadsByKindAndName []MeshDevWorkload

func (SortWorkloadsByKindAndName) Len

func (SortWorkloadsByKindAndName) Less

func (w SortWorkloadsByKindAndName) Less(i, j int) bool

func (SortWorkloadsByKindAndName) Swap

func (w SortWorkloadsByKindAndName) Swap(i, j int)

Jump to

Keyboard shortcuts

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