mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-17 16:34:44 -05:00
Add Gateway API HTTPRoute support to the Helm chart (#10095)
Add an opt-in Gateway API HTTPRoute template to the Helm chart as an alternative to the existing Ingress, addressing #9942. It is disabled by default (httpRoute.enabled: false) so existing installs are unaffected. The template mirrors the existing ingress.yaml conventions: the pgadmin4.fullname backend, commonLabels/commonAnnotations propagation, and a hostname that falls back to ingress.hostname when httpRoute.hostnames is unset. parentRefs is required (a fail guard fires when it is empty), apiVersion defaults to gateway.networking.k8s.io/v1, and the default rule forwards "/" (PathPrefix) to the pgAdmin service. Custom hostnames and rules can be supplied for full control. The new values are documented in the chart README.
This commit is contained in:
@@ -40,6 +40,12 @@ The chart should dump its version and appVersion in the Chart.yaml file every re
|
||||
| `ingress.enabled` | Ingress resource creation | `false` |
|
||||
| `ingress.hostname` | Ingress resource hostname | `"pgadmin4.local"` |
|
||||
| `ingress.tlsSecret` | Ingress tls secret name | `""` |
|
||||
| `httpRoute.enabled` | Gateway API HTTPRoute resource creation | `false` |
|
||||
| `httpRoute.apiVersion` | HTTPRoute apiVersion (override for v1beta1 implementations) | `"gateway.networking.k8s.io/v1"` |
|
||||
| `httpRoute.parentRefs` | Gateway(s) the route attaches to (required when `httpRoute.enabled` is true) | `[]` |
|
||||
| `httpRoute.hostnames` | HTTPRoute hostnames (falls back to `ingress.hostname` when empty) | `[]` |
|
||||
| `httpRoute.annotations` | HTTPRoute annotations | `{}` |
|
||||
| `httpRoute.rules` | Custom routing rules (defaults to a single `/` PathPrefix rule to the service) | `[]` |
|
||||
| `strategy.type` | Deployment strategy type (RollingUpdate or Recreate) | Kubernetes default (RollingUpdate) |
|
||||
| `strategy.rollingUpdate.maxSurge` | Maximum number of pods that can be created over the desired replicas | Kubernetes default (25%) |
|
||||
| `strategy.rollingUpdate.maxUnavailable` | Maximum number of pods that can be unavailable during the update | Kubernetes default (25%) |
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{{- if .Values.httpRoute.enabled }}
|
||||
{{- if not .Values.httpRoute.parentRefs }}
|
||||
{{- fail "httpRoute.parentRefs must be set when httpRoute.enabled is true" }}
|
||||
{{- end }}
|
||||
apiVersion: {{ .Values.httpRoute.apiVersion | default "gateway.networking.k8s.io/v1" }}
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: {{ template "pgadmin4.fullname" . }}
|
||||
{{- with .Values.commonLabels }}
|
||||
labels: {{ . | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.httpRoute.annotations .Values.commonAnnotations }}
|
||||
annotations: {{ merge .Values.httpRoute.annotations .Values.commonAnnotations | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
parentRefs: {{- toYaml .Values.httpRoute.parentRefs | nindent 4 }}
|
||||
{{- $hostnames := .Values.httpRoute.hostnames }}
|
||||
{{- if and (not $hostnames) .Values.ingress.hostname }}
|
||||
{{- $hostnames = list (tpl .Values.ingress.hostname .) }}
|
||||
{{- end }}
|
||||
{{- with $hostnames }}
|
||||
hostnames: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.httpRoute.rules }}
|
||||
{{- toYaml .Values.httpRoute.rules | nindent 4 }}
|
||||
{{- else }}
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: {{ template "pgadmin4.fullname" . }}
|
||||
port: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -106,6 +106,25 @@ ingress:
|
||||
annotations: {}
|
||||
# If set, enables TLS configuration in the Ingress resource.
|
||||
tlsSecret: ""
|
||||
httpRoute:
|
||||
# Enable a Gateway API HTTPRoute as an alternative to the Ingress above.
|
||||
enabled: false
|
||||
# apiVersion for the HTTPRoute resource. Override if your Gateway API
|
||||
# implementation still serves the resource under v1beta1.
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
# parentRefs is required when httpRoute.enabled is true. It references the
|
||||
# Gateway (and optionally a listener) that should route to pgAdmin.
|
||||
parentRefs: []
|
||||
# - name: my-gateway
|
||||
# namespace: gateway-system
|
||||
# sectionName: https
|
||||
# hostnames for the route. When empty, falls back to ingress.hostname.
|
||||
hostnames: []
|
||||
# - pgadmin4.example.com
|
||||
annotations: {}
|
||||
# Custom routing rules. When empty, a single rule forwards all traffic
|
||||
# ("/" PathPrefix) to the pgAdmin service.
|
||||
rules: []
|
||||
startupProbe:
|
||||
enabled: false
|
||||
httpGet:
|
||||
|
||||
Reference in New Issue
Block a user