From aface2b57dd5ab0f2e3d75e223f14585080c5eca Mon Sep 17 00:00:00 2001 From: alexlebens Date: Tue, 28 May 2024 14:03:55 -0500 Subject: [PATCH] add cloudflared --- charts/cloudflared/Chart.yaml | 18 +++++++++++ charts/cloudflared/README.md | 16 ++++++++++ charts/cloudflared/templates/common.yaml | 38 ++++++++++++++++++++++++ charts/cloudflared/values.yaml | 3 ++ 4 files changed, 75 insertions(+) create mode 100644 charts/cloudflared/Chart.yaml create mode 100644 charts/cloudflared/README.md create mode 100644 charts/cloudflared/templates/common.yaml create mode 100644 charts/cloudflared/values.yaml diff --git a/charts/cloudflared/Chart.yaml b/charts/cloudflared/Chart.yaml new file mode 100644 index 0000000..dfec762 --- /dev/null +++ b/charts/cloudflared/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: cloudflared +version: 1.0.0 +description: Cloudflared Tunnel +keywords: + - cloudflare + - tunnel +sources: + - https://github.com/cloudflare/cloudflared + - https://github.com/bjw-s/helm-charts/tree/main/charts/library/common +maintainers: + - name: alexlebens +dependencies: + - name: common + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 +icon: https://avatars.githubusercontent.com/u/314135?s=48&v=4 +appVersion: "2024.5.0" diff --git a/charts/cloudflared/README.md b/charts/cloudflared/README.md new file mode 100644 index 0000000..542839f --- /dev/null +++ b/charts/cloudflared/README.md @@ -0,0 +1,16 @@ +## Introduction + +[Cloudflared](https://github.com/cloudflare/cloudflared) + +Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network to your origins. + +This chart bootstraps a [Cloudflared](https://github.com/cloudflare/cloudflared) tunnel on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes +- Helm + +## Parameters + +See the [values files](values.yaml). diff --git a/charts/cloudflared/templates/common.yaml b/charts/cloudflared/templates/common.yaml new file mode 100644 index 0000000..0a1847a --- /dev/null +++ b/charts/cloudflared/templates/common.yaml @@ -0,0 +1,38 @@ +{{- include "bjw-s.common.loader.init" . }} + +{{- define "cloudflared.hardcodedValues" -}} +{{ if not .Values.global.nameOverride }} +global: + nameOverride: {{ .Values.name }} +{{ end }} +controllers: + main: + type: deployment + strategy: Recreate + containers: + main: + image: + repository: cloudflare/cloudflared + tag: "2024.5.0" + pullPolicy: IfNotPresent + args: + - tunnel + - --no-autoupdate + - run + - --token + - $(CF_MANAGED_TUNNEL_TOKEN) + env: + - name: CF_MANAGED_TUNNEL_TOKEN + valueFrom: + secretKeyRef: + name: {{ .Values.existingSecretName }} + key: {{ .Values.existingSecretKey }} + resources: + requests: + cpu: 100m + memory: 128Mi +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "cloudflared.hardcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} +{{ include "bjw-s.common.loader.generate" . }} \ No newline at end of file diff --git a/charts/cloudflared/values.yaml b/charts/cloudflared/values.yaml new file mode 100644 index 0000000..7773385 --- /dev/null +++ b/charts/cloudflared/values.yaml @@ -0,0 +1,3 @@ +name: cloudflared +existingSecretName: cloudflared-secret +existingSecretKey: cf-tunnel-token