diff --git a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml index c9e1ea91..b5afe520 100644 --- a/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml +++ b/operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml @@ -580,6 +580,34 @@ spec: required: - host type: object + loadBalancer: + description: LoadBalancer points customized configuration + for loadBalancer type. + properties: + caBundle: + description: CABundle is a customized caBundle of + the endpoint. + format: byte + type: string + host: + description: Host is the customized host name of + the endpoint. + type: string + type: object + route: + description: Route points customized configuration for + route type. + properties: + caBundle: + description: CABundle is a customized caBundle of + the endpoint. + format: byte + type: string + host: + description: Host is the customized host name of + the endpoint. + type: string + type: object type: default: hostname description: |- @@ -587,6 +615,8 @@ spec: You may need to apply an object to expose the endpoint, for example: a route. enum: - hostname + - loadBalancer + - route type: string required: - type @@ -609,6 +639,34 @@ spec: required: - host type: object + loadBalancer: + description: LoadBalancer points customized configuration + for loadBalancer type. + properties: + caBundle: + description: CABundle is a customized caBundle of + the endpoint. + format: byte + type: string + host: + description: Host is the customized host name of + the endpoint. + type: string + type: object + route: + description: Route points customized configuration for + route type. + properties: + caBundle: + description: CABundle is a customized caBundle of + the endpoint. + format: byte + type: string + host: + description: Host is the customized host name of + the endpoint. + type: string + type: object type: default: hostname description: |- @@ -616,6 +674,8 @@ spec: You may need to apply an object to expose the endpoint, for example: a route. enum: - hostname + - loadBalancer + - route type: string required: - type diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index 00b4056d..c17cd4a1 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -197,15 +197,22 @@ type EndpointExposure struct { type Endpoint struct { // type specifies how the endpoint is exposed. // You may need to apply an object to expose the endpoint, for example: a route. - // TODO: support loadbalancer. // +kubebuilder:default:=hostname - // +kubebuilder:validation:Enum=hostname + // +kubebuilder:validation:Enum=hostname;loadBalancer;route // +required Type EndpointExposureType `json:"type,omitempty"` // hostname points to a fixed hostname for serving agents' handshakes. // +optional Hostname *HostnameConfig `json:"hostname,omitempty"` + + // LoadBalancer points customized configuration for loadBalancer type. + // +optional + LoadBalancer *LoadBalancerConfig `json:"loadBalancer,omitempty"` + + // Route points customized configuration for route type. + // +optional + Route *RouteConfig `json:"route,omitempty"` } // HostnameConfig references a fixed hostname. @@ -219,12 +226,40 @@ type HostnameConfig struct { CABundle []byte `json:"caBundle,omitempty"` } -// GRPCEndpointExposureType represents the type of endpoint exposure for gRPC. +// LoadBalancerConfig references customized configuration for LoadBalancer type. +type LoadBalancerConfig struct { + // Host is the customized host name of the endpoint. + // +optional + Host string `json:"host,omitempty"` + + // CABundle is a customized caBundle of the endpoint. + // +optional + CABundle []byte `json:"caBundle,omitempty"` +} + +// RouteConfig references customized configuration for Route type. +type RouteConfig struct { + // Host is the customized host name of the endpoint. + // +optional + Host string `json:"host,omitempty"` + + // CABundle is a customized caBundle of the endpoint. + // +optional + CABundle []byte `json:"caBundle,omitempty"` +} + +// EndpointExposureType represents the type of endpoint exposure. type EndpointExposureType string const ( // EndpointTypeHostname is the endpoint exposure type for hostname. EndpointTypeHostname EndpointExposureType = "hostname" + + // EndpointTypeLoadBalancer is the endpoint exposure type for load balancer. + EndpointTypeLoadBalancer EndpointExposureType = "loadBalancer" + + // EndpointTypeRoute is the endpoint exposure type for route. + EndpointTypeRoute EndpointExposureType = "route" ) type CSRConfig struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 66720221..4f932e92 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -364,6 +364,16 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = new(HostnameConfig) (*in).DeepCopyInto(*out) } + if in.LoadBalancer != nil { + in, out := &in.LoadBalancer, &out.LoadBalancer + *out = new(LoadBalancerConfig) + (*in).DeepCopyInto(*out) + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = new(RouteConfig) + (*in).DeepCopyInto(*out) + } return } @@ -703,6 +713,27 @@ func (in *KubeConfigSecret) DeepCopy() *KubeConfigSecret { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerConfig) DeepCopyInto(out *LoadBalancerConfig) { + *out = *in + if in.CABundle != nil { + in, out := &in.CABundle, &out.CABundle + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerConfig. +func (in *LoadBalancerConfig) DeepCopy() *LoadBalancerConfig { + if in == nil { + return nil + } + out := new(LoadBalancerConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalSecretsConfig) DeepCopyInto(out *LocalSecretsConfig) { *out = *in @@ -918,6 +949,27 @@ func (in *ResourceRequirement) DeepCopy() *ResourceRequirement { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteConfig) DeepCopyInto(out *RouteConfig) { + *out = *in + if in.CABundle != nil { + in, out := &in.CABundle, &out.CABundle + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteConfig. +func (in *RouteConfig) DeepCopy() *RouteConfig { + if in == nil { + return nil + } + out := new(RouteConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServerConfiguration) DeepCopyInto(out *ServerConfiguration) { *out = *in