From 44f4d1b3330fb05cb1b98aa47ec791f0a12953cd Mon Sep 17 00:00:00 2001 From: Dex Date: Thu, 16 May 2024 00:48:14 -0400 Subject: [PATCH] add cloudflare deployment --- kx3dex-radio/prod/deployment.yaml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/kx3dex-radio/prod/deployment.yaml b/kx3dex-radio/prod/deployment.yaml index e55c0d3..fc0b70f 100644 --- a/kx3dex-radio/prod/deployment.yaml +++ b/kx3dex-radio/prod/deployment.yaml @@ -17,3 +17,51 @@ spec: image: gitea.simplysyncedllc.com/dex/kx3dex_radio:1.3.0 ports: - containerPort: 3000 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: cloudflared + name: cloudflared-deployment + namespace: simplysyncedllc-com +spec: + replicas: 1 + selector: + matchLabels: + pod: cloudflared + template: + metadata: + creationTimestamp: null + labels: + pod: cloudflared + spec: + containers: + - command: + - cloudflared + - tunnel + # In a k8s environment, the metrics server needs to listen outside the pod it runs on. + # The address 0.0.0.0:2000 allows any pod in the namespace. + - --metrics + - 0.0.0.0:2000 + - run + args: + - --token + - $(TUNNEL_TOKEN) + env: + - name: TUNNEL_TOKEN + valueFrom: + secretKeyRef: + key: token + name: cf-secrets + image: cloudflare/cloudflared:latest + name: cloudflared + livenessProbe: + httpGet: + # Cloudflared has a /ready endpoint which returns 200 if and only if + # it has an active connection to the edge. + path: /ready + port: 2000 + failureThreshold: 1 + initialDelaySeconds: 10 + periodSeconds: 10