Documentation ¶
Index ¶
- Constants
- func BuildReadinessGatePodConditionType(cond string) corev1.PodConditionType
- func BuildReadinessGatePodConditionTypeWithPrefix(prefix, id string) corev1.PodConditionType
- func FindCondition(conds []v1.NodeCondition, conditionType v1.NodeConditionType) (*v1.NodeCondition, bool)
- func FindNodeByNodeName(nodes []v1.Node, nodeName string) *v1.Node
- func GetLogMessage(err error) string
- func GetNodeCondition(node *v1.Node, conditionType v1.NodeConditionType) *v1.NodeCondition
- func GetNodeInternalIP(node *v1.Node) (string, error)
- func GetPodCondition(pod *corev1.Pod, conditionType corev1.PodConditionType) *corev1.PodCondition
- func GetServiceHash(svc *v1.Service) string
- func HasExcludeLabel(node *v1.Node) bool
- func HasFinalizer(obj metav1.Object, finalizer string) bool
- func Is4LayerProtocol(protocol string) bool
- func Is7LayerProtocol(protocol string) bool
- func IsClusterIPService(svc *v1.Service) bool
- func IsENIBackendType(svc *v1.Service) bool
- func IsIPv4(address string) bool
- func IsIPv6(address string) bool
- func IsLocalModeService(svc *v1.Service) bool
- func IsMasterNode(node *v1.Node) bool
- func IsNodeExcludeFromLoadBalancer(node *v1.Node) bool
- func IsPodContainersReady(pod *corev1.Pod) bool
- func IsPodHasReadinessGate(pod *corev1.Pod, cond string) bool
- func IsServiceHashChanged(service *v1.Service) bool
- func IsServiceOwnIngress(service *v1.Service) bool
- func LogEndpointSlice(es *discovery.EndpointSlice) string
- func LogEndpointSliceList(esList []discovery.EndpointSlice) string
- func LogEndpoints(eps *v1.Endpoints) string
- func NeedCLB(service *v1.Service) bool
- func NeedDeleteLoadBalancer(svc *v1.Service) bool
- func NeedNLB(service *v1.Service) bool
- func NewDefaultFinalizerManager(kclient client.Client) *defaultFinalizerManager
- func NewDefaultReferenceIndexer() *defaultReferenceIndexer
- func NodeFromProviderID(providerID string) (string, string, error)
- func NodeInfo(node *v1.Node) string
- func PatchM(mclient client.Client, target client.Object, ...) error
- func PatchNodeStatus(mclient client.Client, target *v1.Node, ...) error
- func Retry(backoff *wait.Backoff, fun func(svc *v1.Service) error, svc *v1.Service) error
- func UpdatePodCondition(pod *corev1.Pod, condition corev1.PodCondition)
- func UpdateReadinessConditionForPod(ctx context.Context, kubeClient client.Client, pod *corev1.Pod, ...) error
- type APIObject
- type Element
- type Event
- type EventType
- type FinalizerManager
- type Queue
- type ReferenceIndexer
- type TrafficPolicy
Constants ¶
const ( FailedAddFinalizer = "FailedAddFinalizer" FailedRemoveFinalizer = "FailedRemoveFinalizer" FailedAddHash = "FailedAddHash" FailedRemoveHash = "FailedRemoveHash" FailedUpdateStatus = "FailedUpdateStatus" FailedUpdateReadinessGate = "FailedUpdateReadinessGate" UnAvailableBackends = "UnAvailableLoadBalancer" SkipSyncBackends = "SkipSyncBackends" FailedSyncLB = "SyncLoadBalancerFailed" SucceedCleanLB = "CleanLoadBalancer" FailedCleanLB = "CleanLoadBalancerFailed" SucceedSyncLB = "EnsuredLoadBalancer" AnnoChanged = "AnnotationChanged" TypeChanged = "TypeChanged" SpecChanged = "ServiceSpecChanged" DeleteTimestampChanged = "DeleteTimestampChanged" PreservedOnDelete = "PreservedOnDelete" )
ServiceEventReason
const ( FailedDeleteNode = "DeleteNodeFailed" FailedAddNode = "AddNodeFailed" FailedSyncNode = "SyncNodeFailed" SucceedDeleteNode = "DeletedNode" InitializedNode = "InitializedNode" )
NodeEventReason
const ( FailedCreateRoute = "CreateRouteFailed" FailedSyncRoute = "SyncRouteFailed" SucceedCreateRoute = "CreatedRoute" )
RouteEventReason
const ( // Ingress events IngressEventReasonFailedAddFinalizer = "FailedAddFinalizer" IngressEventReasonFailedRemoveFinalizer = "FailedRemoveFinalizer" IngressEventReasonFailedUpdateStatus = "FailedUpdateStatus" IngressEventReasonFailedBuildModel = "FailedBuildModel" IngressEventReasonFailedApplyModel = "FailedApplyModel" IngressEventReasonSuccessfullyReconciled = "SuccessfullyReconciled" )
const ( PatchAll = "all" PatchSpec = "spec" PatchStatus = "status" )
const ( LabelNodeRoleMaster = "node-role.kubernetes.io/master" LabelNodeTypeVK = "virtual-kubelet" // LabelNodeExcludeBalancer specifies that the node should be // exclude from loadbalancers created by a cloud provider. LabelNodeExcludeBalancerDeprecated = "alpha.service-controller.kubernetes.io/exclude-balancer" LabelNodeExcludeBalancer = v1.LabelNodeExcludeBalancers // ToBeDeletedTaint is a taint used by the CLuster Autoscaler before marking a node for deletion. // Details in https://github.com/kubernetes/cloud-provider/blob/5bb9b27442bcb2613a9ca4046c89109de4435824/controllers/service/controller.go#L58 ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler" // LabelNodeExcludeNodeDeprecated specifies that the node should be exclude from CCM LabelNodeExcludeNodeDeprecated = "service.beta.kubernetes.io/exclude-node" LabelNodeExcludeNode = "service.alibabacloud.com/exclude-node" )
const ( TargetHealthPodConditionALBTypePrefix = "target-health.alb.k8s.alicloud" TargetHealthPodConditionServiceTypePrefix = "service.readiness.alibabacloud.com" )
Prefix for TargetHealth pod condition type.
const ( ConditionReasonServerRegistered = "ServerRegistered" ConditionMessageServerRegistered = "The backend has been added to the server group" )
const ( ServiceFinalizer = "service.k8s.alibaba/resources" NLBFinalizer = "service.k8s.alibaba/nlb" )
Finalizer
const ( BackendType = "service.beta.kubernetes.io/backend-type" LoadBalancerClass = "service.beta.kubernetes.io/class" LoadBalancerType = "service.beta.kubernetes.io/alibaba-cloud-loadbalancer-type" )
annotation
const ( LabelServiceHash = "service.beta.kubernetes.io/hash" LabelLoadBalancerId = "service.k8s.alibaba/loadbalancer-id" )
label
const ( TAGKEY = "kubernetes.do.not.delete" REUSEKEY = "kubernetes.reused.by.user" )
const ( // LocalTrafficPolicy externalTrafficPolicy=Local LocalTrafficPolicy = TrafficPolicy("Local") // ClusterTrafficPolicy externalTrafficPolicy=Cluster ClusterTrafficPolicy = TrafficPolicy("Cluster") // ENITrafficPolicy is forwarded to pod directly ENITrafficPolicy = TrafficPolicy("ENI") )
const NLBClass = "alibabacloud.com/nlb"
load balancer class
const TRY_AGAIN = "try again"
Variables ¶
This section is empty.
Functions ¶
func BuildReadinessGatePodConditionType ¶
func BuildReadinessGatePodConditionType(cond string) corev1.PodConditionType
BuildTargetHealthPodConditionType constructs the condition type for TargetHealth pod condition.
func BuildReadinessGatePodConditionTypeWithPrefix ¶
func BuildReadinessGatePodConditionTypeWithPrefix(prefix, id string) corev1.PodConditionType
func FindCondition ¶
func FindCondition(conds []v1.NodeCondition, conditionType v1.NodeConditionType) (*v1.NodeCondition, bool)
func GetLogMessage ¶
func GetNodeCondition ¶
func GetNodeCondition(node *v1.Node, conditionType v1.NodeConditionType) *v1.NodeCondition
GetNodeCondition will get pointer to Node's existing condition. returns nil if no matching condition found.
func GetPodCondition ¶
func GetPodCondition(pod *corev1.Pod, conditionType corev1.PodConditionType) *corev1.PodCondition
GetPodCondition will get pointer to Pod's existing condition. returns nil if no matching condition found.
func GetServiceHash ¶
func HasExcludeLabel ¶
func HasFinalizer ¶
HasFinalizer tests whether k8s object has specified finalizer
func Is4LayerProtocol ¶
func Is7LayerProtocol ¶
func IsClusterIPService ¶
func IsENIBackendType ¶
func IsLocalModeService ¶
func IsMasterNode ¶
func IsPodContainersReady ¶
IsPodContainersReady returns whether pod is containersReady.
func IsServiceHashChanged ¶
func IsServiceOwnIngress ¶
check if the service exists in service definition
func LogEndpointSlice ¶
func LogEndpointSlice(es *discovery.EndpointSlice) string
func LogEndpointSliceList ¶
func LogEndpointSliceList(esList []discovery.EndpointSlice) string
func LogEndpoints ¶
func NeedDeleteLoadBalancer ¶
func NewDefaultReferenceIndexer ¶
func NewDefaultReferenceIndexer() *defaultReferenceIndexer
func NodeFromProviderID ¶
providerID 1) the id of the instance in the alicloud API. Use '.' to separate providerID which looks like 'cn-hangzhou.i-v98dklsmnxkkgiiil7'. The format of "REGION.NODEID" 2) the id for an instance in the kubernetes API, which has 'alicloud://' prefix. e.g. alicloud://cn-hangzhou.i-v98dklsmnxkkgiiil7
func PatchNodeStatus ¶
func UpdatePodCondition ¶
func UpdatePodCondition(pod *corev1.Pod, condition corev1.PodCondition)
UpdatePodCondition will update Pod to contain specified condition.
Types ¶
type Event ¶
type Event struct { Type EventType Obj interface{} }
Event holds the context of an event.
type EventType ¶
type EventType string
EventType type of event associated with an informer
const ( // CreateEvent event associated with new objects in an informer CreateEvent EventType = "CREATE" // UpdateEvent event associated with an object update in an informer UpdateEvent EventType = "UPDATE" // DeleteEvent event associated when an object is removed from an informer IngressDeleteEvent EventType = "DELETE" // ConfigurationEvent event associated when a controller configuration object is created or updated ConfigurationEvent EventType = "CONFIGURATION" // NodeEvent event associated when a controller configuration object is created or updated NodeEvent EventType = "NODE" // ServiceEvent event associated when a controller configuration object is created or updated ServiceEvent EventType = "SERVICE" // EndPointEvent event associated when a controller configuration object is created or updated EndPointEvent EventType = "ENDPOINT" // IngressEvent event associated when a controller configuration object is created or updated IngressEvent EventType = "Ingress" )
type FinalizerManager ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue manages a time work queue through an independent worker that invokes the given sync function for every work item inserted. The queue uses an internal timestamp that allows the removal of certain elements which timestamp is older than the last successful get operation.
func NewCustomTaskQueue ¶
func NewCustomTaskQueue(syncFn func(interface{}) error, fn func(interface{}) (interface{}, error)) *Queue
NewCustomTaskQueue ...
func NewTaskQueue ¶
NewTaskQueue creates a new task queue with the given sync function. The sync function is called for every element inserted into the queue.
func (*Queue) EnqueueSkippableTask ¶
func (t *Queue) EnqueueSkippableTask(obj interface{})
EnqueueSkippableTask enqueues ns/name of the given api object in the task queue that can be skipped
func (*Queue) EnqueueTask ¶
func (t *Queue) EnqueueTask(obj interface{})
EnqueueTask enqueues ns/name of the given api object in the task queue.
func (*Queue) IsShuttingDown ¶
IsShuttingDown returns if the method Shutdown was invoked
type ReferenceIndexer ¶
type ReferenceIndexer interface {
BuildServiceRefIndexes(ctx context.Context, ing *networking.Ingress) []string
}
type TrafficPolicy ¶
type TrafficPolicy string
func GetServiceTrafficPolicy ¶
func GetServiceTrafficPolicy(svc *v1.Service) (TrafficPolicy, error)