Documentation
¶
Index ¶
- Constants
- func CreateDerivedServiceAnnotation(namespace string, name string, clusterIds []string) string
- func CreateDerivedServiceStruct(svcImport *multiclusterv1alpha1.ServiceImport, importedSvcPorts []*model.Port, ...) *v1.Service
- func CreateEndpointForSlice(svc *v1.Service, endpoint *model.Endpoint) discovery.Endpoint
- func CreateEndpointSliceStruct(svc *v1.Service, svcImportName string, clusterId string) *discovery.EndpointSlice
- func CreateServiceImportStruct(svc *model.Service, clusterIds []string, servicePorts []*model.Port) *multiclusterv1alpha1.ServiceImport
- func DerivedName(namespace string, name string, clusterId string) string
- func EndpointPortToPort(port discovery.EndpointPort) model.Port
- func ExtractEndpointPorts(endpoints []*model.Endpoint) (endpointPorts []*model.Port)
- func ExtractServicePorts(endpoints []*model.Endpoint) (servicePorts []*model.Port)
- func ExtractServiceType(svc *v1.Service) model.ServiceType
- func GetClusterIpsFromServices(services []*v1.Service) []string
- func IPsEqualIgnoreOrder(a, b []string) (equal bool)
- func PortToEndpointPort(port model.Port) discovery.EndpointPort
- func PortToServiceImportPort(port model.Port) multiclusterv1alpha1.ServicePort
- func PortToServicePort(port model.Port) v1.ServicePort
- func PortsEqualIgnoreOrder(a, b []*model.Port) (equal bool)
- func ServiceImportPortToPort(svcPort multiclusterv1alpha1.ServicePort) model.Port
- func ServicePortToPort(svcPort v1.ServicePort) model.Port
- func ServiceTypetoServiceImportType(serviceType model.ServiceType) multiclusterv1alpha1.ServiceImportType
- type CloudMapReconciler
- type EndpointSliceChanges
- type EndpointSlicePlan
- type ServiceExportReconciler
Constants ¶
const ( // DerivedServiceAnnotation annotates a ServiceImport with derived Service name DerivedServiceAnnotation = "multicluster.k8s.aws/derived-service" // ServiceExportFinalizer finalizer to perform cloudmap resource cleanup on delete ServiceExportFinalizer = "multicluster.k8s.aws/service-export-finalizer" // LabelServiceImportName indicates the name of the multi-cluster service that an EndpointSlice belongs to. LabelServiceImportName = "multicluster.kubernetes.io/service-name" // LabelDerivedServiceOriginatingName indicates the name of the multi-cluster service that the derived service originated from. LabelDerivedServiceOriginatingName = "multicluster.kubernetes.io/service-name" // LabelEndpointSliceManagedBy indicates the name of the entity that manages the EndpointSlice. LabelEndpointSliceManagedBy = "endpointslice.kubernetes.io/managed-by" // LabelSourceCluster indicates the id of the cluster the object was created for LabelSourceCluster = "multicluster.kubernetes.io/source-cluster" // ValueEndpointSliceManagedBy indicates the name of the entity that manages the EndpointSlice. ValueEndpointSliceManagedBy = "aws-cloud-map-mcs-controller-for-k8s" )
Variables ¶
This section is empty.
Functions ¶
func CreateDerivedServiceAnnotation ¶
CreateDerivedServiceAnnotation creates a JSON object containing a slice of maps of clusterIds and derived service names
func CreateDerivedServiceStruct ¶
func CreateDerivedServiceStruct(svcImport *multiclusterv1alpha1.ServiceImport, importedSvcPorts []*model.Port, clusterId string) *v1.Service
CreateDerivedServiceStruct creates struct representation of a derived service
func CreateEndpointForSlice ¶
func CreateServiceImportStruct ¶
func CreateServiceImportStruct(svc *model.Service, clusterIds []string, servicePorts []*model.Port) *multiclusterv1alpha1.ServiceImport
CreateServiceImportStruct creates struct representation of a ServiceImport
func DerivedName ¶
DerivedName computes the "placeholder" name for an imported service
func EndpointPortToPort ¶
func EndpointPortToPort(port discovery.EndpointPort) model.Port
EndpointPortToPort converts a k8s endpoint port to an internal model port
func ExtractEndpointPorts ¶
ExtractEndpointPorts extracts all unique endpoint ports from a slice of endpoints
func ExtractServicePorts ¶
ExtractServicePorts extracts all unique service ports from a slice of endpoints
func ExtractServiceType ¶
func ExtractServiceType(svc *v1.Service) model.ServiceType
ExtractServiceType finds the ServiceType of a given service as Headless/ClusterSetIP
func GetClusterIpsFromServices ¶
GetClusterIpsFromServices returns list of ClusterIPs from services
func IPsEqualIgnoreOrder ¶
func PortToEndpointPort ¶
func PortToEndpointPort(port model.Port) discovery.EndpointPort
PortToEndpointPort converts an internal model port to a k8s endpoint port
func PortToServiceImportPort ¶
func PortToServiceImportPort(port model.Port) multiclusterv1alpha1.ServicePort
PortToServiceImportPort converts an internal model port to a service import port
func PortToServicePort ¶
func PortToServicePort(port model.Port) v1.ServicePort
PortToServicePort converts an internal model port to a k8s service port
func PortsEqualIgnoreOrder ¶
func ServiceImportPortToPort ¶
func ServiceImportPortToPort(svcPort multiclusterv1alpha1.ServicePort) model.Port
ServiceImportPortToPort converts a service import port to an internal model port
func ServicePortToPort ¶
func ServicePortToPort(svcPort v1.ServicePort) model.Port
ServicePortToPort converts a k8s service port to internal model port
func ServiceTypetoServiceImportType ¶
func ServiceTypetoServiceImportType(serviceType model.ServiceType) multiclusterv1alpha1.ServiceImportType
ServiceTypetoServiceImportType converts model service type to multicluster ServiceImport type
Types ¶
type CloudMapReconciler ¶
type CloudMapReconciler struct { Client client.Client Cloudmap cloudmap.ServiceDiscoveryClient Log common.Logger ClusterUtils model.ClusterUtils }
CloudMapReconciler reconciles state of Cloud Map services with local ServiceImport objects
func (*CloudMapReconciler) DeleteDerivedServiceAndEndpointSlices ¶
type EndpointSliceChanges ¶
type EndpointSliceChanges struct { // Create: List of EndpointSlices that need to be created Create []*discovery.EndpointSlice // Update: List of EndpointSlices that need to be updated Update []*discovery.EndpointSlice // Delete: List of EndpointSlices that need to be deleted Delete []*discovery.EndpointSlice // Unmodified: List of EndpointSlices that do not need to be changed Unmodified []*discovery.EndpointSlice }
type EndpointSlicePlan ¶
type EndpointSlicePlan struct { // Service to reconcile endpoints in Service *v1.Service // ServiceImportName name used to create new EndpointSlices ServiceImportName string // Current EndpontSlices Current []*discovery.EndpointSlice // Desired Endpoints Desired []*model.Endpoint // Cluster the EndpointSlice belongs to ClusterId string // contains filtered or unexported fields }
func (*EndpointSlicePlan) CalculateChanges ¶
func (p *EndpointSlicePlan) CalculateChanges() EndpointSliceChanges
CalculateChanges returns list of EndpointSlice Changes that need to applied
type ServiceExportReconciler ¶
type ServiceExportReconciler struct { Client client.Client Log common.Logger Scheme *runtime.Scheme CloudMap cloudmap.ServiceDiscoveryClient ClusterUtils model.ClusterUtils }
ServiceExportReconciler reconciles a ServiceExport object
func (*ServiceExportReconciler) SetupWithManager ¶
func (r *ServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error