diff --git a/kubernetes-ingress/Chart.yaml b/kubernetes-ingress/Chart.yaml index a38cfa2..4e17382 100644 --- a/kubernetes-ingress/Chart.yaml +++ b/kubernetes-ingress/Chart.yaml @@ -16,7 +16,7 @@ apiVersion: v2 name: kubernetes-ingress description: A Helm chart for HAProxy Kubernetes Ingress Controller type: application -version: 1.52.1 +version: 1.53.0 appVersion: 3.2.12 kubeVersion: ">=1.23.0-0" keywords: diff --git a/kubernetes-ingress/README.md b/kubernetes-ingress/README.md index 8a603cb..d7d63dc 100644 --- a/kubernetes-ingress/README.md +++ b/kubernetes-ingress/README.md @@ -512,6 +512,14 @@ A Helm `post-install` / `pre-upgrade` hook Job that applies the controller's CRD | `crdjob.nodeSelector` / `.tolerations` / `.affinity` | Scheduling controls for the Job pod. | `{}` / `[]` / `{}` | | `crdjob.resources.requests` / `.limits` | CPU/memory requests and (optional) limits for the Job container. | `cpu: 250m`, `memory: 400Mi` (no limits) | +### Extra Objects + +Declare additional arbitrary raw CR manifests to deploy as a part of the helm release. + +| Key | Description | Default | +|---|---|---| +| `extraObjects` | Extra raw objects to template. | `[]` | + ### Migration notes (1.50.0) - **Prometheus / pprof decoupled from `admin` port.** Previously, setting `controller.service.enablePorts.admin=false` implicitly disabled the controller's `/metrics` and `/debug/pprof` endpoints. Starting in 1.50.0, the dedicated toggles `controller.prometheus.enabled` and `controller.pprof.enabled` control these (both default `true`). If you were relying on the old coupling, set the new toggles to `false` explicitly. diff --git a/kubernetes-ingress/ci/extra-objects-configmap-values.yaml b/kubernetes-ingress/ci/extra-objects-configmap-values.yaml new file mode 100644 index 0000000..fc79ddc --- /dev/null +++ b/kubernetes-ingress/ci/extra-objects-configmap-values.yaml @@ -0,0 +1,8 @@ +extraObjects: + - apiVersion: v1 + kind: ConfigMap + metadata: + name: "{{ .Release.Name }}-extra-conf" + data: + extra.conf: | + example config diff --git a/kubernetes-ingress/templates/_helpers.tpl b/kubernetes-ingress/templates/_helpers.tpl index b18a842..67760b8 100644 --- a/kubernetes-ingress/templates/_helpers.tpl +++ b/kubernetes-ingress/templates/_helpers.tpl @@ -260,4 +260,25 @@ Create a name for the auxiliary configmap. {{- printf "%s-%s" (include "kubernetes-ingress.fullname" . | trunc 54 | trimSuffix "-") "auxiliary" }} {{- end -}} +{{/* +Create extra raw objects labels +*/}} +{{- define "kubernetes-ingress.extraRawLabels" -}} +metadata: + labels: + {{- include "kubernetes-ingress.labels" $ | nindent 4 }} +{{- end }} + +{{/* +Render extra raw objects that might contain templates +*/}} +{{- define "kubernetes-ingress.renderExtraObjects" -}} + {{- $labels := fromYaml (include "kubernetes-ingress.extraRawLabels" .context) -}} + {{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} + {{- if contains "{{" (toString $value) }} + {{- $value = tpl $value .context }} + {{- end }} + {{- toYaml (merge (fromYaml $value) $labels) }} +{{- end -}} + {{/* vim: set filetype=mustache: */}} diff --git a/kubernetes-ingress/templates/extra-objects.yaml b/kubernetes-ingress/templates/extra-objects.yaml new file mode 100644 index 0000000..c2ab532 --- /dev/null +++ b/kubernetes-ingress/templates/extra-objects.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraObjects }} +--- +{{ include "kubernetes-ingress.renderExtraObjects" (dict "value" . "context" $) }} +{{- end }} diff --git a/kubernetes-ingress/values.yaml b/kubernetes-ingress/values.yaml index 531463f..8bbf088 100644 --- a/kubernetes-ingress/values.yaml +++ b/kubernetes-ingress/values.yaml @@ -735,3 +735,17 @@ crdjob: requests: cpu: 250m memory: 400Mi + +## Extra raw objects to template +## Note: this manifest is not capability-gated; if specific CRDs are +## missing, helm install will fail; this being said, this manifest +## is not intended to be used to deploy ingress.v3.haproxy.org/v3 CRs +## since their CRDs are installed/upgraded via a post-install/pre-upgrade job +extraObjects: [] + # - apiVersion: v1 + # kind: ConfigMap + # metadata: + # name: "{{ .Release.Name }}-extra-conf" + # data: + # extra.conf: | + # example config