controllers

package
v0.0.0-...-10220f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreatedDubboDataplaneReason          = "CreatedDubboDataplane"
	UpdatedDubboDataplaneReason          = "UpdatedDubboDataplane"
	FailedToGenerateDubboDataplaneReason = "FailedToGenerateDubboDataplane"
)

Variables

Functions

func InboundTagsForPod

func InboundTagsForPod(zone string, pod *kube_core.Pod, name string) map[string]string

func InboundTagsForService

func InboundTagsForService(zone string, pod *kube_core.Pod, svc *kube_core.Service, svcPort *kube_core.ServicePort) map[string]string

func ProbesFor

func ProbesFor(pod *kube_core.Pod) (*mesh_proto.Dataplane_Probes, error)

func ProtocolTagFor

func ProtocolTagFor(svc *kube_core.Service, svcPort *kube_core.ServicePort) string

ProtocolTagFor infers service protocol from a `<port>.service.dubbo.io/protocol` annotation or `appProtocol`.

func ServiceToPodsMapper

func ServiceToPodsMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc

Types

type Endpoint

type Endpoint struct {
	Address  string
	Port     uint32
	Instance string
}

type EndpointsByService

type EndpointsByService map[string][]Endpoint

func (EndpointsByService) Services

func (e EndpointsByService) Services() []string

type InboundConverter

type InboundConverter struct {
	NameExtractor NameExtractor
}

func (*InboundConverter) InboundInterfacesFor

func (i *InboundConverter) InboundInterfacesFor(ctx context.Context, zone string, pod *kube_core.Pod, services []*kube_core.Service) ([]*mesh_proto.Dataplane_Networking_Inbound, error)

type NameExtractor

type NameExtractor struct {
	ReplicaSetGetter kube_client.Reader
	JobGetter        kube_client.Reader
}

func (*NameExtractor) Name

func (n *NameExtractor) Name(ctx context.Context, pod *kube_core.Pod) (string, string, error)

type PodConverter

type PodConverter struct {
	ServiceGetter     kube_client.Reader
	NodeGetter        kube_client.Reader
	ResourceConverter k8s_common.Converter
	InboundConverter  InboundConverter
	Zone              string
}

func (*PodConverter) EgressFor

func (p *PodConverter) EgressFor(
	ctx context.Context,
	zoneEgress *mesh_proto.ZoneEgress,
	pod *kube_core.Pod,
	services []*kube_core.Service,
) error

func (*PodConverter) IngressFor

func (p *PodConverter) IngressFor(
	ctx context.Context, zoneIngress *mesh_proto.ZoneIngress, pod *kube_core.Pod, services []*kube_core.Service,
) error

func (*PodConverter) OutboundInterfacesFor

func (p *PodConverter) OutboundInterfacesFor(
	ctx context.Context,
	pod *kube_core.Pod,
	others []*mesh_k8s.Dataplane,
	reachableServices []string,
) ([]*mesh_proto.Dataplane_Networking_Outbound, error)

func (*PodConverter) PodToDataplane

func (p *PodConverter) PodToDataplane(
	ctx context.Context,
	dataplane *mesh_k8s.Dataplane,
	pod *kube_core.Pod,
	ns *kube_core.Namespace,
	services []*kube_core.Service,
	others []*mesh_k8s.Dataplane,
) error

func (*PodConverter) PodToEgress

func (p *PodConverter) PodToEgress(ctx context.Context, zoneEgress *mesh_k8s.ZoneEgress, pod *kube_core.Pod, services []*kube_core.Service) error

func (*PodConverter) PodToIngress

func (p *PodConverter) PodToIngress(ctx context.Context, zoneIngress *mesh_k8s.ZoneIngress, pod *kube_core.Pod, services []*kube_core.Service) error

type PodReconciler

type PodReconciler struct {
	kube_client.Client
	kube_record.EventRecorder
	Scheme                       *kube_runtime.Scheme
	Log                          logr.Logger
	PodConverter                 PodConverter
	ResourceConverter            k8s_common.Converter
	SystemNamespace              string
	IgnoredServiceSelectorLabels []string
}

PodReconciler reconciles a Pod object

func (*PodReconciler) Reconcile

func (r *PodReconciler) Reconcile(ctx context.Context, req kube_ctrl.Request) (kube_ctrl.Result, error)

func (*PodReconciler) SetupWithManager

func (r *PodReconciler) SetupWithManager(mgr kube_ctrl.Manager, maxConcurrentReconciles int) error

type ServiceReconciler

type ServiceReconciler struct {
	kube_client.Client
	Log logr.Logger
}

func (*ServiceReconciler) Reconcile

func (*ServiceReconciler) SetupWithManager

func (r *ServiceReconciler) SetupWithManager(mgr kube_ctrl.Manager) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL