Documentation ¶
Index ¶
- Variables
- func GetInitStorageClass() []*storagev1.StorageClass
- func GetReplicaSetVersion(rs *v1.ReplicaSet) int
- type AbnormalInfo
- type AppService
- func (a *AppService) DeleteConfigMaps(config *corev1.ConfigMap)
- func (a *AppService) DeleteDeployment(d *v1.Deployment)
- func (a *AppService) DeleteIngress(d *extensions.Ingress)
- func (a *AppService) DeletePods(d *corev1.Pod)
- func (a *AppService) DeleteReplicaSet(d *v1.ReplicaSet)
- func (a *AppService) DeleteSecrets(d *corev1.Secret)
- func (a *AppService) DeleteServices(service *corev1.Service)
- func (a *AppService) DeleteStatefulSet(d *v1.StatefulSet)
- func (a *AppService) GetCommonLabels(labels ...map[string]string) map[string]string
- func (a *AppService) GetConfigMaps() []*corev1.ConfigMap
- func (a *AppService) GetCurrentReplicaSet() *v1.ReplicaSet
- func (a *AppService) GetDelIngs() []*extensions.Ingress
- func (a *AppService) GetDelSecrets() []*corev1.Secret
- func (a AppService) GetDeployment() *v1.Deployment
- func (a *AppService) GetIngress() []*extensions.Ingress
- func (a *AppService) GetPodTemplate() *corev1.PodTemplateSpec
- func (a *AppService) GetPods() []*corev1.Pod
- func (a *AppService) GetReadyReplicas() int32
- func (a *AppService) GetReplicaSets() []*v1.ReplicaSet
- func (a *AppService) GetRunningVersion() string
- func (a *AppService) GetSecrets() []*corev1.Secret
- func (a *AppService) GetServiceStatus() string
- func (a *AppService) GetServices() []*corev1.Service
- func (a AppService) GetStatefulSet() *v1.StatefulSet
- func (a *AppService) GetTenant() *corev1.Namespace
- func (a *AppService) IsClosed() bool
- func (a *AppService) IsEmpty() bool
- func (a *AppService) Ready() bool
- func (a *AppService) SetAllSecrets(secrets []*corev1.Secret)
- func (a *AppService) SetConfigMap(d *corev1.ConfigMap)
- func (a *AppService) SetDelIngsSecrets(old *AppService)
- func (a *AppService) SetDeployment(d *v1.Deployment)
- func (a *AppService) SetIngress(d *extensions.Ingress)
- func (a *AppService) SetIngresses(i []*extensions.Ingress)
- func (a *AppService) SetPodTemplate(d corev1.PodTemplateSpec)
- func (a *AppService) SetPods(d *corev1.Pod)
- func (a *AppService) SetReplicaSets(d *v1.ReplicaSet)
- func (a *AppService) SetSecret(d *corev1.Secret)
- func (a *AppService) SetSecrets(s []*corev1.Secret)
- func (a *AppService) SetService(d *corev1.Service)
- func (a *AppService) SetServices(svcs []*corev1.Service)
- func (a *AppService) SetStatefulSet(d *v1.StatefulSet)
- func (a *AppService) SetTenant(d *corev1.Namespace)
- func (a *AppService) SetUpgradePatch(new *AppService) error
- func (a *AppService) String() string
- func (a *AppService) UpgradeComlete() bool
- type AppServiceBase
- type AppServiceStatus
- type AppServiceType
- type CacheKey
- type EncodeNode
- type TenantResource
- type TypeUpgradeMethod
Constants ¶
This section is empty.
Variables ¶
var ( //RUNNING if stateful or deployment exist and ready pod number is equal to the service Replicas RUNNING = "running" //CLOSED if app service is not in store CLOSED = "closed" //STARTING if stateful or deployment exist and ready pod number is less than service Replicas STARTING = "starting" //STOPPING if stateful and deployment is nil and pod number is not 0 STOPPING = "stopping" //ABNORMAL if stateful or deployment exist and ready pod number is less than service Replicas and all pod status is Error ABNORMAL = "abnormal" //SOMEABNORMAL if stateful or deployment exist and ready pod number is less than service Replicas and some pod status is Error SOMEABNORMAL = "some_abnormal" //UNKNOW indeterminacy status UNKNOW = "unknow" //UPGRADE if store have more than 1 app service UPGRADE = "upgrade" //BUILDING app service is building BUILDING = "building" //BUILDEFAILURE app service is build failure BUILDEFAILURE = "build_failure" //UNDEPLOY init status UNDEPLOY = "undeploy" )
var RainbondStatefuleLocalStorageClass = "rainbondslsc"
RainbondStatefuleLocalStorageClass rainbond support statefulset app local volume
RainbondStatefuleShareStorageClass rainbond support statefulset app share volume
Functions ¶
func GetInitStorageClass ¶
func GetInitStorageClass() []*storagev1.StorageClass
GetInitStorageClass get init storageclass list
func GetReplicaSetVersion ¶
func GetReplicaSetVersion(rs *v1.ReplicaSet) int
GetReplicaSetVersion get rs version
Types ¶
type AbnormalInfo ¶
type AbnormalInfo struct { ServiceID string `json:"service_id"` TenantID string `json:"tenant_id"` ServiceAlias string `json:"service_alias"` PodName string `json:"pod_name"` ContainerName string `json:"container_name"` Reason string `json:"reson"` Message string `json:"message"` CreateTime time.Time `json:"create_time"` Count int `json:"count"` }
AbnormalInfo pod Abnormal info Record the container exception exit information in pod.
func (AbnormalInfo) String ¶
func (a AbnormalInfo) String() string
type AppService ¶
type AppService struct { AppServiceBase Logger event.Logger UpgradePatch map[string][]byte // contains filtered or unexported fields }
AppService a service of rainbond app state in kubernetes
func (*AppService) DeleteConfigMaps ¶
func (a *AppService) DeleteConfigMaps(config *corev1.ConfigMap)
DeleteConfigMaps delete configmaps
func (*AppService) DeleteDeployment ¶
func (a *AppService) DeleteDeployment(d *v1.Deployment)
DeleteDeployment delete kubernetes deployment model
func (*AppService) DeleteIngress ¶
func (a *AppService) DeleteIngress(d *extensions.Ingress)
DeleteIngress delete kubernetes ingress model
func (*AppService) DeletePods ¶
func (a *AppService) DeletePods(d *corev1.Pod)
DeletePods delete pod
func (*AppService) DeleteReplicaSet ¶
func (a *AppService) DeleteReplicaSet(d *v1.ReplicaSet)
DeleteReplicaSet delete replicaset
func (*AppService) DeleteSecrets ¶
func (a *AppService) DeleteSecrets(d *corev1.Secret)
DeleteSecrets set srcrets
func (*AppService) DeleteServices ¶
func (a *AppService) DeleteServices(service *corev1.Service)
DeleteServices delete service
func (*AppService) DeleteStatefulSet ¶
func (a *AppService) DeleteStatefulSet(d *v1.StatefulSet)
DeleteStatefulSet set kubernetes statefulset model
func (*AppService) GetCommonLabels ¶
func (a *AppService) GetCommonLabels(labels ...map[string]string) map[string]string
GetCommonLabels get common labels
func (*AppService) GetConfigMaps ¶
func (a *AppService) GetConfigMaps() []*corev1.ConfigMap
GetConfigMaps get configmaps
func (*AppService) GetCurrentReplicaSet ¶
func (a *AppService) GetCurrentReplicaSet() *v1.ReplicaSet
GetCurrentReplicaSet get current replicaset
func (*AppService) GetDelIngs ¶
func (a *AppService) GetDelIngs() []*extensions.Ingress
GetDelIngs gets delIngs which need to be deleted
func (*AppService) GetDelSecrets ¶
func (a *AppService) GetDelSecrets() []*corev1.Secret
GetDelSecrets get delSecrets which need to be deleted
func (AppService) GetDeployment ¶
func (a AppService) GetDeployment() *v1.Deployment
GetDeployment get kubernetes deployment model
func (*AppService) GetIngress ¶
func (a *AppService) GetIngress() []*extensions.Ingress
GetIngress get ingress
func (*AppService) GetPodTemplate ¶
func (a *AppService) GetPodTemplate() *corev1.PodTemplateSpec
GetPodTemplate get pod template
func (*AppService) GetReadyReplicas ¶
func (a *AppService) GetReadyReplicas() int32
GetReadyReplicas get already ready pod number
func (*AppService) GetReplicaSets ¶
func (a *AppService) GetReplicaSets() []*v1.ReplicaSet
GetReplicaSets get replicaset
func (*AppService) GetRunningVersion ¶
func (a *AppService) GetRunningVersion() string
GetRunningVersion get running version
func (*AppService) GetSecrets ¶
func (a *AppService) GetSecrets() []*corev1.Secret
GetSecrets get secrets
func (*AppService) GetServiceStatus ¶
func (a *AppService) GetServiceStatus() string
GetServiceStatus get service status
func (*AppService) GetServices ¶
func (a *AppService) GetServices() []*corev1.Service
GetServices get services
func (AppService) GetStatefulSet ¶
func (a AppService) GetStatefulSet() *v1.StatefulSet
GetStatefulSet get kubernetes statefulset model
func (*AppService) GetTenant ¶
func (a *AppService) GetTenant() *corev1.Namespace
GetTenant get tenant namespace
func (*AppService) SetAllSecrets ¶
func (a *AppService) SetAllSecrets(secrets []*corev1.Secret)
SetAllSecrets sets secrets
func (*AppService) SetConfigMap ¶
func (a *AppService) SetConfigMap(d *corev1.ConfigMap)
SetConfigMap set kubernetes configmap model
func (*AppService) SetDelIngsSecrets ¶
func (a *AppService) SetDelIngsSecrets(old *AppService)
SetDelIngsSecrets sets delIngs and delSecrets
func (*AppService) SetDeployment ¶
func (a *AppService) SetDeployment(d *v1.Deployment)
SetDeployment set kubernetes deployment model
func (*AppService) SetIngress ¶
func (a *AppService) SetIngress(d *extensions.Ingress)
SetIngress set kubernetes ingress model
func (*AppService) SetIngresses ¶
func (a *AppService) SetIngresses(i []*extensions.Ingress)
SetIngresses sets k8s ingress list
func (*AppService) SetPodTemplate ¶
func (a *AppService) SetPodTemplate(d corev1.PodTemplateSpec)
SetPodTemplate set pod template spec
func (*AppService) SetReplicaSets ¶
func (a *AppService) SetReplicaSets(d *v1.ReplicaSet)
SetReplicaSets set kubernetes replicaset
func (*AppService) SetSecret ¶
func (a *AppService) SetSecret(d *corev1.Secret)
SetSecret set srcrets
func (*AppService) SetSecrets ¶
func (a *AppService) SetSecrets(s []*corev1.Secret)
SetSecrets sets k8s secret list
func (*AppService) SetService ¶
func (a *AppService) SetService(d *corev1.Service)
SetService set kubernetes service model
func (*AppService) SetServices ¶
func (a *AppService) SetServices(svcs []*corev1.Service)
SetServices set set k8s service model list
func (*AppService) SetStatefulSet ¶
func (a *AppService) SetStatefulSet(d *v1.StatefulSet)
SetStatefulSet set kubernetes statefulset model
func (*AppService) SetTenant ¶
func (a *AppService) SetTenant(d *corev1.Namespace)
SetTenant set tenant
func (*AppService) SetUpgradePatch ¶
func (a *AppService) SetUpgradePatch(new *AppService) error
SetUpgradePatch create and set upgrade pathch for deployment and statefulset
func (*AppService) String ¶
func (a *AppService) String() string
func (*AppService) UpgradeComlete ¶
func (a *AppService) UpgradeComlete() bool
UpgradeComlete upgrade comlete
type AppServiceBase ¶
type AppServiceBase struct { TenantID string TenantName string ServiceID string ServiceAlias string ServiceType AppServiceType DeployVersion string ContainerCPU int ContainerMemory int UpgradeMethod TypeUpgradeMethod Replicas int NeedProxy bool IsWindowsService bool CreaterID string //depend all service id Dependces []string ExtensionSet map[string]string }
AppServiceBase app service base info
type AppServiceStatus ¶
type AppServiceStatus string
AppServiceStatus the status of service, calculate in real time from kubernetes
type AppServiceType ¶
type AppServiceType string
AppServiceType the deploy type of service.
var TypeDeployment AppServiceType = "deployment"
TypeDeployment deployment
var TypeReplicationController AppServiceType = "replicationcontroller"
TypeReplicationController rc
var TypeStatefulSet AppServiceType = "statefulset"
TypeStatefulSet statefulset
type CacheKey ¶
type CacheKey string
CacheKey app cache key
func GetCacheKeyOnlyServiceID ¶
GetCacheKeyOnlyServiceID get cache key only service id
type EncodeNode ¶
type EncodeNode struct { Field map[string]EncodeNode // contains filtered or unexported fields }
EncodeNode encode node
func (*EncodeNode) Contrast ¶
func (e *EncodeNode) Contrast(endpoint *EncodeNode) bool
Contrast Compare value
func (*EncodeNode) GetChange ¶
func (e *EncodeNode) GetChange(endpoint *EncodeNode) *EncodeNode
GetChange get change fields
func (*EncodeNode) MarshalJSON ¶
func (e *EncodeNode) MarshalJSON() ([]byte, error)
MarshalJSON custom marshal json
func (*EncodeNode) UnmarshalJSON ¶
func (e *EncodeNode) UnmarshalJSON(code []byte) error
UnmarshalJSON custom yaml decoder
type TenantResource ¶
type TenantResource struct { TenantID string `json:"tenant_id,omitempty"` CPURequest int64 `json:"cpu_request,omitempty"` CPULimit int64 `json:"cpu_limit,omitempty"` MemoryRequest int64 `json:"memory_request,omitempty"` MemoryLimit int64 `json:"memory_limit,omitempty"` }
TenantResource tenant resource statistical models
type TypeUpgradeMethod ¶
type TypeUpgradeMethod string
TypeUpgradeMethod upgrade service method type
var OnDelete TypeUpgradeMethod = "OnDelete"
OnDelete Stop the old version before starting the new version the upgrade
var Rolling TypeUpgradeMethod = "Rolling"
Rolling Start the new version before stoping the old version the rolling upgrade