Skip to content

Commit

Permalink
Update CRDs for ClustersetIP fields
Browse files Browse the repository at this point in the history
Add fields to CRDs to support ClustersetIPs

Refer: submariner-io/enhancements#230

Signed-off-by: Vishal Thapar <[email protected]>
  • Loading branch information
vthapar committed Sep 6, 2024
1 parent a131f83 commit e46df1d
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 14 deletions.
13 changes: 13 additions & 0 deletions api/v1alpha1/broker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ type BrokerSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:fieldDependency:globalnetEnabled:true","urn:alm:descriptor:com.tectonic.ui:advanced"}
GlobalnetCIDRRange string `json:"globalnetCIDRRange,omitempty"`

// ClustersetIP supernet range for allocating ClustersetIPCIDRs to each cluster.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ClustersetIP CIDR Range"
//nolint:lll // Markers can't be wrapped
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:advanced"}
// +optional
ClustersetIPCIDRRange string `json:"clustersetIPCIDRRange,omitempty"`

// Default cluster size for GlobalCIDR allocated to each cluster (amount of global IPs).
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Default Globalnet Cluster Size"
//nolint:lll // Markers can't be wrapped
Expand All @@ -57,6 +64,12 @@ type BrokerSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Enable Globalnet"
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
GlobalnetEnabled bool `json:"globalnetEnabled,omitempty"`

// Enable ClustersetIP default for connecting clusters.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Enable ClustersetIP"
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// +optional
ClustersetIPEnabled bool `json:"clustersetIPEnabled,omitempty"`
}

// BrokerStatus defines the observed state of Broker.
Expand Down
32 changes: 18 additions & 14 deletions api/v1alpha1/servicediscovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,24 @@ type ServiceDiscoverySpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

BrokerK8sApiServer string `json:"brokerK8sApiServer"`
BrokerK8sApiServerToken string `json:"brokerK8sApiServerToken,omitempty"`
BrokerK8sCA string `json:"brokerK8sCA,omitempty"`
BrokerK8sSecret string `json:"brokerK8sSecret,omitempty"`
BrokerK8sRemoteNamespace string `json:"brokerK8sRemoteNamespace"`
ClusterID string `json:"clusterID"`
Namespace string `json:"namespace"`
Repository string `json:"repository,omitempty"`
Version string `json:"version,omitempty"`
Debug bool `json:"debug"`
GlobalnetEnabled bool `json:"globalnetEnabled,omitempty"`
BrokerK8sInsecure bool `json:"brokerK8sInsecure,omitempty"`
HaltOnCertificateError bool `json:"haltOnCertificateError,omitempty"`
CoreDNSCustomConfig *CoreDNSCustomConfig `json:"coreDNSCustomConfig,omitempty"`
BrokerK8sApiServer string `json:"brokerK8sApiServer"`
BrokerK8sApiServerToken string `json:"brokerK8sApiServerToken,omitempty"`
BrokerK8sCA string `json:"brokerK8sCA,omitempty"`
BrokerK8sSecret string `json:"brokerK8sSecret,omitempty"`
BrokerK8sRemoteNamespace string `json:"brokerK8sRemoteNamespace"`
ClusterID string `json:"clusterID"`
Namespace string `json:"namespace"`
Repository string `json:"repository,omitempty"`
Version string `json:"version,omitempty"`
// +optional
ClustersetIPCIDR string `json:"clustersetIPCIDR,omitempty"`
Debug bool `json:"debug"`
GlobalnetEnabled bool `json:"globalnetEnabled,omitempty"`
BrokerK8sInsecure bool `json:"brokerK8sInsecure,omitempty"`
HaltOnCertificateError bool `json:"haltOnCertificateError,omitempty"`
// +optional
ClustersetIPEnabled bool `json:"clustersetIPEnabled,omitempty"`
CoreDNSCustomConfig *CoreDNSCustomConfig `json:"coreDNSCustomConfig,omitempty"`
// +listType=set
CustomDomains []string `json:"customDomains,omitempty"`
ImageOverrides map[string]string `json:"imageOverrides,omitempty"`
Expand Down
18 changes: 18 additions & 0 deletions api/v1alpha1/submariner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ type SubmarinerSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:advanced"}
GlobalCIDR string `json:"globalCIDR,omitempty"`

// ClustersetIP CIDR for allocating ClustersetIPs to exported services.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ClustersetIP CIDR"
//nolint:lll // Markers can't be wrapped
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:advanced"}
// +optional
ClustersetIPCIDR string `json:"clustersetIPCIDR,omitempty"`

