From 1c7cc364723a0864e71f4dee8ec7f2333995e146 Mon Sep 17 00:00:00 2001 From: Tom Zaspel Date: Wed, 18 Feb 2026 06:48:01 +0100 Subject: [PATCH 1/4] fix: httpRoute template file --- chart/templates/httproute.yaml | 31 ++++++++----------------------- chart/values.yaml | 27 +++++++++++++-------------- 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/chart/templates/httproute.yaml b/chart/templates/httproute.yaml index 5d656c88..0c945dcf 100644 --- a/chart/templates/httproute.yaml +++ b/chart/templates/httproute.yaml @@ -1,18 +1,8 @@ {{- if .Values.httpRoute.enabled -}} -{{- $fullName := include "chart.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- $defaultGatewayName := .Values.gateway.name -}} -{{- if not $defaultGatewayName -}} -{{- $defaultGatewayName = printf "%s-gateway" $fullName -}} -{{- end -}} -{{- $defaultGatewayNs := .Release.Namespace -}} -{{- if .Values.gateway.enabled -}} -{{- $defaultGatewayNs = default .Release.Namespace .Values.gateway.namespace -}} -{{- end -}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }} {{- with .Values.httpRoute.annotations }} @@ -23,14 +13,9 @@ spec: parentRefs: {{- if .Values.httpRoute.parentRefs }} {{- range $ref := .Values.httpRoute.parentRefs }} - - name: {{ default $defaultGatewayName $ref.name | quote }} - {{- $refNs := $ref.namespace | default $defaultGatewayNs -}} - namespace: {{ $refNs | quote }} - {{- with $ref.sectionName }} - sectionName: {{ . | quote }} - {{- else }} - sectionName: "http" - {{- end }} + - name: {{ $.Values.gateway.name | default $ref.name | quote }} + namespace: {{ $ref.namespace | default (default .Release.Namespace .Values.gateway.namespace) | quote }} + sectionName: {{ $ref.sectionName | default "http" | quote }} {{- with $ref.kind }} kind: {{ . | quote }} {{- end }} @@ -40,8 +25,8 @@ spec: {{- end }} {{- else }} # Default parentRef when parentRefs is empty or not set - - name: {{ $defaultGatewayName | quote }} - namespace: {{ $defaultGatewayNs | quote }} + - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "chart.fullName" .)) | quote }} + namespace: {{ default .Release.Namespace .Values.gateway.namespace | quote }} sectionName: "http" {{- end }} {{- with .Values.httpRoute.hostnames }} @@ -59,8 +44,8 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} backendRefs: - - name: {{ $fullName }} - port: {{ $svcPort }} + - name: {{ include "chart.fullname" }} + port: {{ $.Values.service.port }} weight: 1 {{- end }} {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 9f5fa18a..28019076 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -5,11 +5,11 @@ image: # Image built from this repo's `Dockerfile` (nginx serving static frontend). repository: ghcr.io/alam00000/bentopdf-simple pullPolicy: IfNotPresent - tag: "" + tag: '' imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" +nameOverride: '' +fullnameOverride: '' podAnnotations: {} podLabels: {} @@ -25,7 +25,7 @@ env: [] ingress: enabled: false - className: "" + className: '' annotations: {} hosts: - host: bentopdf.local @@ -37,10 +37,10 @@ ingress: # Gateway API (optional) gateway: enabled: false - name: "" # default: release fullname + "-gateway" suffix - namespace: "" # to override the namespace + name: '' # default: release fullname + "-gateway" suffix + namespace: '' # to override the namespace annotations: {} - gatewayClassName: "" # required when enabled=true + gatewayClassName: '' # required when enabled=true listeners: - name: http protocol: HTTP @@ -50,14 +50,13 @@ gateway: from: Same # Allow routes from the same namespace httpRoute: - enabled: false - annotations: {} - # parentRefs: # Omit entirely to use default (auto-references gateway in same namespace) - # - name: "" # default: gateway.name or {release-name}-gateway - # namespace: "" # to override the namespace - # sectionName: "http" + enabled: true + parentRefs: + - name: existing-gateway + namespace: gateway-namespace + sectionName: http hostnames: - - bentopdf.local + - pdfs.example.com rules: - matches: - path: From b4ff2f68f8bcc4d06b8d8d5b7d5aee0355b6ce4f Mon Sep 17 00:00:00 2001 From: Tom Zaspel Date: Thu, 19 Feb 2026 11:06:50 +0100 Subject: [PATCH 2/4] chore: replace chart value from the _helpers.tpl and set it to bentopdf --- chart/templates/NOTES.txt | 10 +++++----- chart/templates/_helpers.tpl | 19 +++++++++---------- chart/templates/deployment.yaml | 8 ++++---- chart/templates/gateway.yaml | 4 ++-- chart/templates/httproute.yaml | 8 ++++---- chart/templates/ingress.yaml | 6 +++--- chart/templates/service.yaml | 6 +++--- chart/templates/tests/test-connection.yaml | 6 +++--- 8 files changed, 33 insertions(+), 34 deletions(-) diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index c99d3b01..caf28821 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.httpRoute.enabled }} {{- $defaultGatewayName := .Values.gateway.name -}} {{- if not $defaultGatewayName -}} -{{- $defaultGatewayName = printf "%s-gateway" (include "chart.fullname" .) -}} +{{- $defaultGatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} {{- end -}} {{- $defaultGatewayNs := .Release.Namespace -}} {{- if .Values.gateway.enabled -}} @@ -31,16 +31,16 @@ {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart.fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bentopdf.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bentopdf.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bentopdf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "bentopdf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 52b41f3a..8e9fada8 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* -Expand the name of the chart. +Expand the name of the bentopdf */}} -{{- define "chart.name" -}} +{{- define "bentopdf.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "chart.fullname" -}} +{{- define "bentopdf.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "chart.chart" -}} +{{- define "bentopdf.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "chart.labels" -}} -helm.sh/chart: {{ include "chart.chart" . }} -{{ include "chart.selectorLabels" . }} +{{- define "bentopdf.labels" -}} +helm.sh/chart: {{ include "bentopdf.chart" . }} +{{ include "bentopdf.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,8 +45,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "chart.name" . }} +{{- define "bentopdf.selectorLabels" -}} +app.kubernetes.io/name: {{ include "bentopdf.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 5cde3097..1d10c176 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -1,14 +1,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "chart.selectorLabels" . | nindent 6 }} + {{- include "bentopdf.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -16,7 +16,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "chart.labels" . | nindent 8 }} + {{- include "bentopdf.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/chart/templates/gateway.yaml b/chart/templates/gateway.yaml index 9914d0c1..3d2d3780 100644 --- a/chart/templates/gateway.yaml +++ b/chart/templates/gateway.yaml @@ -1,7 +1,7 @@ {{- if .Values.gateway.enabled -}} {{- $gatewayName := .Values.gateway.name -}} {{- if not $gatewayName -}} -{{- $gatewayName = printf "%s-gateway" (include "chart.fullname" .) -}} +{{- $gatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} {{- end -}} {{- $gatewayNs := default .Release.Namespace .Values.gateway.namespace -}} apiVersion: gateway.networking.k8s.io/v1 @@ -10,7 +10,7 @@ metadata: name: {{ $gatewayName }} namespace: {{ $gatewayNs }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.gateway.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/chart/templates/httproute.yaml b/chart/templates/httproute.yaml index 0c945dcf..1a68e740 100644 --- a/chart/templates/httproute.yaml +++ b/chart/templates/httproute.yaml @@ -2,9 +2,9 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -25,7 +25,7 @@ spec: {{- end }} {{- else }} # Default parentRef when parentRefs is empty or not set - - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "chart.fullName" .)) | quote }} + - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "bentopdf.fullName" .)) | quote }} namespace: {{ default .Release.Namespace .Values.gateway.namespace | quote }} sectionName: "http" {{- end }} @@ -44,7 +44,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} backendRefs: - - name: {{ include "chart.fullname" }} + - name: {{ include "bentopdf.fullname" }} port: {{ $.Values.service.port }} weight: 1 {{- end }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 89ec883b..0483758d 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -35,7 +35,7 @@ spec: {{- end }} backend: service: - name: {{ include "chart.fullname" $ }} + name: {{ include "bentopdf.fullname" $ }} port: number: {{ $.Values.service.port }} {{- end }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index dfc5b3a3..b1465673 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "chart.selectorLabels" . | nindent 4 }} + {{- include "bentopdf.selectorLabels" . | nindent 4 }} diff --git a/chart/templates/tests/test-connection.yaml b/chart/templates/tests/test-connection.yaml index 2a389981..583ff079 100644 --- a/chart/templates/tests/test-connection.yaml +++ b/chart/templates/tests/test-connection.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "chart.fullname" . }}-test-connection" + name: "{{ include "bentopdf.fullname" . }}-test-connection" labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['-qO-', 'http://{{ include "chart.fullname" . }}:{{ .Values.service.port }}/'] + args: ['-qO-', 'http://{{ include "bentopdf.fullname" . }}:{{ .Values.service.port }}/'] restartPolicy: Never From dffcfb77f34f82bfaf9613571fb162b0c21d69d5 Mon Sep 17 00:00:00 2001 From: Tom Zaspel Date: Thu, 19 Feb 2026 11:38:10 +0100 Subject: [PATCH 3/4] chore: remove fullname because it is not needed --- chart/README.md | 4 ++-- chart/templates/NOTES.txt | 8 ++++---- chart/templates/_helpers.tpl | 18 ------------------ chart/templates/deployment.yaml | 3 ++- chart/templates/gateway.yaml | 2 +- chart/templates/httproute.yaml | 13 +++++++------ chart/templates/ingress.yaml | 5 +++-- chart/templates/service.yaml | 3 ++- chart/templates/serviceaccount.yaml | 4 ---- chart/templates/tests/test-connection.yaml | 4 ++-- chart/values.yaml | 18 ++++++++---------- 11 files changed, 31 insertions(+), 51 deletions(-) delete mode 100644 chart/templates/serviceaccount.yaml diff --git a/chart/README.md b/chart/README.md index 98972586..18b63672 100644 --- a/chart/README.md +++ b/chart/README.md @@ -30,7 +30,7 @@ ingress: ```yaml gateway: enabled: true - gatewayClassName: "cloudflare" # or your gateway class + gatewayClassName: 'cloudflare' # or your gateway class httpRoute: enabled: true @@ -74,7 +74,7 @@ httpRoute: ```yaml env: - name: DISABLE_IPV6 - value: "true" + value: 'true' ``` ## Publish this chart to GHCR (OCI) for testing/deploying diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index caf28821..fc3864ed 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.httpRoute.enabled }} {{- $defaultGatewayName := .Values.gateway.name -}} {{- if not $defaultGatewayName -}} -{{- $defaultGatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} +{{- $defaultGatewayName = printf "%s-gateway" (include "bentopdf.name" .) -}} {{- end -}} {{- $defaultGatewayNs := .Release.Namespace -}} {{- if .Values.gateway.enabled -}} @@ -31,13 +31,13 @@ {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bentopdf.fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bentopdf.name" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bentopdf.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bentopdf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bentopdf.name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bentopdf.name" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "bentopdf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 8e9fada8..ba105973 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -5,24 +5,6 @@ Expand the name of the bentopdf {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "bentopdf.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - {{/* Create chart name and version as used by the chart label. */}} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 1d10c176..737e68f9 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -1,7 +1,8 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "bentopdf.fullname" . }} + name: {{ include "bentopdf.name" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "bentopdf.labels" . | nindent 4 }} spec: diff --git a/chart/templates/gateway.yaml b/chart/templates/gateway.yaml index 3d2d3780..9d0d6e9f 100644 --- a/chart/templates/gateway.yaml +++ b/chart/templates/gateway.yaml @@ -1,7 +1,7 @@ {{- if .Values.gateway.enabled -}} {{- $gatewayName := .Values.gateway.name -}} {{- if not $gatewayName -}} -{{- $gatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} +{{- $gatewayName = printf "%s-gateway" (include "bentopdf.name" .) -}} {{- end -}} {{- $gatewayNs := default .Release.Namespace .Values.gateway.namespace -}} apiVersion: gateway.networking.k8s.io/v1 diff --git a/chart/templates/httproute.yaml b/chart/templates/httproute.yaml index 1a68e740..70e033a9 100644 --- a/chart/templates/httproute.yaml +++ b/chart/templates/httproute.yaml @@ -2,7 +2,8 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ include "bentopdf.fullname" . }} + name: {{ include "bentopdf.name" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.httpRoute.annotations }} @@ -14,7 +15,7 @@ spec: {{- if .Values.httpRoute.parentRefs }} {{- range $ref := .Values.httpRoute.parentRefs }} - name: {{ $.Values.gateway.name | default $ref.name | quote }} - namespace: {{ $ref.namespace | default (default .Release.Namespace .Values.gateway.namespace) | quote }} + namespace: {{ $ref.namespace | default (default $.Release.Namespace $.Values.gateway.namespace) | quote }} sectionName: {{ $ref.sectionName | default "http" | quote }} {{- with $ref.kind }} kind: {{ . | quote }} @@ -25,8 +26,8 @@ spec: {{- end }} {{- else }} # Default parentRef when parentRefs is empty or not set - - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "bentopdf.fullName" .)) | quote }} - namespace: {{ default .Release.Namespace .Values.gateway.namespace | quote }} + - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "bentopdf.name" $)) | quote }} + namespace: {{ .Values.gateway.namespace | default .Release.Namespace | quote }} sectionName: "http" {{- end }} {{- with .Values.httpRoute.hostnames }} @@ -37,14 +38,14 @@ spec: {{- range .Values.httpRoute.rules }} - {{- with .matches }} matches: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} backendRefs: - - name: {{ include "bentopdf.fullname" }} + - name: {{ include "bentopdf.name" $ }} port: {{ $.Values.service.port }} weight: 1 {{- end }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 0483758d..04b8240a 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -2,7 +2,8 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "bentopdf.fullname" . }} + name: {{ include "bentopdf.name" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} @@ -35,7 +36,7 @@ spec: {{- end }} backend: service: - name: {{ include "bentopdf.fullname" $ }} + name: {{ include "bentopdf.name" $ }} port: number: {{ $.Values.service.port }} {{- end }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index b1465673..04c36d00 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -1,7 +1,8 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "bentopdf.fullname" . }} + name: {{ include "bentopdf.name" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "bentopdf.labels" . | nindent 4 }} spec: diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml deleted file mode 100644 index ff2b900a..00000000 --- a/chart/templates/serviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# The service account was removed, as it's not necessary for a chart like this. -# -# There are no calls to the Kubernetes API - routing between services. -# It's a simple nginx static website deployment only. diff --git a/chart/templates/tests/test-connection.yaml b/chart/templates/tests/test-connection.yaml index 583ff079..474132a2 100644 --- a/chart/templates/tests/test-connection.yaml +++ b/chart/templates/tests/test-connection.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "bentopdf.fullname" . }}-test-connection" + name: "{{ include "bentopdf.name" . }}-test-connection" labels: {{- include "bentopdf.labels" . | nindent 4 }} annotations: @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['-qO-', 'http://{{ include "bentopdf.fullname" . }}:{{ .Values.service.port }}/'] + args: ['-qO-', 'http://{{ include "bentopdf.name" . }}:{{ .Values.service.port }}/'] restartPolicy: Never diff --git a/chart/values.yaml b/chart/values.yaml index 28019076..505dc26b 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -9,7 +9,6 @@ image: imagePullSecrets: [] nameOverride: '' -fullnameOverride: '' podAnnotations: {} podLabels: {} @@ -37,7 +36,7 @@ ingress: # Gateway API (optional) gateway: enabled: false - name: '' # default: release fullname + "-gateway" suffix + name: '' # default: release name + "-gateway" suffix namespace: '' # to override the namespace annotations: {} gatewayClassName: '' # required when enabled=true @@ -50,18 +49,17 @@ gateway: from: Same # Allow routes from the same namespace httpRoute: - enabled: true - parentRefs: - - name: existing-gateway - namespace: gateway-namespace - sectionName: http + enabled: false + annotations: {} + # parentRefs: # Omit entirely to use default (auto-references gateway in same namespace) + # - name: "" # default: gateway.name or {release-name}-gateway + # namespace: "" # to override the namespace + # sectionName: "http" hostnames: - - pdfs.example.com + - bentopdf.local rules: - matches: - path: - type: PathPrefix - value: / resources: {} From 450815db96280207010351e52546570de8ee4f6a Mon Sep 17 00:00:00 2001 From: Tom Zaspel Date: Thu, 19 Feb 2026 15:16:44 +0100 Subject: [PATCH 4/4] chore: bump version of helm chart and update appVersion --- chart/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 52152a1b..1fa4c2ab 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -7,10 +7,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "2.1.0" +appVersion: "2.1.1"