Documentation ¶
Index ¶
- Constants
- Variables
- func GetLister(controller string) (interface{}, error)
- func JobReRun(namespace, jobName string) (string, error)
- func Run(stopChan chan struct{}, wg *sync.WaitGroup)
- type Application
- type ApplicationCtl
- func (ctl *ApplicationCtl) GetApp(clusterId string) (*Application, error)
- func (ctl *ApplicationCtl) GetAppInfo(appId string) (string, string, string, error)
- func (ctl *ApplicationCtl) GetRepo(repoId string) (string, error)
- func (ctl *ApplicationCtl) GetRuntime(runtimeId string) (string, error)
- func (ctl *ApplicationCtl) GetVersion(versionId string) (string, error)
- func (ctl *ApplicationCtl) GetWorkLoads(namespace string, clusterRoles []clusterRole) *workLoads
- func (ctl *ApplicationCtl) ListApplication(runtimeId string, match, fuzzy map[string]string, paging *Paging) (int, interface{}, error)
- type ClusterRole
- type ClusterRoleBindingCtl
- func (ctl *ClusterRoleBindingCtl) CountWithConditions(conditions string) int
- func (ctl *ClusterRoleBindingCtl) ListWithConditions(conditions string, paging *Paging, order string) (int, interface{}, error)
- func (ctl *ClusterRoleBindingCtl) Lister() interface{}
- func (ctl *ClusterRoleBindingCtl) Name() string
- type ClusterRoleCtl
- type CommonAttribute
- type ConfigMap
- type ConfigMapCtl
- type Container
- type Containers
- type Controller
- type ControllerRevisionCtl
- func (ctl *ControllerRevisionCtl) CountWithConditions(conditions string) int
- func (ctl *ControllerRevisionCtl) ListWithConditions(conditions string, paging *Paging, order string) (int, interface{}, error)
- func (ctl *ControllerRevisionCtl) Lister() interface{}
- func (ctl *ControllerRevisionCtl) Name() string
- type CronJob
- type CronJobCtl
- type Daemonset
- type DaemonsetCtl
- type DeleteRunTime
- type Deployment
- type DeploymentCtl
- type Ingress
- type IngressCtl
- type Job
- type JobCtl
- type JobRevision
- type JobRevisions
- type MapString
- type Namespace
- type NamespaceCtl
- func (ctl *NamespaceCtl) CountWithConditions(conditions string) int
- func (ctl *NamespaceCtl) CreateDefaultRoleAndRoleBinding(namespace *v1.Namespace) error
- func (ctl *NamespaceCtl) GetNamespaceQuota(namespace string) (v1.ResourceList, error)
- func (ctl *NamespaceCtl) ListWithConditions(conditions string, paging *Paging, order string) (int, interface{}, error)
- func (ctl *NamespaceCtl) Lister() interface{}
- func (ctl *NamespaceCtl) Name() string
- type Node
- type NodeCtl
- type Paging
- type Pod
- type PodCtl
- type Pvc
- type PvcCtl
- type ReplicaSetCtl
- type Role
- type RoleBindingCtl
- type RoleCtl
- type Secret
- type SecretCtl
- type Service
- type ServiceCtl
- type Statefulset
- type StatefulsetCtl
- type StorageClass
- type StorageClassCtl
- type Taints
Constants ¶
View Source
const ( Stopped = "stopped" PvcPending = "pending" Running = "running" Updating = "updating" Failed = "failed" Unfinished = "unfinished" Completed = "completed" Pause = "pause" Warning = "warning" Error = "error" DisplayName = "displayName" Pods = "pods" Deployments = "deployments" Daemonsets = "daemonsets" Statefulsets = "statefulsets" Namespaces = "namespaces" Ingresses = "ingresses" PersistentVolumeClaim = "persistent-volume-claims" Roles = "roles" RoleBindings = "role-bindings" ClusterRoles = "cluster-roles" ClusterRoleBindings = "cluster-role-bindings" Services = "services" StorageClasses = "storage-classes" Applications = "applications" Jobs = "jobs" Cronjobs = "cronjobs" Nodes = "nodes" Replicasets = "replicasets" ControllerRevisions = "controllerrevisions" ConfigMaps = "configmaps" Secrets = "secrets" )
View Source
const NodeRoleLabel = "node-role.kubernetes.io/"
Variables ¶
View Source
var ResourceControllers resourceControllers
Functions ¶
Types ¶
type Application ¶
type Application struct { Name string `json:"name"` RepoName string `json:"repoName"` Runtime string `json:"namespace"` RuntimeId string `json:"runtime_id"` Version string `json:"version"` VersionId string `json:"version_id"` Status string `json:"status"` UpdateTime time.Time `json:"updateTime"` CreateTime time.Time `json:"createTime"` App string `json:"app"` AppId string `json:"app_id"` Description string `json:"description,omitempty"` WorkLoads *workLoads `json:"workloads,omitempty"` Services *[]Service `json:"services,omitempty"` Ingresses *[]ing `json:"ingresses,omitempty"` ClusterID string `json:"cluster_id"` }
type ApplicationCtl ¶
type ApplicationCtl struct {
OpenpitrixAddr string
}
func (*ApplicationCtl) GetApp ¶
func (ctl *ApplicationCtl) GetApp(clusterId string) (*Application, error)
func (*ApplicationCtl) GetAppInfo ¶
func (*ApplicationCtl) GetRuntime ¶
func (ctl *ApplicationCtl) GetRuntime(runtimeId string) (string, error)
func (*ApplicationCtl) GetVersion ¶
func (ctl *ApplicationCtl) GetVersion(versionId string) (string, error)
func (*ApplicationCtl) GetWorkLoads ¶
func (ctl *ApplicationCtl) GetWorkLoads(namespace string, clusterRoles []clusterRole) *workLoads
func (*ApplicationCtl) ListApplication ¶
type ClusterRole ¶
type ClusterRoleBindingCtl ¶
type ClusterRoleBindingCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ClusterRoleBindingCtl) CountWithConditions ¶
func (ctl *ClusterRoleBindingCtl) CountWithConditions(conditions string) int
func (*ClusterRoleBindingCtl) ListWithConditions ¶
func (*ClusterRoleBindingCtl) Lister ¶
func (ctl *ClusterRoleBindingCtl) Lister() interface{}
func (*ClusterRoleBindingCtl) Name ¶
func (ctl *ClusterRoleBindingCtl) Name() string
type ClusterRoleCtl ¶
type ClusterRoleCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ClusterRoleCtl) CountWithConditions ¶
func (ctl *ClusterRoleCtl) CountWithConditions(conditions string) int
func (*ClusterRoleCtl) ListWithConditions ¶
func (*ClusterRoleCtl) Lister ¶
func (ctl *ClusterRoleCtl) Lister() interface{}
func (*ClusterRoleCtl) Name ¶
func (ctl *ClusterRoleCtl) Name() string
type CommonAttribute ¶
type CommonAttribute struct { K8sClient *kubernetes.Clientset Name string DB *gorm.DB // contains filtered or unexported fields }
func (*CommonAttribute) CloseDB ¶
func (ca *CommonAttribute) CloseDB()
type ConfigMap ¶
type ConfigMap struct { Name string `gorm:"primary_key" json:"name"` Namespace string `gorm:"primary_key" json:"namespace"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` Annotation MapString `json:"annotations"` Entries string `gorm:"type:text" json:"entries"` }
type ConfigMapCtl ¶
type ConfigMapCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ConfigMapCtl) CountWithConditions ¶
func (ctl *ConfigMapCtl) CountWithConditions(conditions string) int
func (*ConfigMapCtl) ListWithConditions ¶
func (*ConfigMapCtl) Lister ¶
func (ctl *ConfigMapCtl) Lister() interface{}
func (*ConfigMapCtl) Name ¶
func (ctl *ConfigMapCtl) Name() string
type Container ¶
type Container struct { Name string `json:"name"` Ready bool `json:"ready,omitempty"` Image string `json:"image"` Resources v1.ResourceRequirements `json:"resources"` Ports []v1.ContainerPort `json:"ports"` }
type Containers ¶
type Containers []Container
func (*Containers) Scan ¶
func (containers *Containers) Scan(val interface{}) error
type Controller ¶
type ControllerRevisionCtl ¶
type ControllerRevisionCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ControllerRevisionCtl) CountWithConditions ¶
func (ctl *ControllerRevisionCtl) CountWithConditions(conditions string) int
func (*ControllerRevisionCtl) ListWithConditions ¶
func (*ControllerRevisionCtl) Lister ¶
func (ctl *ControllerRevisionCtl) Lister() interface{}
func (*ControllerRevisionCtl) Name ¶
func (ctl *ControllerRevisionCtl) Name() string
type CronJob ¶
type CronJob struct { Name string `gorm:"primary_key" json:"name,omitempty"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace,omitempty"` Active int `json:"active"` Schedule string `json:"schedule"` Status string `json:"status"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` LastScheduleTime *time.Time `gorm:"column:lastScheduleTime" json:"lastScheduleTime,omitempty"` }
type CronJobCtl ¶
type CronJobCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*CronJobCtl) CountWithConditions ¶
func (ctl *CronJobCtl) CountWithConditions(conditions string) int
func (*CronJobCtl) ListWithConditions ¶
func (*CronJobCtl) Lister ¶
func (ctl *CronJobCtl) Lister() interface{}
func (*CronJobCtl) Name ¶
func (ctl *CronJobCtl) Name() string
type Daemonset ¶
type Daemonset struct { Name string `gorm:"primary_key" json:"name,omitempty"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace,omitempty"` App string `json:"app,omitempty"` Available int32 `json:"available"` Desire int32 `json:"desire"` Status string `json:"status"` NodeSelector string `json:"nodeSelector, omitempty"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type DaemonsetCtl ¶
type DaemonsetCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*DaemonsetCtl) CountWithConditions ¶
func (ctl *DaemonsetCtl) CountWithConditions(conditions string) int
func (*DaemonsetCtl) ListWithConditions ¶
func (*DaemonsetCtl) Lister ¶
func (ctl *DaemonsetCtl) Lister() interface{}
func (*DaemonsetCtl) Name ¶
func (ctl *DaemonsetCtl) Name() string
type DeleteRunTime ¶
type DeleteRunTime struct {
RuntimeId []string `json:"runtime_id"`
}
type Deployment ¶
type Deployment struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace"` App string `json:"app,omitempty"` Available int32 `json:"available"` Desire int32 `json:"desire"` Status string `json:"status"` Labels MapString `json:"labels"` Annotation MapString `json:"annotations"` UpdateTime time.Time `gorm:"column:updateTime" json:"updateTime,omitempty"` }
type DeploymentCtl ¶
type DeploymentCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*DeploymentCtl) CountWithConditions ¶
func (ctl *DeploymentCtl) CountWithConditions(conditions string) int
func (*DeploymentCtl) ListWithConditions ¶
func (*DeploymentCtl) Lister ¶
func (ctl *DeploymentCtl) Lister() interface{}
func (*DeploymentCtl) Name ¶
func (ctl *DeploymentCtl) Name() string
type Ingress ¶
type Ingress struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace"` Ip string `json:"ip,omitempty"` Rules string `gorm:"type:text" json:"rules, omitempty"` TlsTermination string `gorm:"column:tlsTermination" json:"tlsTermination,omitempty"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type IngressCtl ¶
type IngressCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*IngressCtl) CountWithConditions ¶
func (ctl *IngressCtl) CountWithConditions(conditions string) int
func (*IngressCtl) ListWithConditions ¶
func (*IngressCtl) Lister ¶
func (ctl *IngressCtl) Lister() interface{}
func (*IngressCtl) Name ¶
func (ctl *IngressCtl) Name() string
type Job ¶
type Job struct { Name string `gorm:"primary_key" json:"name,omitempty"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace,omitempty"` Completed int32 `json:"completed"` Desire int32 `json:"desire"` Status string `json:"status"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` UpdateTime time.Time `gorm:"column:updateTime" json:"updateTime,omitempty"` }
type JobCtl ¶
type JobCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*JobCtl) CountWithConditions ¶
func (*JobCtl) ListWithConditions ¶
type JobRevision ¶
type JobRevision struct { Status string `json:"status"` Reasons []string `json:"reasons"` Messages []string `json:"messages"` Succeed int32 `json:"succeed"` DesirePodNum int32 `json:"desire"` Failed int32 `json:"failed"` Uid string `json:"uid"` StartTime time.Time `json:"start-time"` CompletionTime time.Time `json:"completion-time"` }
type JobRevisions ¶
type JobRevisions map[int]JobRevision
type Namespace ¶
type Namespace struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Creator string `json:"creator,omitempty"` Status string `json:"status"` Descrition string `json:"description,omitempty"` Annotation MapString `json:"annotations"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` Usage v1.ResourceList `gorm:"-" json:"usage,omitempty"` }
type NamespaceCtl ¶
type NamespaceCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*NamespaceCtl) CountWithConditions ¶
func (ctl *NamespaceCtl) CountWithConditions(conditions string) int
func (*NamespaceCtl) CreateDefaultRoleAndRoleBinding ¶
func (ctl *NamespaceCtl) CreateDefaultRoleAndRoleBinding(namespace *v1.Namespace) error
func (*NamespaceCtl) GetNamespaceQuota ¶
func (ctl *NamespaceCtl) GetNamespaceQuota(namespace string) (v1.ResourceList, error)
func (*NamespaceCtl) ListWithConditions ¶
func (*NamespaceCtl) Lister ¶
func (ctl *NamespaceCtl) Lister() interface{}
func (*NamespaceCtl) Name ¶
func (ctl *NamespaceCtl) Name() string
type Node ¶
type Node struct { Name string `gorm:"primary_key" json:"name,omitempty"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Ip string `json:"ip"` Status string `json:"status"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` Taints Taints `json:"taints"` Msg string `json:"msg"` Role string `json:"role"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type NodeCtl ¶
type NodeCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*NodeCtl) CountWithConditions ¶
func (*NodeCtl) ListWithConditions ¶
type Pod ¶
type Pod struct { // search and sort field, not seen in response Name string `gorm:"primary_key" json:"-"` Namespace string `gorm:"primary_key" json:"-"` Node string `json:"-"` OwnerKind string `gorm:"column:ownerKind" json:"-"` OwnerName string `gorm:"column:ownerName" json:"-"` CreateTime time.Time `gorm:"column:createTime" json:"-"` // Kubernetes Standard Pod Specification Kind string `json:"kind,omitempty"` APIVersion string `gorm:"column:apiVersion" json:"apiVersion,omitempty"` Spec v1.PodSpec `sql:"-" json:"spec,omitempty"` Metadata v12.ObjectMeta `sql:"-" json:"metadata,omitempty"` Status v1.PodStatus `sql:"-" json:"status,omitempty"` // shadow field, used only for database MetadataString string `gorm:"column:metadata;type:text" json:"-"` SpecString string `gorm:"column:podSpec;type:text" json:"-"` StatusString string `gorm:"column:status;type:text" json:"-"` }
type PodCtl ¶
type PodCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*PodCtl) CountWithConditions ¶
func (*PodCtl) ListWithConditions ¶
type Pvc ¶
type Pvc struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace"` Status string `json:"status,omitempty"` Capacity string `json:"capacity,omitempty"` AccessMode string `gorm:"column:accessMode" json:"accessMode,omitempty"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` StorageClassName string `gorm:"column:storage_class" json:"storage_class,omitempty"` InUse bool `gorm:"column:inUse" json:"inUse"` }
type PvcCtl ¶
type PvcCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*PvcCtl) CountWithConditions ¶
func (*PvcCtl) ListWithConditions ¶
type ReplicaSetCtl ¶
type ReplicaSetCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ReplicaSetCtl) CountWithConditions ¶
func (ctl *ReplicaSetCtl) CountWithConditions(conditions string) int
func (*ReplicaSetCtl) ListWithConditions ¶
func (*ReplicaSetCtl) Lister ¶
func (ctl *ReplicaSetCtl) Lister() interface{}
func (*ReplicaSetCtl) Name ¶
func (ctl *ReplicaSetCtl) Name() string
type Role ¶
type Role struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace"` Annotation MapString `json:"annotations"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type RoleBindingCtl ¶
type RoleBindingCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*RoleBindingCtl) CountWithConditions ¶
func (ctl *RoleBindingCtl) CountWithConditions(conditions string) int
func (*RoleBindingCtl) ListWithConditions ¶
func (*RoleBindingCtl) Lister ¶
func (ctl *RoleBindingCtl) Lister() interface{}
func (*RoleBindingCtl) Name ¶
func (ctl *RoleBindingCtl) Name() string
type RoleCtl ¶
type RoleCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*RoleCtl) CountWithConditions ¶
func (*RoleCtl) ListWithConditions ¶
type Secret ¶
type Secret struct { Name string `gorm:"primary_key" json:"name"` Namespace string `gorm:"primary_key" json:"namespace"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` Annotation MapString `json:"annotations"` Entries int `json:"entries"` Type string `json:"type"` }
type SecretCtl ¶
type SecretCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*SecretCtl) CountWithConditions ¶
func (*SecretCtl) ListWithConditions ¶
type Service ¶
type Service struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace"` ServiceType string `gorm:"column:type" json:"type,omitempty"` App string `json:"app,omitempty"` VirtualIp string `gorm:"column:virtualIp" json:"virtualIp,omitempty"` ExternalIp string `gorm:"column:externalIp" json:"externalIp,omitempty"` Ports string `json:"ports,omitempty"` NodePorts string `gorm:"column:nodePorts" json:"nodePorts,omitempty"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type ServiceCtl ¶
type ServiceCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*ServiceCtl) CountWithConditions ¶
func (ctl *ServiceCtl) CountWithConditions(conditions string) int
func (*ServiceCtl) ListWithConditions ¶
func (*ServiceCtl) Lister ¶
func (ctl *ServiceCtl) Lister() interface{}
func (*ServiceCtl) Name ¶
func (ctl *ServiceCtl) Name() string
type Statefulset ¶
type Statefulset struct { Name string `gorm:"primary_key" json:"name,omitempty"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Namespace string `gorm:"primary_key" json:"namespace,omitempty"` App string `json:"app,omitempty"` Available int32 `json:"available"` Desire int32 `json:"desire"` Status string `json:"status"` Annotation MapString `json:"annotations"` Labels MapString `json:"labels"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` }
type StatefulsetCtl ¶
type StatefulsetCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*StatefulsetCtl) CountWithConditions ¶
func (ctl *StatefulsetCtl) CountWithConditions(conditions string) int
func (*StatefulsetCtl) ListWithConditions ¶
func (*StatefulsetCtl) Lister ¶
func (ctl *StatefulsetCtl) Lister() interface{}
func (*StatefulsetCtl) Name ¶
func (ctl *StatefulsetCtl) Name() string
type StorageClass ¶
type StorageClass struct { Name string `gorm:"primary_key" json:"name"` DisplayName string `json:"displayName,omitempty" gorm:"column:displayName"` Creator string `json:"creator,omitempty"` Annotation MapString `json:"annotations"` CreateTime time.Time `gorm:"column:createTime" json:"createTime,omitempty"` IsDefault bool `json:"default"` Count int `json:"count"` Provisioner string `json:"provisioner"` }
type StorageClassCtl ¶
type StorageClassCtl struct { CommonAttribute // contains filtered or unexported fields }
func (*StorageClassCtl) CountWithConditions ¶
func (ctl *StorageClassCtl) CountWithConditions(conditions string) int
func (*StorageClassCtl) ListWithConditions ¶
func (*StorageClassCtl) Lister ¶
func (ctl *StorageClassCtl) Lister() interface{}
func (*StorageClassCtl) Name ¶
func (ctl *StorageClassCtl) Name() string
Source Files ¶
- applications.go
- clusterrole_bindings.go
- clusterroles.go
- common.go
- configmaps.go
- controllerrevisions.go
- cronjobs.go
- daemonsets.go
- deployments.go
- ingresses.go
- jobs.go
- namespaces.go
- nodes.go
- pods.go
- pvcs.go
- replicasets.go
- role_bindings.go
- roles.go
- run.go
- secrets.go
- services.go
- statefulsets.go
- storageclasses.go
- types.go
Click to show internal directories.
Click to hide internal directories.