From 9b13d25e4f5f43188926aa2af5d1226ceec600d6 Mon Sep 17 00:00:00 2001 From: Dex Date: Sun, 12 May 2024 00:52:04 -0400 Subject: [PATCH] add cloudflare tunel deployment --- simplysyncedllc-com/application.yaml | 2 +- simplysyncedllc-com/prod/deployment.yaml | 48 ++++++++++++++++++++++++ simplysyncedllc-com/prod/service.yaml | 3 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/simplysyncedllc-com/application.yaml b/simplysyncedllc-com/application.yaml index a585b3b..02619c5 100644 --- a/simplysyncedllc-com/application.yaml +++ b/simplysyncedllc-com/application.yaml @@ -12,7 +12,7 @@ spec: path: simplysyncedllc-com/prod destination: server: https://kubernetes.default.svc - namespace: simplysyncedllc_com + namespace: simplysyncedllc-com syncPolicy: syncOptions: diff --git a/simplysyncedllc-com/prod/deployment.yaml b/simplysyncedllc-com/prod/deployment.yaml index fdabfb6..6c51857 100644 --- a/simplysyncedllc-com/prod/deployment.yaml +++ b/simplysyncedllc-com/prod/deployment.yaml @@ -17,3 +17,51 @@ spec: image: gitea.simplysyncedllc.com/dex/simplysyncedllc_website:1.0.0 ports: - containerPort: 3000 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: cloudflared + name: cloudflared-deployment + namespace: simplysyncedllc-com +spec: + replicas: 2 + 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 + - + 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 diff --git a/simplysyncedllc-com/prod/service.yaml b/simplysyncedllc-com/prod/service.yaml index f373ed7..cfad0a2 100644 --- a/simplysyncedllc-com/prod/service.yaml +++ b/simplysyncedllc-com/prod/service.yaml @@ -10,4 +10,5 @@ spec: - protocol: TCP port: 3000 targetPort: 3000 - nodePort: 30080 + nodePort: 30081 +