Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigMapToPodsMapper(l logr.Logger, ns string, client kube_client.Client) kube_handler.MapFunc
- func DataplaneToMeshMapper(l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
- func ExternalServiceToConfigMapsMapper(l logr.Logger, ns string) kube_handler.MapFunc
- func ExternalServiceToPodsMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
- func GatewayByServiceFor(clusterName string, pod *kube_core.Pod, services []*kube_core.Service) (*mesh_proto.Dataplane_Networking_Gateway, error)
- func GatewayToInstanceMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
- func InboundInterfacesFor(zone string, pod *kube_core.Pod, services []*kube_core.Service) ([]*mesh_proto.Dataplane_Networking_Inbound, error)
- func InboundTagsForPod(zone string, pod *kube_core.Pod) map[string]string
- func InboundTagsForService(zone string, pod *kube_core.Pod, svc *kube_core.Service, ...) map[string]string
- func KubeHosts(ctx context.Context, client kube_client.Client, ...) (*vips.VirtualOutboundMeshView, error)
- func MeshGatewayRouteToMeshMapper(client kube_client.Reader, l logr.Logger, ns string, ...) kube_handler.MapFunc
- func MeshGatewayToMeshMapper(client kube_client.Reader, l logr.Logger, ns string, ...) kube_handler.MapFunc
- func MetricsAggregateFor(pod *kube_core.Pod) ([]*mesh_proto.PrometheusAggregateMetricsConfig, error)
- func MetricsFor(pod *kube_core.Pod) (*mesh_proto.MetricsBackend, error)
- func ProbesFor(pod *kube_core.Pod) (*mesh_proto.Dataplane_Probes, error)
- func ProtocolTagFor(svc *kube_core.Service, svcPort *kube_core.ServicePort) string
- func ServiceToConfigMapsMapper(client kube_client.Reader, l logr.Logger, systemNamespace string) kube_handler.MapFunc
- func ServiceToPodsMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
- func VirtualOutboundToConfigMapsMapper(l logr.Logger, ns string) kube_handler.MapFunc
- func ZoneIngressToMeshMapper(l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
- type CniNodeTaintReconciler
- type ConfigMapReconciler
- type Endpoint
- type EndpointsByService
- type GatewayInstanceReconciler
- type MeshDefaultsReconciler
- type MeshReconciler
- type NamespaceReconciler
- type PodConverter
- func (p *PodConverter) BuiltinGatewayDataplane(pod *kube_core.Pod, tags map[string]string) (*mesh_proto.Dataplane, error)
- func (p *PodConverter) DeploymentFor(ctx context.Context, namespace string, pod *kube_core.Pod) (string, bool, error)
- func (p *PodConverter) EgressFor(zoneEgress *mesh_proto.ZoneEgress, pod *kube_core.Pod, ...) error
- func (p *PodConverter) GatewayByDeploymentFor(ctx context.Context, clusterName string, pod *kube_core.Pod, ...) (*mesh_proto.Dataplane_Networking_Gateway, error)
- func (p *PodConverter) IngressFor(ctx context.Context, zoneIngress *mesh_proto.ZoneIngress, pod *kube_core.Pod, ...) error
- func (p *PodConverter) OutboundInterfacesFor(ctx context.Context, pod *kube_core.Pod, others []*mesh_k8s.Dataplane, ...) ([]*mesh_proto.Dataplane_Networking_Outbound, error)
- func (p *PodConverter) PodToDataplane(ctx context.Context, dataplane *mesh_k8s.Dataplane, pod *kube_core.Pod, ...) error
- func (p *PodConverter) PodToEgress(zoneEgress *mesh_k8s.ZoneEgress, pod *kube_core.Pod, ...) error
- func (p *PodConverter) PodToIngress(ctx context.Context, zoneIngress *mesh_k8s.ZoneIngress, pod *kube_core.Pod, ...) error
- type PodReconciler
- type PodStatusReconciler
- type ServiceReconciler
Constants ¶
const ( KubeNamespaceTag = "k8s.kuma.io/namespace" KubeServiceTag = "k8s.kuma.io/service-name" KubePortTag = "k8s.kuma.io/service-port" )
const ( // CreatedKumaDataplaneReason is added to an event when // a new Dataplane is successfully created. CreatedKumaDataplaneReason = "CreatedKumaDataplane" // UpdatedKumaDataplaneReason is added to an event when // an existing Dataplane is successfully updated. UpdatedKumaDataplaneReason = "UpdatedKumaDataplane" // FailedToGenerateKumaDataplaneReason is added to an event when // a Dataplane cannot be generated or is not valid. FailedToGenerateKumaDataplaneReason = "FailedToGenerateKumaDataplane" )
Variables ¶
var NodePortAddressPriority = []kube_core.NodeAddressType{ kube_core.NodeExternalIP, kube_core.NodeInternalIP, }
List of priority for picking IP when Service that selects ingress is of type NodePort We first try to find ExternalIP and then InternalIP. ExternalIP will be available in public clouds like GCP, but not on Kind or Minikube. On the other hand, on Kind with multizone, there is a connectivity between clusters using InternalIP. Technically there is a risk that we will pick InternalIP and other cluster will try to access it without connectivity between them. However, in most cases, LoadBalancer will be used anyways, therefore we accept this risk.
Functions ¶
func ConfigMapToPodsMapper ¶
func ConfigMapToPodsMapper(l logr.Logger, ns string, client kube_client.Client) kube_handler.MapFunc
func DataplaneToMeshMapper ¶
func DataplaneToMeshMapper(l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
func ExternalServiceToConfigMapsMapper ¶
func ExternalServiceToConfigMapsMapper(l logr.Logger, ns string) kube_handler.MapFunc
func ExternalServiceToPodsMapper ¶
func ExternalServiceToPodsMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
func GatewayByServiceFor ¶ added in v1.8.1
func GatewayByServiceFor(clusterName string, pod *kube_core.Pod, services []*kube_core.Service) (*mesh_proto.Dataplane_Networking_Gateway, error)
func GatewayToInstanceMapper ¶ added in v1.8.1
func GatewayToInstanceMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
GatewayToInstanceMapper maps a Gateway object to MeshGatewayInstance objects by using the service tag to list GatewayInstances with a matching index. The index is set up on MeshGatewayInstance in SetupWithManager and holds the service tag from the MeshGatewayInstance tags.
func InboundInterfacesFor ¶
func InboundInterfacesFor(zone string, pod *kube_core.Pod, services []*kube_core.Service) ([]*mesh_proto.Dataplane_Networking_Inbound, error)
func InboundTagsForService ¶
func KubeHosts ¶ added in v1.8.1
func KubeHosts( ctx context.Context, client kube_client.Client, manager resources_manager.ReadOnlyResourceManager, mesh string, ) (*vips.VirtualOutboundMeshView, error)
func MeshGatewayRouteToMeshMapper ¶ added in v1.8.1
func MeshGatewayRouteToMeshMapper(client kube_client.Reader, l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
func MeshGatewayToMeshMapper ¶ added in v1.8.1
func MeshGatewayToMeshMapper(client kube_client.Reader, l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
func MetricsAggregateFor ¶ added in v1.8.1
func MetricsAggregateFor(pod *kube_core.Pod) ([]*mesh_proto.PrometheusAggregateMetricsConfig, error)
func MetricsFor ¶
func MetricsFor(pod *kube_core.Pod) (*mesh_proto.MetricsBackend, error)
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.kuma.io/protocol` annotation or `appProtocol`.
func ServiceToConfigMapsMapper ¶
func ServiceToConfigMapsMapper(client kube_client.Reader, l logr.Logger, systemNamespace string) kube_handler.MapFunc
func ServiceToPodsMapper ¶
func ServiceToPodsMapper(l logr.Logger, client kube_client.Client) kube_handler.MapFunc
func VirtualOutboundToConfigMapsMapper ¶ added in v1.8.1
func VirtualOutboundToConfigMapsMapper(l logr.Logger, ns string) kube_handler.MapFunc
func ZoneIngressToMeshMapper ¶
func ZoneIngressToMeshMapper(l logr.Logger, ns string, resourceConverter k8s_common.Converter) kube_handler.MapFunc
Types ¶
type CniNodeTaintReconciler ¶ added in v1.8.1
type CniNodeTaintReconciler struct { kube_client.Client Log logr.Logger CniApp string }
func (*CniNodeTaintReconciler) SetupWithManager ¶ added in v1.8.1
func (r *CniNodeTaintReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type ConfigMapReconciler ¶
type ConfigMapReconciler struct { kube_client.Client kube_record.EventRecorder Scheme *kube_runtime.Scheme Log logr.Logger ResourceManager manager.ResourceManager ResourceConverter k8s_common.Converter VIPsAllocator *dns.VIPsAllocator SystemNamespace string KubeOutboundsAsVIPs bool }
ConfigMapReconciler reconciles a ConfigMap object
func (*ConfigMapReconciler) SetupWithManager ¶
func (r *ConfigMapReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type EndpointsByService ¶
func (EndpointsByService) Services ¶
func (e EndpointsByService) Services() []string
type GatewayInstanceReconciler ¶ added in v1.8.1
type GatewayInstanceReconciler struct { K8sVersion *kube_version.Info kube_client.Client Log logr.Logger Scheme *kube_runtime.Scheme Converter k8s_common.Converter ProxyFactory *containers.DataplaneProxyFactory ResourceManager manager.ResourceManager }
GatewayInstanceReconciler reconciles a MeshGatewayInstance object.
func (*GatewayInstanceReconciler) Reconcile ¶ added in v1.8.1
func (r *GatewayInstanceReconciler) Reconcile(ctx context.Context, req kube_ctrl.Request) (kube_ctrl.Result, error)
Reconcile handles ensuring both a Service and a Deployment exist for an instance as well as setting the status.
func (*GatewayInstanceReconciler) SetupWithManager ¶ added in v1.8.1
func (r *GatewayInstanceReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type MeshDefaultsReconciler ¶
type MeshDefaultsReconciler struct {
ResourceManager manager.ResourceManager
}
MeshDefaultsReconciler creates default resources for created Mesh
func (*MeshDefaultsReconciler) SetupWithManager ¶
func (r *MeshDefaultsReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type MeshReconciler ¶
type MeshReconciler struct { kube_client.Client Log logr.Logger Scheme *kube_runtime.Scheme Converter k8s_common.Converter CaManagers core_ca.Managers SystemNamespace string ResourceManager manager.ResourceManager }
MeshReconciler reconciles a Mesh object
func (*MeshReconciler) SetupWithManager ¶
func (r *MeshReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type NamespaceReconciler ¶
type NamespaceReconciler struct { kube_client.Client Log logr.Logger CNIEnabled bool }
NamespaceReconciler reconciles a Namespace object
func (*NamespaceReconciler) Reconcile ¶
func (r *NamespaceReconciler) Reconcile(ctx context.Context, req kube_ctrl.Request) (kube_ctrl.Result, error)
Reconcile is in charge of creating NetworkAttachmentDefinition if CNI enabled and namespace has label 'kuma.io/sidecar-injection: enabled'
func (*NamespaceReconciler) SetupWithManager ¶
func (r *NamespaceReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type PodConverter ¶
type PodConverter struct { ServiceGetter kube_client.Reader NodeGetter kube_client.Reader ReplicaSetGetter kube_client.Reader ResourceConverter k8s_common.Converter Zone string KubeOutboundsAsVIPs bool }
func (*PodConverter) BuiltinGatewayDataplane ¶ added in v1.8.1
func (p *PodConverter) BuiltinGatewayDataplane( pod *kube_core.Pod, tags map[string]string, ) (*mesh_proto.Dataplane, error)
func (*PodConverter) DeploymentFor ¶ added in v1.8.1
func (p *PodConverter) DeploymentFor(ctx context.Context, namespace string, pod *kube_core.Pod) (string, bool, error)
DeploymentFor returns the name of the deployment that the pod exists within. The second return value indicates whether or not the deployment was found when no error occurs, otherwise an error is returned as the third return value.
func (*PodConverter) EgressFor ¶ added in v1.8.1
func (p *PodConverter) EgressFor( zoneEgress *mesh_proto.ZoneEgress, pod *kube_core.Pod, services []*kube_core.Service, ) error
func (*PodConverter) GatewayByDeploymentFor ¶ added in v1.8.1
func (p *PodConverter) GatewayByDeploymentFor(ctx context.Context, clusterName string, pod *kube_core.Pod, services []*kube_core.Service) (*mesh_proto.Dataplane_Networking_Gateway, 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 (*PodConverter) PodToEgress ¶ added in v1.8.1
func (p *PodConverter) PodToEgress(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 Persistence *vips.Persistence ResourceConverter k8s_common.Converter SystemNamespace string }
PodReconciler reconciles a Pod object
func (*PodReconciler) SetupWithManager ¶
func (r *PodReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type PodStatusReconciler ¶
type PodStatusReconciler struct { kube_client.Client kube_record.EventRecorder Scheme *kube_runtime.Scheme ResourceManager manager.ResourceManager Log logr.Logger ResourceConverter k8s_common.Converter EnvoyAdminClient admin.EnvoyAdminClient }
PodStatusReconciler tracks pods status changes and signals kuma-dp when it has to complete
func (*PodStatusReconciler) SetupWithManager ¶
func (r *PodStatusReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
type ServiceReconciler ¶
type ServiceReconciler struct { kube_client.Client Log logr.Logger }
ServiceReconciler reconciles a Service object
func (*ServiceReconciler) Reconcile ¶
func (r *ServiceReconciler) Reconcile(ctx context.Context, req kube_ctrl.Request) (kube_ctrl.Result, error)
Reconcile is in charge of injecting "ingress.kubernetes.io/service-upstream" annotation to the Services that are in Kuma enabled namespaces
func (*ServiceReconciler) SetupWithManager ¶
func (r *ServiceReconciler) SetupWithManager(mgr kube_ctrl.Manager) error
Source Files ¶
- cni_taint_controller.go
- configmap_controller.go
- egress_converter.go
- endpoints.go
- gateway_converter.go
- gateway_instance_controller.go
- inbound_converter.go
- ingress_converter.go
- kube_hosts_converter.go
- mesh_controller.go
- mesh_defaults_controller.go
- namespace_controller.go
- outbound_converter.go
- pod_controller.go
- pod_converter.go
- pod_status_controller.go
- probes.go
- service_controller.go