// The namespace in which to deploy the submariner operator.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Namespace"
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
Expand Down Expand Up @@ -174,6 +181,12 @@ type SubmarinerSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
HaltOnCertificateError bool `json:"haltOnCertificateError,omitempty"`

// Enable ClustersetIP default for services exported on this cluster.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Enable ClustersetIP default"
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// +optional
ClustersetIPEnabled bool `json:"clustersetIPEnabled,omitempty"`

// Name of the custom CoreDNS configmap to configure forwarding to Lighthouse.
// It should be in <namespace>/<name> format where <namespace> is optional and defaults to kube-system.
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="CoreDNS Custom Config"
Expand Down Expand Up @@ -237,6 +250,11 @@ type SubmarinerStatus struct {
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
GlobalCIDR string `json:"globalCIDR,omitempty"`

// The current clustersetIP CIDR.
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="ClustersetIP CIDR"
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
ClustersetIPCIDR string `json:"clustersetIPCIDR,omitempty"`

// The current network plugin.
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Network Plugin"
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/submariner.io_brokers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ spec:
spec:
description: BrokerSpec defines the desired state of Broker.
properties:
clustersetIPCIDRRange:
description: ClustersetIP supernet range for allocating ClustersetIPCIDRs
to each cluster.
type: string
components:
description: List of the components to be installed - any of [service-discovery,
connectivity].
Expand All @@ -56,6 +60,9 @@ spec:
globalnetEnabled:
description: Enable support for Overlapping CIDRs in connecting clusters.
type: boolean
clustersetIPEnabled:
description: Enable ClustersetIP default for connecting clusters.
type: boolean
type: object
status:
description: BrokerStatus defines the observed state of Broker.
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/submariner.io_servicediscoveries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ spec:
type: string
clusterID:
type: string
clustersetIPCIDR:
type: string
coreDNSCustomConfig:
properties:
configMapName:
Expand All @@ -68,6 +70,8 @@ spec:
type: boolean
haltOnCertificateError:
type: boolean
clustersetIPEnabled:
type: boolean
imageOverrides:
additionalProperties:
type: string
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/submariner.io_submariners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ spec:
clusterID:
description: The cluster ID used to identify the tunnels.
type: string
clustersetIPCIDR:
description: ClustersetIP CIDR for allocating ClustersetIPs to exported
services.
type: string
colorCodes:
type: string
connectionHealthCheck:
Expand Down Expand Up @@ -160,6 +164,10 @@ spec:
serviceDiscoveryEnabled:
description: Enable support for Service Discovery (Lighthouse).
type: boolean
clustersetIPEnabled:
description: Enable ClustersetIP default for services exported on this
cluster.
type: boolean
tolerations:
items:
description: The pod this Toleration is attached to tolerates any
Expand Down Expand Up @@ -225,6 +233,9 @@ spec:
clusterID:
description: The current cluster ID.
type: string
clustersetIPCIDR:
description: The current clustersetIP CIDR.
type: string
colorCodes:
type: string
deploymentInfo:
Expand Down
22 changes: 22 additions & 0 deletions pkg/embeddedyamls/yamls.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ spec:
spec:
description: BrokerSpec defines the desired state of Broker.
properties:
clustersetIPCIDRRange:
description: ClustersetIP supernet range for allocating ClustersetIPCIDRs
to each cluster.
type: string
clustersetIPEnabled:
description: Enable ClustersetIP default for connecting clusters.
type: boolean
components:
description: List of the components to be installed - any of [service-discovery,
connectivity].
Expand Down Expand Up @@ -187,6 +194,14 @@ spec:
clusterID:
description: The cluster ID used to identify the tunnels.
type: string
clustersetIPCIDR:
description: ClustersetIP CIDR for allocating ClustersetIPs to exported
services.
type: string
clustersetIPEnabled:
description: Enable ClustersetIP default for services exported on
this cluster.
type: boolean
colorCodes:
type: string
connectionHealthCheck:
Expand Down Expand Up @@ -324,6 +339,9 @@ spec:
clusterID:
description: The current cluster ID.
type: string
clustersetIPCIDR:
description: The current clustersetIP CIDR.
type: string
colorCodes:
type: string
deploymentInfo:
Expand Down Expand Up @@ -1150,6 +1168,10 @@ spec:
type: string
clusterID:
type: string
clustersetIPCIDR:
type: string
clustersetIPEnabled:
type: boolean
coreDNSCustomConfig:
properties:
configMapName:
Expand Down

0 comments on commit e46df1d

Please sign in to comment.