Documentation
¶
Overview ¶
Package v1alpha1 contains API schema definitions for the Multi-Cluster Services v1alpha1 API group. +kubebuilder:object:generate=true +groupName=multicluster.x-k8s.io
Index ¶
- Constants
- Variables
- func NewServiceExportCondition(t ServiceExportConditionType, status metav1.ConditionStatus, ...) metav1.Condition
- func NewServiceImportCondition(t ServiceImportConditionType, status metav1.ConditionStatus, ...) metav1.Condition
- func Resource(resource string) schema.GroupResource
- type ClusterStatus
- type ServiceExport
- type ServiceExportConditionReason
- type ServiceExportConditionType
- type ServiceExportList
- type ServiceExportSpec
- type ServiceExportStatus
- type ServiceImport
- type ServiceImportConditionReason
- type ServiceImportConditionType
- type ServiceImportList
- type ServiceImportSpec
- type ServiceImportStatus
- type ServiceImportType
- type ServicePort
Constants ¶
const ( // ServiceExportPluralName is the plural name of ServiceExport ServiceExportPluralName = "serviceexports" // ServiceExportKindName is the kind name of ServiceExport ServiceExportKindName = "ServiceExport" // ServiceExportFullName is the full name of ServiceExport ServiceExportFullName = ServiceExportPluralName + "." + GroupName )
const ( // ServiceExportValid means that the service referenced by this // service export has been recognized as valid by an mcs-controller. // This will be false if the service is found to be unexportable // (ExternalName, not found). // // Deprecated: use ServiceExportConditionValid instead ServiceExportValid = "Valid" // ServiceExportConflict means that there is a conflict between two // exports for the same Service. When "True", the condition message // should contain enough information to diagnose the conflict: // field(s) under contention, which cluster won, and why. // Users should not expect detailed per-cluster information in the // conflict message. // // Deprecated: use ServiceExportConditionConflict instead ServiceExportConflict = "Conflict" )
const ( // ServiceExportConditionValid is true when the Service Export is valid. // This does not indicate whether or not the configuration has been exported // to a control plane / data plane. // // // Possible reasons for this condition to be true are: // // * "Valid" // // Possible reasons for this condition to be False are: // // * "NoService" // * "InvalidServiceType" // // Controllers may raise this condition with other reasons, // but should prefer to use the reasons listed above to improve // interoperability. ServiceExportConditionValid ServiceExportConditionType = "Valid" // ServiceExportReasonValid is used with the "Valid" condition when the // condition is True. ServiceExportReasonValid ServiceExportConditionReason = "Valid" // ServiceExportReasonNoService is used with the "Valid" condition when // the associated Service does not exist. ServiceExportReasonNoService ServiceExportConditionReason = "NoService" // ServiceExportReasonInvalidServiceType is used with the "Valid" // condition when the associated Service has an invalid type // (per the KEP at least the ExternalName type). ServiceExportReasonInvalidServiceType ServiceExportConditionReason = "InvalidServiceType" )
const ( // ServiceExportConditionReady is true when the service is exported // to some control plane or data plane or ready to be pulled. // // // Possible reasons for this condition to be true are: // // * "Exported" // * "Ready" // // Possible reasons for this condition to be False are: // // * "Pending" // * "Failed" // // Possible reasons for this condition to be Unknown are: // // * "Pending" // // Controllers may raise this condition with other reasons, // but should prefer to use the reasons listed above to improve // interoperability. ServiceExportConditionReady ServiceExportConditionType = "Ready" // ServiceExportReasonExported is used with the "Ready" condition // when the condition is True and the service has been exported. // This would be used when an implementation exports a service // to a control plane or data plane. ServiceExportReasonExported ServiceExportConditionReason = "Exported" // ServiceExportReasonReady is used with the "Ready" condition // when the condition is True and the service has been exported. // This would typically be used in an implementation that uses a // pull model. ServiceExportReasonReady ServiceExportConditionReason = "Ready" // ServiceExportReasonPending is used with the "Ready" condition // when the service is in the process of being exported. ServiceExportReasonPending ServiceExportConditionReason = "Pending" // ServiceExportReasonFailed is used with the "Ready" condition // when the service failed to be exported with the message providing // the specific reason. ServiceExportReasonFailed ServiceExportConditionReason = "Failed" )
const ( // ServiceExportConditionConflict indicates that some property of an // exported service has conflicting values across the constituent // ServiceExports. This condition must be at least raised on the // conflicting ServiceExport and is recommended to be raised on all on // all the constituent ServiceExports if feasible. // // // Possible reasons for this condition to be true are: // // * "PortConflict" // * "TypeConflict" // * "SessionAffinityConflict" // * "SessionAffinityConfigConflict" // * "AnnotationsConflict" // * "LabelsConflict" // // When multiple conflicts occurs the above reasons may be combined // using commas. // // Possible reasons for this condition to be False are: // // * "NoConflicts" // // Controllers may raise this condition with other reasons, // but should prefer to use the reasons listed above to improve // interoperability. ServiceExportConditionConflict ServiceExportConditionType = "Conflict" // ServiceExportReasonPortConflict is used with the "Conflict" condition // when the exported service has a conflict related to port configuration // if the ports are not identical in all the constituent Services. ServiceExportReasonPortConflict ServiceExportConditionReason = "PortConflict" // ServiceExportReasonTypeConflict is used with the "Conflict" condition // when the exported service has a conflict related to the service type // (eg headless vs non-headless). ServiceExportReasonTypeConflict ServiceExportConditionReason = "TypeConflict" // ServiceExportReasonSessionAffinityConflict is used with the "Conflict" // condition when the exported service has a conflict related to session affinity. ServiceExportReasonSessionAffinityConflict ServiceExportConditionReason = "SessionAffinityConflict" // ServiceExportReasonSessionAffinityConfigConflict is used with the // "Conflict" condition when the exported service has a conflict related // to session affinity config. ServiceExportReasonSessionAffinityConfigConflict ServiceExportConditionReason = "SessionAffinityConfigConflict" // ServiceExportReasonLabelsConflict is used with the "Conflict" // condition when the ServiceExport has a conflict related to exported // labels. ServiceExportReasonLabelsConflict ServiceExportConditionReason = "LabelsConflict" // ServiceExportReasonAnnotationsConflict is used with the "Conflict" // condition when the ServiceExport has a conflict related to exported // annotations. ServiceExportReasonAnnotationsConflict ServiceExportConditionReason = "AnnotationsConflict" // ServiceExportReasonInternalTrafficPolicyConflict is used with the "Conflict" // condition when the exported service has a conflict related to internal traffic policy. ServiceExportReasonInternalTrafficPolicyConflict ServiceExportConditionReason = "InternalTrafficPolicyConflict" // ServiceExportReasonTrafficDistributionConflict is used with the "Conflict" // condition when the exported service has a conflict related to traffic distribution. ServiceExportReasonTrafficDistributionConflict ServiceExportConditionReason = "TrafficDistributionConflict" // ServiceExportReasonIPFamilyConflict is used with the "Conflict" condition // when the exported service has a conflict related to IPFamilies. // The handling of IP families is implementation-specific but this condition // must be used if a conflicting IP family may result in network traffic reaching // only a subset of the backends depending on the IP protocol used. ServiceExportReasonIPFamilyConflict ServiceExportConditionReason = "IPFamilyConflict" // ServiceExportReasonNoConflicts is used with the "Conflict" condition // when the condition is False. ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts" )
const ( // ServiceImportPluralName is the plural name of ServiceImport ServiceImportPluralName = "serviceimports" // ServiceImportKindName is the kind name of ServiceImport ServiceImportKindName = "ServiceImport" // ServiceImportFullName is the full name of ServiceImport ServiceImportFullName = ServiceImportPluralName + "." + GroupName )
const ( // ServiceImportConditionReady is true when the Service Import is ready. // // // Possible reasons for this condition to be true are: // // * "Ready" // // Possible reasons for this condition to be False are: // // * "Pending" // * "IPFamilyNotSupported" // // Possible reasons for this condition to be Unknown are: // // * "Pending" // // Controllers may raise this condition with other reasons, // but should prefer to use the reasons listed above to improve // interoperability. ServiceImportConditionReady ServiceImportConditionType = "Ready" // ServiceImportReasonReady is used with the "Ready" condition when the // condition is True. ServiceImportReasonReady ServiceImportConditionReason = "Ready" // ServiceImportReasonPending is used with the "Ready" condition when // the ServiceImport is in the process of being created or updated. ServiceImportReasonPending ServiceImportConditionReason = "Pending" // ServiceImportReasonIPFamilyNotSupported is used with the "Ready" // condition when the service can not be imported due to IP families // mismatch. ServiceImportReasonIPFamilyNotSupported ServiceImportConditionReason = "IPFamilyNotSupported" )
const ( // LabelServiceName is used to indicate the name of multi-cluster service // that an EndpointSlice belongs to. LabelServiceName = "multicluster.kubernetes.io/service-name" // LabelSourceCluster is used to indicate the name of the cluster in which an exported resource exists. LabelSourceCluster = "multicluster.kubernetes.io/source-cluster" )
const GroupName = "multicluster.x-k8s.io"
GroupName specifies the group name used to register the objects.
Variables ¶
var ( // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder // Deprecated: use Install instead AddToScheme = localSchemeBuilder.AddToScheme Install = localSchemeBuilder.AddToScheme )
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}
GroupVersion specifies the group and the version used to register the objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.
var ServiceExportVersionedName = ServiceExportKindName + "/" + GroupVersion.Version
ServiceExportVersionedName is the versioned name of ServiceExport
var ServiceImportVersionedName = ServiceImportKindName + "/" + GroupVersion.Version
ServiceImportVersionedName is the versioned name of ServiceImport
Functions ¶
func NewServiceExportCondition ¶ added in v0.3.0
func NewServiceExportCondition(t ServiceExportConditionType, status metav1.ConditionStatus, reason ServiceExportConditionReason, msg string) metav1.Condition
NewServiceExportCondition creates a new ServiceExport condition
func NewServiceImportCondition ¶ added in v0.3.0
func NewServiceImportCondition(t ServiceImportConditionType, status metav1.ConditionStatus, reason ServiceImportConditionReason, msg string) metav1.Condition
NewServiceImportCondition creates a new ServiceImport condition
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type ClusterStatus ¶
type ClusterStatus struct {
// cluster is the name of the exporting cluster. Must be a valid RFC-1123 DNS
// label.
Cluster string `json:"cluster"`
}
ClusterStatus contains service configuration mapped to a specific source cluster
func (*ClusterStatus) DeepCopy ¶
func (in *ClusterStatus) DeepCopy() *ClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (*ClusterStatus) DeepCopyInto ¶
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceExport ¶
type ServiceExport struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// spec defines the behavior of a ServiceExport.
// +optional
Spec ServiceExportSpec `json:"spec,omitempty"`
// status describes the current state of an exported service.
// Service configuration comes from the Service that had the same
// name and namespace as this ServiceExport.
// Populated by the multi-cluster service implementation's controller.
// +optional
Status ServiceExportStatus `json:"status,omitempty"`
}
ServiceExport declares that the Service with the same name and namespace as this export should be consumable from other clusters.
func (*ServiceExport) DeepCopy ¶
func (in *ServiceExport) DeepCopy() *ServiceExport
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExport.
func (*ServiceExport) DeepCopyInto ¶
func (in *ServiceExport) DeepCopyInto(out *ServiceExport)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceExport) DeepCopyObject ¶
func (in *ServiceExport) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServiceExportConditionReason ¶ added in v0.3.0
type ServiceExportConditionReason string
ServiceExportConditionReason defines the set of reasons that explain why a particular ServiceExport condition type has been raised.
type ServiceExportConditionType ¶
type ServiceExportConditionType string
ServiceExportConditionType is a type of condition associated with a ServiceExport. This type should be used with the ServiceExportStatus.Conditions field.
type ServiceExportList ¶
type ServiceExportList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of endpoint slices
// +listType=set
Items []ServiceExport `json:"items"`
}
ServiceExportList represents a list of endpoint slices
func (*ServiceExportList) DeepCopy ¶
func (in *ServiceExportList) DeepCopy() *ServiceExportList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportList.
func (*ServiceExportList) DeepCopyInto ¶
func (in *ServiceExportList) DeepCopyInto(out *ServiceExportList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceExportList) DeepCopyObject ¶
func (in *ServiceExportList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServiceExportSpec ¶ added in v0.2.0
type ServiceExportSpec struct {
// exportedLabels describes the labels exported. It is optional for implementation.
// +optional
ExportedLabels map[string]string `json:"exportedLabels,omitempty"`
// exportedAnnotations describes the annotations exported. It is optional for implementation.
// +optional
ExportedAnnotations map[string]string `json:"exportedAnnotations,omitempty"`
}
ServiceExportSpec describes an exported service extra information
func (*ServiceExportSpec) DeepCopy ¶ added in v0.2.0
func (in *ServiceExportSpec) DeepCopy() *ServiceExportSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportSpec.
func (*ServiceExportSpec) DeepCopyInto ¶ added in v0.2.0
func (in *ServiceExportSpec) DeepCopyInto(out *ServiceExportSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceExportStatus ¶
type ServiceExportStatus struct {
// +optional
// +patchStrategy=merge
// +patchMergeKey=type
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
ServiceExportStatus contains the current status of an export.
func (*ServiceExportStatus) DeepCopy ¶
func (in *ServiceExportStatus) DeepCopy() *ServiceExportStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportStatus.
func (*ServiceExportStatus) DeepCopyInto ¶
func (in *ServiceExportStatus) DeepCopyInto(out *ServiceExportStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceImport ¶
type ServiceImport struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// spec defines the behavior of a ServiceImport.
// +optional
Spec ServiceImportSpec `json:"spec,omitempty"`
// status contains information about the exported services that form
// the multi-cluster service referenced by this ServiceImport.
// +optional
Status ServiceImportStatus `json:"status,omitempty"`
}
ServiceImport describes a service imported from clusters in a ClusterSet.
func (*ServiceImport) DeepCopy ¶
func (in *ServiceImport) DeepCopy() *ServiceImport
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImport.
func (*ServiceImport) DeepCopyInto ¶
func (in *ServiceImport) DeepCopyInto(out *ServiceImport)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceImport) DeepCopyObject ¶
func (in *ServiceImport) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServiceImportConditionReason ¶ added in v0.3.0
type ServiceImportConditionReason string
ServiceImportConditionReason defines the set of reasons that explain why a particular ServiceImport condition type has been raised.
type ServiceImportConditionType ¶ added in v0.3.0
type ServiceImportConditionType string
ServiceImportConditionType is a type of condition associated with a ServiceImport. This type should be used with the ServiceImportStatus.Conditions field.
type ServiceImportList ¶
type ServiceImportList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// +optional
metav1.ListMeta `json:"metadata,omitempty"`
// List of endpoint slices
// +listType=set
Items []ServiceImport `json:"items"`
}
ServiceImportList represents a list of endpoint slices
func (*ServiceImportList) DeepCopy ¶
func (in *ServiceImportList) DeepCopy() *ServiceImportList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportList.
func (*ServiceImportList) DeepCopyInto ¶
func (in *ServiceImportList) DeepCopyInto(out *ServiceImportList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServiceImportList) DeepCopyObject ¶
func (in *ServiceImportList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServiceImportSpec ¶
type ServiceImportSpec struct {
// +listType=atomic
Ports []ServicePort `json:"ports"`
// ip will be used as the VIP for this service when type is ClusterSetIP.
// +kubebuilder:validation:MaxItems:=2
// +optional
IPs []string `json:"ips,omitempty"`
// type defines the type of this service.
// Must be ClusterSetIP or Headless.
// +kubebuilder:validation:Enum=ClusterSetIP;Headless
Type ServiceImportType `json:"type"`
// Supports "ClientIP" and "None". Used to maintain session affinity.
// Enable client IP based session affinity.
// Must be ClientIP or None.
// Defaults to None.
// Ignored when type is Headless
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
// +optional
SessionAffinity v1.ServiceAffinity `json:"sessionAffinity,omitempty"`
// sessionAffinityConfig contains session affinity configuration.
// +optional
SessionAffinityConfig *v1.SessionAffinityConfig `json:"sessionAffinityConfig,omitempty"`
// IPFamilies identifies all the IPFamilies assigned for this ServiceImport.
// +kubebuilder:validation:MaxItems:=2
// +optional
IPFamilies []v1.IPFamily `json:"ipFamilies,omitempty"`
// InternalTrafficPolicy describes how nodes distribute service traffic they
// receive on the ClusterIP. If set to "Local", the proxy will assume that pods
// only want to talk to endpoints of the service on the same node as the pod,
// dropping the traffic if there are no local endpoints. The default value,
// "Cluster", uses the standard behavior of routing to all endpoints evenly
// (possibly modified by topology and other features).
// +optional
InternalTrafficPolicy *v1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"`
// TrafficDistribution offers a way to express preferences for how traffic
// is distributed to Service endpoints. Implementations can use this field
// as a hint, but are not required to guarantee strict adherence. If the
// field is not set, the implementation will apply its default routing
// strategy. If set to "PreferClose", implementations should prioritize
// endpoints that are in the same zone.
// +optional
TrafficDistribution *string `json:"trafficDistribution,omitempty"`
}
ServiceImportSpec describes an imported service and the information necessary to consume it.
func (*ServiceImportSpec) DeepCopy ¶
func (in *ServiceImportSpec) DeepCopy() *ServiceImportSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportSpec.
func (*ServiceImportSpec) DeepCopyInto ¶
func (in *ServiceImportSpec) DeepCopyInto(out *ServiceImportSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceImportStatus ¶
type ServiceImportStatus struct {
// clusters is the list of exporting clusters from which this service
// was derived.
// +optional
// +patchStrategy=merge
// +patchMergeKey=cluster
// +listType=map
// +listMapKey=cluster
Clusters []ClusterStatus `json:"clusters,omitempty"`
// +optional
// +patchStrategy=merge
// +patchMergeKey=type
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
ServiceImportStatus describes derived state of an imported service.
func (*ServiceImportStatus) DeepCopy ¶
func (in *ServiceImportStatus) DeepCopy() *ServiceImportStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportStatus.
func (*ServiceImportStatus) DeepCopyInto ¶
func (in *ServiceImportStatus) DeepCopyInto(out *ServiceImportStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceImportType ¶
type ServiceImportType string
ServiceImportType designates the type of a ServiceImport
const ( // ClusterSetIP are only accessible via the ClusterSet IP. ClusterSetIP ServiceImportType = "ClusterSetIP" // Headless services allow backend pods to be addressed directly. Headless ServiceImportType = "Headless" )
type ServicePort ¶
type ServicePort struct {
// The name of this port within the service. This must be a DNS_LABEL.
// All ports within a ServiceSpec must have unique names. When considering
// the endpoints for a Service, this must match the 'name' field in the
// EndpointPort.
// Optional if only one ServicePort is defined on this service.
// +optional
Name string `json:"name,omitempty"`
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
// Default is TCP.
// +optional
Protocol v1.Protocol `json:"protocol,omitempty"`
// The application protocol for this port.
// This is used as a hint for implementations to offer richer behavior for protocols that they understand.
// This field follows standard Kubernetes label syntax.
// Valid values are either:
//
// * Un-prefixed protocol names - reserved for IANA standard service names (as per
// RFC-6335 and https://www.iana.org/assignments/service-names).
//
// * Kubernetes-defined prefixed names:
// * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540
//
// * Other protocols should use implementation-defined prefixed names such as
// mycompany.com/my-custom-protocol.
// Field can be enabled with ServiceAppProtocol feature gate.
// +optional
AppProtocol *string `json:"appProtocol,omitempty"`
// The port that will be exposed by this service.
Port int32 `json:"port"`
}
ServicePort represents the port on which the service is exposed
func (*ServicePort) DeepCopy ¶
func (in *ServicePort) DeepCopy() *ServicePort
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePort.
func (*ServicePort) DeepCopyInto ¶
func (in *ServicePort) DeepCopyInto(out *ServicePort)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.