From b8d9d563ee63b36aeb59f5a3dc9220658b77c7ec Mon Sep 17 00:00:00 2001 From: Bastian Hofmann Date: Wed, 23 Oct 2024 11:37:56 +0200 Subject: [PATCH] Changes to ingress config - Remove unused ingress path type routing - Add traefik additionalRuleNames --- api/v1/qdrantcluster_types.go | 29 +++++++------------ api/v1/zz_generated.deepcopy.go | 10 +++---- .../region-crds/qdrant.io_qdrantclusters.yaml | 14 ++++----- docs/api.md | 15 +--------- 4 files changed, 23 insertions(+), 45 deletions(-) diff --git a/api/v1/qdrantcluster_types.go b/api/v1/qdrantcluster_types.go index acbbb5b..88c8620 100644 --- a/api/v1/qdrantcluster_types.go +++ b/api/v1/qdrantcluster_types.go @@ -513,13 +513,6 @@ func (c *QdrantConfigurationTLS) GetKey() *QdrantSecretKeyRef { return c.Key } -type IngressType string - -const ( - TypePath IngressType = "path" - TypeHost IngressType = "host" -) - type Ingress struct { // Enabled specifies whether to enable ingress for the cluster or not. // +optional @@ -530,11 +523,6 @@ type Ingress struct { // IngressClassName specifies the name of the ingress class // +optional IngressClassName *string `json:"ingressClassName,omitempty"` - // Type specifies whether it is path or host based routing. - // +kubebuilder:default="path" - // +kubebuilder:validation:Enum=path;host - // +optional - Type *IngressType `json:"type,omitempty"` // Host specifies the host for the ingress. // +optional Host string `json:"host,omitempty"` @@ -577,13 +565,6 @@ func (i *Ingress) GetTls(def bool) bool { return *i.TLS } -func (i *Ingress) GetType() IngressType { - if i == nil || i.Type == nil { - return TypePath - } - return *i.Type -} - func (i *Ingress) GetNGINX() *NGINXConfig { if i == nil { return nil @@ -625,6 +606,9 @@ type TraefikConfig struct { // AllowedSourceRanges specifies the allowed CIDR source ranges for the ingress. // +optional AllowedSourceRanges []string `json:"allowedSourceRanges,omitempty"` + // AdditionalRuleNames specifies additional rule names for the ingress route. The actual rules can be configured in the operator settings. + // +optional + AdditionalRuleNames []string `json:"additionalRuleNames,omitempty"` } func (c *TraefikConfig) GetAllowedSourceRanges() []string { @@ -634,6 +618,13 @@ func (c *TraefikConfig) GetAllowedSourceRanges() []string { return c.AllowedSourceRanges } +func (c *TraefikConfig) GetAdditionalRuleNames() []string { + if c == nil { + return nil + } + return c.AdditionalRuleNames +} + type StorageClassNames struct { // DB specifies the storage class name for db volume. // +optional diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index c201abd..4c17e3b 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -98,11 +98,6 @@ func (in *Ingress) DeepCopyInto(out *Ingress) { *out = new(string) **out = **in } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(IngressType) - **out = **in - } if in.TLS != nil { in, out := &in.TLS, &out.TLS *out = new(bool) @@ -1398,6 +1393,11 @@ func (in *TraefikConfig) DeepCopyInto(out *TraefikConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.AdditionalRuleNames != nil { + in, out := &in.AdditionalRuleNames, &out.AdditionalRuleNames + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraefikConfig. diff --git a/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml b/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml index 9cb580f..0d14945 100644 --- a/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml +++ b/charts/qdrant-kubernetes-api/templates/region-crds/qdrant.io_qdrantclusters.yaml @@ -323,6 +323,13 @@ spec: traefik: description: Traefik specifies the traefik ingress specific configurations. properties: + additionalRuleNames: + description: AdditionalRuleNames specifies additional rule + names for the ingress route. The actual rules can be configured + in the operator settings. + items: + type: string + type: array allowedSourceRanges: description: AllowedSourceRanges specifies the allowed CIDR source ranges for the ingress. @@ -330,13 +337,6 @@ spec: type: string type: array type: object - type: - default: path - description: Type specifies whether it is path or host based routing. - enum: - - path - - host - type: string type: object nodeSelector: additionalProperties: diff --git a/docs/api.md b/docs/api.md index befc26e..249604a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -122,7 +122,6 @@ _Appears in:_ | `enabled` _boolean_ | Enabled specifies whether to enable ingress for the cluster or not. | | | | `annotations` _object (keys:string, values:string)_ | Annotations specifies annotations for the ingress. | | | | `ingressClassName` _string_ | IngressClassName specifies the name of the ingress class | | | -| `type` _[IngressType](#ingresstype)_ | Type specifies whether it is path or host based routing. | path | Enum: [path host]
| | `host` _string_ | Host specifies the host for the ingress. | | | | `tls` _boolean_ | TLS specifies whether to enable tls for the ingress.
The default depends on the ingress provider:
- KubernetesIngress: False
- NginxIngress: False
- QdrantCloudTraefik: Depending on the config.tls setting of the operator. | | | | `tlsSecretName` _string_ | TLSSecretName specifies the name of the secret containing the tls certificate. | | | @@ -130,19 +129,6 @@ _Appears in:_ | `traefik` _[TraefikConfig](#traefikconfig)_ | Traefik specifies the traefik ingress specific configurations. | | | -#### IngressType - -_Underlying type:_ _string_ - - - - - -_Appears in:_ -- [Ingress](#ingress) - - - #### KubernetesDistribution _Underlying type:_ _string_ @@ -1053,6 +1039,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | | `allowedSourceRanges` _string array_ | AllowedSourceRanges specifies the allowed CIDR source ranges for the ingress. | | | +| `additionalRuleNames` _string array_ | AdditionalRuleNames specifies additional rule names for the ingress route. The actual rules can be configured in the operator settings. | | | #### VolumeSnapshotInfo