Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions chart/docs/production-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ the chart only creates the ``HTTPRoute`` and attaches it to the Gateway via ``pa
.. code-block:: yaml
:caption: values.yaml

httpRoute:
apiServer:
apiServer:
httpRoute:
enabled: true
parentRefs:
- name: main-gateway
Expand All @@ -416,9 +416,17 @@ the chart only creates the ``HTTPRoute`` and attaches it to the Gateway via ``pa
hostnames:
- airflow.example.com

For fine-grained routing, supply ``httpRoute.apiServer.rules`` directly — the entry mirrors the
For fine-grained routing, supply ``apiServer.httpRoute.rules`` directly — the entry mirrors the
upstream ``HTTPRouteRule`` schema and overrides the default rule generated from ``path`` + ``pathType``.

.. note::

``HTTPRoute`` is an alternative to the API server ``Ingress``, so enable only one of
``ingress.apiServer`` or ``apiServer.httpRoute`` — enabling both at the same time fails template
rendering. When ``apiServer.httpRoute.enabled`` is ``true``, the chart also verifies (via Helm
``Capabilities``) that the Gateway API CRDs are installed and fails with a clear message if they
are not.

LoadBalancer Service
^^^^^^^^^^^^^^^^^^^^

Expand Down
29 changes: 19 additions & 10 deletions chart/templates/api-server/api-server-httproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@
##################################
## Airflow API Server HTTPRoute
##################################
{{- if and .Values.apiServer.enabled .Values.httpRoute.apiServer.enabled }}
{{- if and .Values.apiServer.enabled .Values.apiServer.httpRoute.enabled }}
{{- if .Values.ingress.apiServer.enabled }}
{{- fail "`apiServer.httpRoute.enabled` and `ingress.apiServer.enabled` are both set to `true`. HTTPRoute (Gateway API) is an alternative to the API server Ingress; enable only one of them." }}
{{- end }}
{{- if not (.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1") }}
{{- fail "`apiServer.httpRoute.enabled` is `true` but the Gateway API HTTPRoute CRD (`gateway.networking.k8s.io/v1`) is not installed in the cluster. Install the Gateway API CRDs (https://gateway-api.sigs.k8s.io/guides/#installing-gateway-api) before enabling `apiServer.httpRoute`." }}
{{- end }}
{{- if not .Values.apiServer.httpRoute.parentRefs }}
{{- fail "`apiServer.httpRoute.enabled` is `true` but `apiServer.httpRoute.parentRefs` is empty. An HTTPRoute must reference at least one parent Gateway; set `apiServer.httpRoute.parentRefs`." }}
{{- end }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
Expand All @@ -32,28 +41,28 @@ metadata:
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if or .Values.labels .Values.apiServer.labels .Values.httpRoute.apiServer.labels }}
{{- mustMerge .Values.httpRoute.apiServer.labels .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- if or .Values.labels .Values.apiServer.labels .Values.apiServer.httpRoute.labels }}
{{- mustMerge .Values.apiServer.httpRoute.labels .Values.apiServer.labels .Values.labels | toYaml | nindent 4 }}
{{- end }}
{{- with .Values.httpRoute.apiServer.annotations }}
{{- with .Values.apiServer.httpRoute.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs: {{- toYaml .Values.httpRoute.apiServer.parentRefs | nindent 4 }}
{{- with .Values.httpRoute.apiServer.hostnames }}
parentRefs: {{- toYaml .Values.apiServer.httpRoute.parentRefs | nindent 4 }}
{{- with .Values.apiServer.httpRoute.hostnames }}
hostnames:
{{- range . }}
- {{ tpl . $ | quote }}
{{- end }}
{{- end }}
rules:
{{- if .Values.httpRoute.apiServer.rules }}
{{- toYaml .Values.httpRoute.apiServer.rules | nindent 4 }}
{{- if .Values.apiServer.httpRoute.rules }}
{{- toYaml .Values.apiServer.httpRoute.rules | nindent 4 }}
{{- else }}
- matches:
- path:
type: {{ .Values.httpRoute.apiServer.pathType }}
value: {{ .Values.httpRoute.apiServer.path | quote }}
type: {{ .Values.apiServer.httpRoute.pathType }}
value: {{ .Values.apiServer.httpRoute.path | quote }}
backendRefs:
- name: {{ $fullname }}-api-server
port: {{ .Values.ports.apiServer }}
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/api-server/api-server-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
## Airflow API Server Ingress
#################################
{{- if and .Values.apiServer.enabled (semverCompare ">=3.0.0" .Values.airflowVersion) (or .Values.ingress.apiServer.enabled .Values.ingress.enabled) }}
{{- if .Values.apiServer.httpRoute.enabled }}
{{- fail "`ingress.apiServer.enabled` and `apiServer.httpRoute.enabled` are both set to `true`. The API server Ingress is an alternative to HTTPRoute (Gateway API); enable only one of them." }}
{{- end }}
{{- $fullname := include "airflow.fullname" . }}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
196 changes: 96 additions & 100 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,106 +764,6 @@
}
}
},
"httpRoute": {
"description": "Kubernetes Gateway API (HTTPRoute) configuration.",
"type": "object",
"x-docsSection": "Ingress",
"additionalProperties": false,
"properties": {
"apiServer": {
"description": "Configuration for the HTTPRoute of the API server.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable API server HTTPRoute resource.",
"type": "boolean",
"default": false
},
"labels": {
"description": "Extra labels for the API server HTTPRoute.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"annotations": {
"description": "Annotations for the API server HTTPRoute.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"parentRefs": {
"description": "List of parent Gateway references this HTTPRoute attaches to. Required when enabled.",
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name of the referenced Gateway.",
"type": "string"
},
"namespace": {
"description": "Namespace of the referenced Gateway. Defaults to the local namespace.",
"type": "string"
},
"sectionName": {
"description": "Name of the Gateway listener section this route attaches to.",
"type": "string"
},
"port": {
"description": "Port of the Gateway listener this route attaches to.",
"type": "integer"
},
"kind": {
"description": "Kind of the referenced resource. Defaults to `Gateway`.",
"type": "string"
},
"group": {
"description": "API group of the referenced resource. Defaults to `gateway.networking.k8s.io`.",
"type": "string"
}
},
"required": [
"name"
]
}
},
"hostnames": {
"description": "Hostnames this HTTPRoute should match (templated). Empty matches all.",
"type": "array",
"default": [],
"items": {
"type": "string"
}
},
"path": {
"description": "Default routing rule path (used only when `httpRoute.apiServer.rules` is empty).",
"type": "string",
"default": "/"
},
"pathType": {
"description": "The pathType for the default path: PathPrefix, Exact, or RegularExpression.",
"type": "string",
"default": "PathPrefix"
},
"rules": {
"description": "Custom routing rules. When set, overrides the default rule generated from `path` + `pathType`. Each entry follows the upstream Gateway API `HTTPRouteRule` schema.",
"type": "array",
"default": [],
"items": {
"type": "object",
"additionalProperties": {}
}
}
}
}
}
},
"networkPolicies": {
"description": "Network policy configuration.",
"type": "object",
Expand Down Expand Up @@ -7145,6 +7045,102 @@
"type": "boolean",
"default": true
},
"httpRoute": {
"description": "Kubernetes Gateway API (HTTPRoute) configuration for the API server.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable API server HTTPRoute resource.",
"type": "boolean",
"default": false
},
"labels": {
"description": "Extra labels for the API server HTTPRoute.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"annotations": {
"description": "Annotations for the API server HTTPRoute.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"parentRefs": {
"description": "List of parent Gateway references this HTTPRoute attaches to. Required when enabled.",
"type": [
"array",
"null"
],
"default": null,
"minItems": 1,
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name of the referenced Gateway.",
"type": "string"
},
"namespace": {
"description": "Namespace of the referenced Gateway. Defaults to the local namespace.",
"type": "string"
},
"sectionName": {
"description": "Name of the Gateway listener section this route attaches to.",
"type": "string"
},
"port": {
"description": "Port of the Gateway listener this route attaches to.",
"type": "integer"
},
"kind": {
"description": "Kind of the referenced resource. Defaults to `Gateway`.",
"type": "string"
},
"group": {
"description": "API group of the referenced resource. Defaults to `gateway.networking.k8s.io`.",
"type": "string"
}
},
"required": [
"name"
]
}
},
"hostnames": {
"description": "Hostnames this HTTPRoute should match (templated). Empty matches all.",
"type": "array",
"default": [],
"items": {
"type": "string"
}
},
"path": {
"description": "Default routing rule path (used only when `apiServer.httpRoute.rules` is empty).",
"type": "string",
"default": "/"
},
"pathType": {
"description": "The pathType for the default path: PathPrefix, Exact, or RegularExpression.",
"type": "string",
"default": "PathPrefix"
},
"rules": {
"description": "Custom routing rules. When set, overrides the default rule generated from `path` + `pathType`. Each entry follows the upstream Gateway API `HTTPRouteRule` schema.",
"type": "array",
"default": [],
"items": {
"type": "object",
"additionalProperties": {}
}
}
}
},
"configMapAnnotations": {
"description": "Extra annotations to apply to the API server configmap.",
"type": "object",
Expand Down
Loading