Skip to content

Commit

Permalink
Added flg that can disable to ingress defaultBackend (#1976)
Browse files Browse the repository at this point in the history
* Added flg that can disable to ingress defaultBE

* Update values.yaml

* undo ingress.eneble

* Supports detailed setting of defaultBackend

* Supports detailed setting of defaultBackend

* Determine if defaultBackend is nil or empty

* fixed newline handling

* fixed newline handling

* Supports detailed setting of defaultBackend

* add schema

* refactoring defaultBackend

* Consolidate logic in h

* moved defaults.defaultBackend to gateways settings

* Added flg that can disable to ingress defaultBE

* Added flg that can disable to ingress defaultBE

* fixed defaultBackend
  • Loading branch information
takuyaymd authored May 30, 2023
1 parent 152ac56 commit 12e0bd9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions charts/vald-helm-operator/crds/valdrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,11 @@ spec:
enum:
- glg
- zap
networkPolicy:
type: object
properties:
enabled:
type: boolean
observability:
type: object
properties:
Expand Down Expand Up @@ -4133,6 +4138,11 @@ spec:
annotations:
type: object
x-kubernetes-preserve-unknown-fields: true
defaultBackend:
type: object
properties:
enabled:
type: boolean
enabled:
type: boolean
host:
Expand Down Expand Up @@ -5287,6 +5297,11 @@ spec:
annotations:
type: object
x-kubernetes-preserve-unknown-fields: true
defaultBackend:
type: object
properties:
enabled:
type: boolean
enabled:
type: boolean
host:
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/gateway/filter/ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ metadata:
app.kubernetes.io/component: gateway-filter
name: {{ $gateway.name }}-ingress
spec:
{{- if $gateway.ingress.defaultBackend.enabled }}
defaultBackend:
service:
name: {{ $gateway.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }}
{{- end }}
rules:
- host: {{ $gateway.ingress.host }}
http:
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/gateway/lb/ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ metadata:
app.kubernetes.io/component: gateway-lb
name: {{ $gateway.name }}-ingress
spec:
{{- if $gateway.ingress.defaultBackend.enabled }}
defaultBackend:
service:
name: {{ $gateway.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 6 }}
{{- end }}
rules:
- host: {{ $gateway.ingress.host }}
http:
Expand Down
29 changes: 29 additions & 0 deletions charts/vald/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,15 @@
}
}
},
"networkPolicy": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "if network policy enabled TODO: Change this to true after implementing user custom network policy parser"
}
}
},
"observability": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -6829,6 +6838,16 @@
"type": "object",
"description": "annotations for ingress"
},
"defaultBackend": {
"type": "object",
"description": "defaultBackend config",
"properties": {
"enabled": {
"type": "boolean",
"description": "gateway ingress defaultBackend enabled"
}
}
},
"enabled": {
"type": "boolean",
"description": "gateway ingress enabled"
Expand Down Expand Up @@ -8767,6 +8786,16 @@
"type": "object",
"description": "annotations for ingress"
},
"defaultBackend": {
"type": "object",
"description": "defaultBackend config",
"properties": {
"enabled": {
"type": "boolean",
"description": "gateway ingress defaultBackend enabled"
}
}
},
"enabled": {
"type": "boolean",
"description": "gateway ingress enabled"
Expand Down
12 changes: 12 additions & 0 deletions charts/vald/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,12 @@ gateway:
# @schema {"name": "gateway.lb.ingress.servicePort", "type": "string"}
# gateway.lb.ingress.servicePort -- service port to be exposed by ingress
servicePort: grpc
# @schema {"name": "gateway.lb.ingress.defaultBackend", "type": "object"}
# gateway.lb.ingress.defaultBackend -- defaultBackend config
defaultBackend:
# @schema {"name": "gateway.lb.ingress.defaultBackend.enabled", "type": "boolean"}
# gateway.lb.ingress.defaultBackend.enabled -- gateway ingress defaultBackend enabled
enabled: true
# @schema {"name": "gateway.lb.resources", "type": "object", "anchor": "resources"}
# gateway.lb.resources -- compute resources
resources:
Expand Down Expand Up @@ -1344,6 +1350,12 @@ gateway:
# @schema {"name": "gateway.filter.ingress.servicePort", "type": "string"}
# gateway.filter.ingress.servicePort -- service port to be exposed by ingress
servicePort: grpc
# @schema {"name": "gateway.filter.ingress.defaultBackend", "type": "object"}
# gateway.filter.ingress.defaultBackend -- defaultBackend config
defaultBackend:
# @schema {"name": "gateway.filter.ingress.defaultBackend.enabled", "type": "boolean"}
# gateway.filter.ingress.defaultBackend.enabled -- gateway ingress defaultBackend enabled
enabled: true
# @schema {"name": "gateway.filter.resources", "type": "object", "anchor": "resources"}
# gateway.filter.resources -- compute resources
resources:
Expand Down

0 comments on commit 12e0bd9

Please sign in to comment.