Documentation
¶
Index ¶
- Constants
- func CreateDerivedServiceStruct(svcImport *v1alpha1.ServiceImport, importedSvcPorts []*model.Port) *v1.Service
- func CreateEndpointForSlice(svc *v1.Service, ip string) discovery.Endpoint
- func CreateEndpointSliceStruct(svc *v1.Service, svcImportName string) *discovery.EndpointSlice
- func CreateServiceImportStruct(namespace string, name string, servicePorts []*model.Port) *v1alpha1.ServiceImport
- func DerivedName(namespace string, name 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 PortToEndpointPort(port model.Port) discovery.EndpointPort
- func PortToServiceImportPort(port model.Port) v1alpha1.ServicePort
- func PortToServicePort(port model.Port) v1.ServicePort
- func PortsEqualIgnoreOrder(a, b []*model.Port) (equal bool)
- func ServiceImportPortToPort(svcPort v1alpha1.ServicePort) model.Port
- func ServicePortToPort(svcPort v1.ServicePort) model.Port
- type CloudMapReconciler
- type EndpointSliceChanges
- type EndpointSlicePlan
- type ServiceExportReconciler
Constants ¶
const ( K8sVersionAttr = "K8S_CONTROLLER" ServiceExportFinalizer = "multicluster.k8s.aws/service-export-finalizer" EndpointSliceServiceLabel = "kubernetes.io/service-name" )
const ( // DerivedServiceAnnotation annotates a ServiceImport with derived Service name DerivedServiceAnnotation = "multicluster.k8s.aws/derived-service" // LabelServiceImportName indicates the name of the multi-cluster service that an EndpointSlice belongs to. LabelServiceImportName = "multicluster.kubernetes.io/service-name" )
Variables ¶
This section is empty.
Functions ¶
func CreateDerivedServiceStruct ¶ added in v0.2.2
func CreateDerivedServiceStruct(svcImport *v1alpha1.ServiceImport, importedSvcPorts []*model.Port) *v1.Service
CreateDerivedServiceStruct creates struct representation of a derived service
func CreateEndpointForSlice ¶ added in v0.2.2
func CreateEndpointSliceStruct ¶ added in v0.2.2
func CreateEndpointSliceStruct(svc *v1.Service, svcImportName string) *discovery.EndpointSlice
func CreateServiceImportStruct ¶ added in v0.2.2
func CreateServiceImportStruct(namespace string, name string, servicePorts []*model.Port) *v1alpha1.ServiceImport
CreateServiceImportStruct creates struct representation of a ServiceImport
func DerivedName ¶
DerivedName computes the "placeholder" name for an imported service
func EndpointPortToPort ¶ added in v0.2.0
func EndpointPortToPort(port discovery.EndpointPort) model.Port
EndpointPortToPort converts a k8s endpoint port to an internal model port
func ExtractEndpointPorts ¶ added in v0.2.2
ExtractEndpointPorts extracts all unique endpoint ports from a slice of endpoints
func ExtractServicePorts ¶ added in v0.2.2
ExtractServicePorts extracts all unique service ports from a slice of endpoints
func PortToEndpointPort ¶ added in v0.2.0
func PortToEndpointPort(port model.Port) discovery.EndpointPort
PortToEndpointPort converts an internal model port to a k8s endpoint port
func PortToServiceImportPort ¶ added in v0.2.2
func PortToServiceImportPort(port model.Port) v1alpha1.ServicePort
PortToServiceImportPort converts an internal model port to a service import port
func PortToServicePort ¶ added in v0.2.0
func PortToServicePort(port model.Port) v1.ServicePort
PortToServicePort converts an internal model port to a k8s service port
func PortsEqualIgnoreOrder ¶ added in v0.2.2
func ServiceImportPortToPort ¶ added in v0.2.2
func ServiceImportPortToPort(svcPort v1alpha1.ServicePort) model.Port
ServiceImportPortToPort converts a service import port to an internal model port
func ServicePortToPort ¶ added in v0.2.0
func ServicePortToPort(svcPort v1.ServicePort) model.Port
ServicePortToPort converts a k8s service port to internal model port
Types ¶
type CloudMapReconciler ¶
type CloudMapReconciler struct {
Client client.Client
Cloudmap cloudmap.ServiceDiscoveryClient
Log common.Logger
}
CloudMapReconciler reconciles state of Cloud Map services with local ServiceImport objects
type EndpointSliceChanges ¶ added in v0.2.2
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 ¶ added in v0.2.2
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
// contains filtered or unexported fields
}
func (*EndpointSlicePlan) CalculateChanges ¶ added in v0.2.2
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
}
ServiceExportReconciler reconciles a ServiceExport object
func (*ServiceExportReconciler) SetupWithManager ¶
func (r *ServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error