File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,12 +41,28 @@ Name of the ServiceAccount to use.
4141*/ }}
4242{{- define " garage.serviceAccountName" -}}
4343{{- if .Values.serviceAccount.create }}
44- {{- default (include " garage.fullname" . ) .Values.serviceAccount.name }}
44+ {{- $baseName := .Values.serviceAccount.name | default (printf " sa-%s " (include " garage.fullname" . )) -}}
45+ {{- $baseName | trunc 63 | trimSuffix " -" }}
4546{{- else }}
4647{{- default " default" .Values.serviceAccount.name }}
4748{{- end }}
4849{{- end }}
4950
51+ {{/*
52+ Names for the ingress / HTTPRoute objects (prefixed for readability, overridable
53+ via .Values.<kind>.name). These name the routing object only — the backend still
54+ targets the Service (garage.fullname).
55+ */ }}
56+ {{- define " garage.ingressName" -}}
57+ {{- $baseName := .Values.ingress.name | default (printf " ingress-%s " (include " garage.fullname" . )) -}}
58+ {{- $baseName | trunc 63 | trimSuffix " -" }}
59+ {{- end }}
60+
61+ {{- define " garage.httpRouteName" -}}
62+ {{- $baseName := .Values.httpRoute.name | default (printf " httproute-%s " (include " garage.fullname" . )) -}}
63+ {{- $baseName | trunc 63 | trimSuffix " -" }}
64+ {{- end }}
65+
5066{{/*
5167Auto-generated RPC secret (inter-node clustering auth; loopback-only on a single
5268node, so it is never consumed externally). `lookup` reuses the previously stored
Original file line number Diff line number Diff line change 99apiVersion : gateway.networking.k8s.io/v1
1010kind : HTTPRoute
1111metadata :
12- name : {{ $fullName }}
12+ name : {{ include "garage.httpRouteName" . }}
1313 labels :
1414 {{- include "garage.labels" . | nindent 4 }}
1515 {{- with .Values.httpRoute.labels }}
Original file line number Diff line number Diff line change 44apiVersion : networking.k8s.io/v1
55kind : Ingress
66metadata :
7- name : {{ $fullName }}
7+ name : {{ include "garage.ingressName" . }}
88 labels :
99 {{- include "garage.labels" . | nindent 4 }}
1010 {{- with .Values.ingress.labels }}
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ service:
9494ingress :
9595 # -- Enable the Ingress.
9696 enabled : false
97+ # -- Name of the Ingress object. Defaults to ingress-<fullname> when empty.
98+ name : " "
9799 # -- Ingress class name.
98100 className : " "
99101 # -- Ingress annotations.
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ service:
3838
3939ingress :
4040 enabled : false
41+ name : " "
4142 className : " "
4243 annotations : {}
4344 labels : {}
@@ -50,6 +51,7 @@ ingress:
5051
5152httpRoute :
5253 enabled : false
54+ name : " "
5355 parentRefs : []
5456 hostnames : []
5557 annotations : {}
You can’t perform that action at this time.
0 commit comments