Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateReplicas(lb *lbapi.LoadBalancer) (int32, bool)
- func ComputePodStatus(pod *v1.Pod) lbapi.PodStatus
- func EvictPod(client kubernetes.Interface, lb *lbapi.LoadBalancer, pod *v1.Pod)
- func ExternalProviderStatusEqual(a, b lbapi.ExpternalProviderStatus) bool
- func IpvsdrProviderStatusEqual(a, b lbapi.IpvsdrProviderStatus) bool
- func IsPodMatchNodeSelectorFailed(pod *v1.Pod) bool
- func IsStatic(lb *lbapi.LoadBalancer) bool
- func MergeDeployment(dst, src *appsv1.Deployment) (*appsv1.Deployment, bool)
- func PodStatusesEqual(a, b lbapi.PodStatuses) bool
- func ProxyStatusEqual(a, b lbapi.ProxyStatus) bool
- func RandStringBytesRmndr(n int) string
- func SplitNamespaceAndNameByDot(value string) (namespace, name string, err error)
- func UpdateLBWithRetries(lbClient lbclient.LoadBalancerInterface, lblister lblisters.LoadBalancerLister, ...) (*lbapi.LoadBalancer, error)
- type EventHandlerForDeployment
- func (eh *EventHandlerForDeployment) GetLoadBalancerForDeployments(d *appsv1.Deployment) *lbapi.LoadBalancer
- func (eh *EventHandlerForDeployment) OnAdd(obj interface{})
- func (eh *EventHandlerForDeployment) OnDelete(obj interface{})
- func (eh *EventHandlerForDeployment) OnUpdate(oldObj, curObj interface{})
- type EventHandlerForSyncStatusWithPod
- type SortPodStatusByName
Constants ¶
const ( // NodeUnreachablePodReason is the reason and message set on a pod // when its state cannot be confirmed as kubelet is unresponsive // on the node it is (was) running. // copy from k8s.io/kubernetes/pkg/util/node NodeUnreachablePodReason = "NodeLost" )
Variables ¶
var DefaultRetry = wait.Backoff{ Steps: 5, Duration: 10 * time.Millisecond, Factor: 1.0, Jitter: 0.1, }
DefaultRetry is the recommended retry for a conflict where multiple clients are making changes to the same resource.
Functions ¶
func CalculateReplicas ¶
func CalculateReplicas(lb *lbapi.LoadBalancer) (int32, bool)
CalculateReplicas helps you to calculate replicas of lb determines if you need to add node affinity
func ComputePodStatus ¶
ComputePodStatus computes the pod's current status
func EvictPod ¶ added in v0.5.5
func EvictPod(client kubernetes.Interface, lb *lbapi.LoadBalancer, pod *v1.Pod)
EvictPod deletes the pod scheduled to the wrong node
func ExternalProviderStatusEqual ¶ added in v0.3.3
func ExternalProviderStatusEqual(a, b lbapi.ExpternalProviderStatus) bool
ExternalProviderStatusEqual check whether the given two ExpternalProviderStatus are equal
func IpvsdrProviderStatusEqual ¶
func IpvsdrProviderStatusEqual(a, b lbapi.IpvsdrProviderStatus) bool
IpvsdrProviderStatusEqual check whether the given two Statuses are equal
func IsPodMatchNodeSelectorFailed ¶ added in v0.5.4
IsPodMatchNodeSelectorFailed returns true if pod is in MatchNodeSelector failed
func IsStatic ¶ added in v0.3.5
func IsStatic(lb *lbapi.LoadBalancer) bool
IsStatic checks if lb is a static loadbalancer
func MergeDeployment ¶ added in v0.5.5
func MergeDeployment(dst, src *appsv1.Deployment) (*appsv1.Deployment, bool)
MergeDeployment merges fields in src into dst, and igornes some fields by default for debugging
func PodStatusesEqual ¶
func PodStatusesEqual(a, b lbapi.PodStatuses) bool
PodStatusesEqual check whether the given two PodStatuses are equal
func ProxyStatusEqual ¶
func ProxyStatusEqual(a, b lbapi.ProxyStatus) bool
ProxyStatusEqual check whether the given two PorxyStatuses are equal
func RandStringBytesRmndr ¶
RandStringBytesRmndr returns a randome string.
func SplitNamespaceAndNameByDot ¶
SplitNamespaceAndNameByDot returns the namespace and name that encoded into the label or value by dot
func UpdateLBWithRetries ¶
func UpdateLBWithRetries(lbClient lbclient.LoadBalancerInterface, lblister lblisters.LoadBalancerLister, namespace, name string, applyUpdate updateLBFunc) (*lbapi.LoadBalancer, error)
UpdateLBWithRetries update loadbalancer with max retries
Types ¶
type EventHandlerForDeployment ¶
type EventHandlerForDeployment struct {
// contains filtered or unexported fields
}
EventHandlerForDeployment helps you create a event handler to handle with deployments event quickly, makes you focus on you own code
func NewEventHandlerForDeployment ¶
func NewEventHandlerForDeployment( lbLister lblisters.LoadBalancerLister, dLister appslisters.DeploymentLister, queue *syncqueue.SyncQueue, filterFunc filterDeploymentFunc, ) *EventHandlerForDeployment
NewEventHandlerForDeployment ...
func (*EventHandlerForDeployment) GetLoadBalancerForDeployments ¶
func (eh *EventHandlerForDeployment) GetLoadBalancerForDeployments(d *appsv1.Deployment) *lbapi.LoadBalancer
GetLoadBalancerForDeployments get a list of all matching LoadBalancer for deployment
func (*EventHandlerForDeployment) OnAdd ¶
func (eh *EventHandlerForDeployment) OnAdd(obj interface{})
OnAdd ...
func (*EventHandlerForDeployment) OnDelete ¶
func (eh *EventHandlerForDeployment) OnDelete(obj interface{})
OnDelete ...
func (*EventHandlerForDeployment) OnUpdate ¶
func (eh *EventHandlerForDeployment) OnUpdate(oldObj, curObj interface{})
OnUpdate ...
type EventHandlerForSyncStatusWithPod ¶
type EventHandlerForSyncStatusWithPod struct {
// contains filtered or unexported fields
}
EventHandlerForSyncStatusWithPod helps you create a event handler to sync status with pod event quickly, makes you focus on you own code
func NewEventHandlerForSyncStatusWithPod ¶
func NewEventHandlerForSyncStatusWithPod( lbLister lblisters.LoadBalancerLister, podLister corelisters.PodLister, queue *syncqueue.SyncQueue, filterFunc filterPodFunc, ) *EventHandlerForSyncStatusWithPod
NewEventHandlerForSyncStatusWithPod ...
func (*EventHandlerForSyncStatusWithPod) OnAdd ¶
func (eh *EventHandlerForSyncStatusWithPod) OnAdd(obj interface{})
OnAdd ...
func (*EventHandlerForSyncStatusWithPod) OnDelete ¶
func (eh *EventHandlerForSyncStatusWithPod) OnDelete(obj interface{})
OnDelete ...
func (*EventHandlerForSyncStatusWithPod) OnUpdate ¶
func (eh *EventHandlerForSyncStatusWithPod) OnUpdate(oldObj, curObj interface{})
OnUpdate ...
type SortPodStatusByName ¶
SortPodStatusByName ...
func (SortPodStatusByName) Len ¶
func (s SortPodStatusByName) Len() int
func (SortPodStatusByName) Less ¶
func (s SortPodStatusByName) Less(i, j int) bool
func (SortPodStatusByName) Swap ¶
func (s SortPodStatusByName) Swap(i, j int)