Documentation ¶
Index ¶
- Constants
- func PodConditionStatus(pod *v1.Pod) (v1.ConditionStatus, v1.ConditionStatus, v1.ConditionStatus, v1.ConditionStatus)
- func RestConfig(kubeConfig string) (*restclient.Config, error)
- type LeaderCallback
- type LeaderElectionOptions
- type LeaderElector
- type Pod
- type PodClient
- type ReplicaSet
- type ReplicaSetClient
- type WatchEventHandler
- type Watcher
Constants ¶
View Source
const ( // DefaultLeaderElect is the default true leader election should be enabled DefaultLeaderElect = true // DefaultLeaderElectionLeaseDuration is the default time in seconds that non-leader candidates will wait to force acquire leadership DefaultLeaderElectionLeaseDuration = 15 * time.Second // DefaultLeaderElectionRenewDeadline is the default time in seconds that the acting master will retry refreshing leadership before giving up DefaultLeaderElectionRenewDeadline = 10 * time.Second // DefaultLeaderElectionRetryPeriod is the default time in seconds that the leader election clients should wait between tries of actions DefaultLeaderElectionRetryPeriod = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func PodConditionStatus ¶
func PodConditionStatus(pod *v1.Pod) (v1.ConditionStatus, v1.ConditionStatus, v1.ConditionStatus, v1.ConditionStatus)
func RestConfig ¶
func RestConfig(kubeConfig string) (*restclient.Config, error)
Types ¶
type LeaderCallback ¶
type LeaderElectionOptions ¶
type LeaderElectionOptions struct { LeaderElect bool LeaderElectionNamespace string LeaderElectionLeaseDuration time.Duration LeaderElectionRenewDeadline time.Duration LeaderElectionRetryPeriod time.Duration LeaderElectionLeaseLockName string ClusterCode string Namespace string LabelSelector string }
type LeaderElector ¶
func (LeaderElector) Run ¶
func (s LeaderElector) Run(ctx context.Context, electOpts LeaderElectionOptions, callback LeaderCallback, stopCh <-chan struct{}) error
type PodClient ¶
type PodClient struct { coreclientv1.PodInterface WatchEventHandler Namespace string ClusterCode string LabelSelector string }
func NewPodClient ¶
func NewPodClient(v1Client coreclientv1.PodInterface, clusterCode, namespace, labelSelector string, eventHandler WatchEventHandler) *PodClient
type ReplicaSet ¶
type ReplicaSet interface {
CreateOrReplace(ctx context.Context, rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
}
type ReplicaSetClient ¶
type ReplicaSetClient struct { appclientv1.ReplicaSetInterface WatchEventHandler Namespace string ClusterCode string LabelSelector string }
func NewReplicaSetClient ¶
func NewReplicaSetClient(rsClient appclientv1.ReplicaSetInterface, clusterCode, namespace, labelSelector string, eventHandler WatchEventHandler) *ReplicaSetClient
func (*ReplicaSetClient) CreateOrReplace ¶
func (r *ReplicaSetClient) CreateOrReplace(ctx context.Context, rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
type WatchEventHandler ¶
Click to show internal directories.
Click to hide internal directories.