Documentation ¶
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
- func NewDeploymentsController(lw cache.ListerWatcher, period time.Duration, ch chan<- DeploymentUpdate) cache.Controller
- func NewListWatchFromClient(c cache.Getter, resource string, namespace string, ...) *cache.ListWatch
- func NewRCController(lw cache.ListerWatcher, period time.Duration, ch chan<- RCUpdate) cache.Controller
- func NewSourceAPI(v1get cache.Getter, batev1 cache.Getter, period time.Duration, ...)
- func NewStatefulSetsController(lw cache.ListerWatcher, period time.Duration, ch chan<- StatefulSetUpdate) cache.Controller
- type DeploymentUpdate
- type Operation
- type RCUpdate
- type ServiceStatusManager
- type StatefulSetUpdate
Constants ¶
const ( RUNNING string = "running" CLOSED = "closed" STARTING = "starting" STOPPING = "stopping" CHECKING = "checking" //运行异常 ABNORMAL = "abnormal" //升级中 UPGRADE = "upgrade" UNDEPLOY = "undeploy" )
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.
func NewDeploymentsController ¶
func NewDeploymentsController(lw cache.ListerWatcher, period time.Duration, ch chan<- DeploymentUpdate) cache.Controller
NewDeploymentsController creates a controller that is watching deployments and sending updates into deployments channel.
func NewListWatchFromClient ¶
func NewListWatchFromClient(c cache.Getter, resource string, namespace string, fieldSelector fields.Selector) *cache.ListWatch
NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector.
func NewRCController ¶
func NewRCController(lw cache.ListerWatcher, period time.Duration, ch chan<- RCUpdate) cache.Controller
NewRCController creates a controller that is watching rc and sending updates into ServiceUpdate channel.
func NewSourceAPI ¶
func NewSourceAPI(v1get cache.Getter, batev1 cache.Getter, period time.Duration, rcsChan chan<- RCUpdate, deploymentsChan chan<- DeploymentUpdate, statefulChan chan<- StatefulSetUpdate, stopCh <-chan struct{})
NewSourceAPI creates config source that watches for changes to the services and pods.
func NewStatefulSetsController ¶
func NewStatefulSetsController(lw cache.ListerWatcher, period time.Duration, ch chan<- StatefulSetUpdate) cache.Controller
NewStatefulSetsController creates a controller that is watching statefulset and sending updates into deployments channel.
Types ¶
type DeploymentUpdate ¶
type DeploymentUpdate struct { Deployment *v1beta1.Deployment Op Operation }
DeploymentUpdate describes an operation of deployment, sent on the channel. You can add, update or remove single endpoints by setting Op == ADD|UPDATE|REMOVE.
type RCUpdate ¶
type RCUpdate struct { RC *v1.ReplicationController Op Operation }
RCUpdate describes an operation of endpoints, sent on the channel. You can add, update or remove single endpoints by setting Op == ADD|UPDATE|REMOVE.
type ServiceStatusManager ¶
type ServiceStatusManager interface { SetStatus(serviceID, status string) error GetStatus(serviceID string) (string, error) CheckStatus(serviceID string) Start() error Stop() error SyncStatus() IgnoreDelete(name string) RmIgnoreDelete(name string) }
ServiceStatusManager 应用运行状态控制器
type StatefulSetUpdate ¶
type StatefulSetUpdate struct { StatefulSet *v1beta1.StatefulSet Op Operation }
StatefulSetUpdate describes an operation of endpoints, sent on the channel. You can add, update or remove single endpoints by setting Op == ADD|UPDATE|REMOVE.