Documentation ¶
Overview ¶
Package status check app status from kubernetes rc,statefulset and deployment It save app status to db and provides query
Index ¶
- Constants
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- type Manager
- func (s *Manager) CheckStatus(serviceID string)
- func (s *Manager) GetAllStatus() map[string]string
- func (s *Manager) GetStatus(serviceID string) string
- func (s *Manager) IgnoreDelete(name string)
- func (s *Manager) RmIgnoreDelete(name string)
- func (s *Manager) SaveDeployInfo(serviceID, tenantID, deployVersion, replicationID, replicationType string) (*model.K8sDeployReplication, error)
- func (s *Manager) SetStatus(serviceID, status string) error
- func (s *Manager) Start() error
- func (s *Manager) SyncStatus()
Constants ¶
const ( RUNNING string = "running" CLOSED = "closed" STARTING = "starting" STOPPING = "stopping" CHECKING = "checking" //运行异常 ABNORMAL = "abnormal" //升级中 UPGRADE = "upgrade" UNDEPLOY = "undeploy" //构建中 DEPLOYING = "deploying" )
These are the available operation types.
Variables ¶
This section is empty.
Functions ¶
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue retruns true if a pod is ready; false otherwise.
Types ¶
type Manager ¶
type Manager struct { StatefulSetUpdateChan chan source.StatefulSetUpdate RCUpdateChan chan source.RCUpdate DeploymentUpdateChan chan source.DeploymentUpdate ClientSet *kubernetes.Clientset // contains filtered or unexported fields }
Manager app status manager
func NewManager ¶
func NewManager(ctx context.Context, clientset *kubernetes.Clientset) *Manager
NewManager create app runtime status manager
func (*Manager) CheckStatus ¶
CheckStatus check app status
func (*Manager) GetAllStatus ¶
GetAllStatus get all app status
func (*Manager) IgnoreDelete ¶
IgnoreDelete add ignore delete info
func (*Manager) RmIgnoreDelete ¶
RmIgnoreDelete remove ignore delete info
func (*Manager) SaveDeployInfo ¶
func (s *Manager) SaveDeployInfo(serviceID, tenantID, deployVersion, replicationID, replicationType string) (*model.K8sDeployReplication, error)
SaveDeployInfo save app deploy info