From 4615c9f76e287eba0f7eadf04c10b937cc062e36 Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Mon, 2 Sep 2024 11:36:58 +0500 Subject: [PATCH] feat: Cloudflared | add cloudflared manifest --- cloudflared/cloudflared.yaml | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 cloudflared/cloudflared.yaml diff --git a/cloudflared/cloudflared.yaml b/cloudflared/cloudflared.yaml new file mode 100644 index 0000000..e9a5107 --- /dev/null +++ b/cloudflared/cloudflared.yaml @@ -0,0 +1,68 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: cloudflared + namespace: cloudflared +spec: + selector: + matchLabels: + app: cloudflared + replicas: 3 + template: + metadata: + labels: + app: cloudflared + spec: + containers: + - name: cloudflared + image: cloudflare/cloudflared + args: + - tunnel + - --config + - /etc/cloudflared/config/config.yaml + - run + livenessProbe: + httpGet: + path: /ready + port: 2000 + failureThreshold: 1 + initialDelaySeconds: 10 + periodSeconds: 10 + volumeMounts: + - name: config + mountPath: /etc/cloudflared/config + readOnly: true + - name: creds + mountPath: /etc/cloudflared/creds + readOnly: true + volumes: + - name: creds + secret: + secretName: tunnel-credentials + - name: config + configMap: + name: cloudflared + items: + - key: config.yaml + path: config.yaml +--- +# This ConfigMap is just a way to define the cloudflared config.yaml file in k8s. +# It's useful to define it in k8s, rather than as a stand-alone .yaml file, because +# this lets you use various k8s templating solutions (e.g. Helm charts) to +# parameterize your config, instead of just using string literals. +apiVersion: v1 +kind: ConfigMap +metadata: + name: cloudflared + namespace: cloudflared +data: + config.yaml: | + tunnel: homelab + credentials-file: /etc/cloudflared/creds/credentials.json + metrics: 0.0.0.0:2000 + no-autoupdate: true + ingress: + - hostname: postgres.dogar.dev + service: tcp://postgres-cluster-rw.postgres-system.svc.cluster.local:5432 + - service: http_status:404