Skip to content

Commit

Permalink
adding support for global configs (easier to use in composite charts)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaocc authored Sep 5, 2024
1 parent 7fda56f commit e6be13c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helm/cf-tunnel-v3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# "2.0101.230402" -> "v2.1.1" of the chart, referring to "2023.4.2" of the tunnel
# The reason for this is to make the current chart update with the bump when deployed via HelmRelease
#
version: "3.1007.24090502"
version: "3.1007.24090503"

# 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
Expand Down
20 changes: 17 additions & 3 deletions helm/cf-tunnel-v3/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{{/* https://masterminds.github.io/sprig/ */}}
{{/* ---------------------------------------------------------------------------------------------------- */}}
{{- $root := . }}
{{- $rootV := $root.Values }}
{{- $rootG := $rootV.global }}
{{/* ---------------------------------------------------------------------------------------------------- */}}
{{/* (merge $rootV.x (deepCopy $rootG.x)) --> $rootG wins */}}
{{/* (merge $rootG.x (deepCopy $rootV.x)) --> $rootV wins */}}
{{/* ---------------------------------------------------------------------------------------------------- */}}
{{- $affinity := (merge $rootV.affinity $rootG.affinity) }}
{{- $nodeSelector := (merge $rootV.nodeSelector $rootG.nodeSelector) }}
{{- $tolerations := concat $rootV.tolerations $rootG.tolerations }}
{{/* ---------------------------------------------------------------------------------------------------- */}}
---
# Here we deploy cloudflared images. The tunnel token is stored ina k8s secret
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -147,14 +161,14 @@ spec:
secretName: {{ .Values.cloudflare.existingSecretCred }}
{{- end }}

{{- with .Values.nodeSelector }}
{{- with $nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.replicaCount }}
{{- if gt (int .Values.replicaCount) 1 }}
affinity:
{{- with .Values.affinity }}
{{- with $affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.affinity_keep_podAntiAffinity }}
Expand All @@ -174,7 +188,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.tolerations }}
{{- with $tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

0 comments on commit e6be13c

Please sign in to comment.