mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
feat(common): Release version 1.1.0 (#81)
# Removed - Promtail add-on has been removed # Fixed - Fixed httpGet probe whitespace rendering (#76) - Fixed Secret management for ServiceAccounts (fixes #78) - Fixed code-server add-on Service rendering # Added - Added support for Gateway API Routes (#59) # Changed - Services and their ports are now assumed enabled by default - Updated `code-server` image to v4.8.3 - Updated `netshoot` image to v0.8 Signed-off-by: András Maróy <andras@maroy.hu> Signed-off-by: András Maróy <andras@maroy.hu> Co-authored-by: András Maróy <andras@maroy.hu> Co-authored-by: pando85 <pando855@gmail.com>
This commit is contained in:
parent
841d562827
commit
a2a0b8ea2b
46 changed files with 1393 additions and 320 deletions
71
charts/library/common/templates/classes/_route.tpl
Normal file
71
charts/library/common/templates/classes/_route.tpl
Normal file
|
@ -0,0 +1,71 @@
|
|||
{{/*
|
||||
This template serves as a blueprint for all Route objects that are created
|
||||
within the common library.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.class.route" -}}
|
||||
{{- $values := .Values.route -}}
|
||||
{{- if hasKey . "ObjectValues" -}}
|
||||
{{- with .ObjectValues.route -}}
|
||||
{{- $values = . -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- $fullName := include "bjw-s.common.lib.chart.names.fullname" . -}}
|
||||
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||
{{- $fullName = printf "%v-%v" $fullName $values.nameOverride -}}
|
||||
{{ end -}}
|
||||
{{- $routeKind := $values.kind | default "HTTPRoute" -}}
|
||||
{{- $primaryService := get .Values.service (include "bjw-s.common.lib.service.primary" .) -}}
|
||||
{{- $defaultServiceName := $fullName -}}
|
||||
{{- if and (hasKey $primaryService "nameOverride") $primaryService.nameOverride -}}
|
||||
{{- $defaultServiceName = printf "%v-%v" $defaultServiceName $primaryService.nameOverride -}}
|
||||
{{- end -}}
|
||||
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1alpha2
|
||||
{{- if and (ne $routeKind "GRPCRoute") (ne $routeKind "HTTPRoute") (ne $routeKind "TCPRoute") (ne $routeKind "TLSRoute") (ne $routeKind "UDPRoute") }}
|
||||
{{- fail (printf "Not a valid route kind (%s)" $routeKind) }}
|
||||
{{- end }}
|
||||
kind: {{ $routeKind }}
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
{{- with (merge ($values.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }}
|
||||
labels: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with (merge ($values.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }}
|
||||
annotations: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
parentRefs:
|
||||
{{- range $values.parentRefs }}
|
||||
- group: {{ default "gateway.networking.k8s.io" .group }}
|
||||
kind: {{ default "Gateway" .kind }}
|
||||
name: {{ required (printf "parentRef name is required for %v %v" $routeKind $fullName) .name }}
|
||||
namespace: {{ required (printf "parentRef namespace is required for %v %v" $routeKind $fullName) .namespace }}
|
||||
sectionName: {{ default "" .sectionName | quote}}
|
||||
{{- end }}
|
||||
{{- if and (ne $routeKind "TCPRoute") (ne $routeKind "UDPRoute") $values.hostnames }}
|
||||
hostnames:
|
||||
{{- with $values.hostnames }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range $values.rules }}
|
||||
- backendRefs:
|
||||
{{- range .backendRefs }}
|
||||
- group: {{ default "" .group | quote}}
|
||||
kind: {{ default "Service" .kind }}
|
||||
name: {{ default $defaultServiceName .name }}
|
||||
namespace: {{ default $.Release.Namespace .namespace }}
|
||||
port: {{ default $defaultServicePort.port .port }}
|
||||
weight: {{ default 1 .weight }}
|
||||
{{- end }}
|
||||
{{- if (eq $routeKind "HTTPRoute") }}
|
||||
{{- with .matches }}
|
||||
matches:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue