mirror of
https://github.com/plcnk/charts.git
synced 2026-07-16 10:34:44 +00:00
feat(cloudflare): Initial release (#17)
* feat(cloudflare): Initial release * feat(cloudflare): Update README.md
This commit is contained in:
committed by
GitHub
parent
506c1dbf08
commit
316c9da542
59
charts/cloudflare-tunnel/templates/common.yaml
Normal file
59
charts/cloudflare-tunnel/templates/common.yaml
Normal file
@ -0,0 +1,59 @@
|
||||
{{/* Append the hardcoded settings */}}
|
||||
{{- define "cloudflare-tunnel.harcodedValues" -}}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
service:
|
||||
main:
|
||||
controller: main
|
||||
ports:
|
||||
metrics:
|
||||
port: {{ .Values.metrics.port }}
|
||||
protocol: TCP
|
||||
serviceMonitor:
|
||||
main:
|
||||
enabled: true
|
||||
serviceName: {{ include "bjw-s.common.lib.chart.names.fullname" $ }}
|
||||
endpoints:
|
||||
- port: metrics
|
||||
path: /metrics
|
||||
{{- end }}
|
||||
|
||||
controllers:
|
||||
main:
|
||||
containers:
|
||||
app:
|
||||
{{- if .Values.metrics.enabled }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.port }}
|
||||
{{- end }}
|
||||
env:
|
||||
TUNNEL_TOKEN: {{ if not .Values.tunnel.existingSecret.enabled }}{{ .Values.tunnel.token }}{{ end }}
|
||||
{{- if .Values.tunnel.existingSecret.enabled }}
|
||||
secretKeyRef:
|
||||
name: {{ .Values.tunnel.existingSecret.name }}
|
||||
key: {{ .Values.tunnel.existingSecret.key }}
|
||||
{{- end }}
|
||||
args:
|
||||
- tunnel
|
||||
- --no-autoupdate
|
||||
{{- if .Values.logLevel }}
|
||||
- --loglevel
|
||||
- {{ .Values.logLevel }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- --metrics
|
||||
- "0.0.0.0:{{ .Values.metrics.port }}"
|
||||
{{- end }}
|
||||
- run
|
||||
- --token
|
||||
- $(TUNNEL_TOKEN)
|
||||
{{- end -}}
|
||||
|
||||
{{- $tmplVars := deepCopy . -}}
|
||||
{{ include "bjw-s.common.loader.init" $tmplVars }}
|
||||
{{- $defaultValues := include "cloudflare-tunnel.harcodedValues" $tmplVars | fromYaml -}}
|
||||
{{- $_ := mustMerge .Values $defaultValues -}}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "bjw-s.common.loader.init" . }}
|
||||
{{ include "bjw-s.common.loader.generate" . }}
|
||||
Reference in New Issue
Block a user