100 lines
2.7 KiB
YAML
100 lines
2.7 KiB
YAML
# Cloudflare Tunnel is the only public exposure path.
|
|
# Routes are configured in the Cloudflare Zero Trust dashboard:
|
|
# pulse.noelsabia.dev -> http://web:3000
|
|
# api.pulse.noelsabia.dev -> http://api:8080
|
|
# The token lives in the `cloudflared` Secret, created by the human; never in git.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: cloudflared
|
|
namespace: fch26-onemanarmy
|
|
labels:
|
|
app.kubernetes.io/name: cloudflared
|
|
app.kubernetes.io/component: tunnel
|
|
app.kubernetes.io/part-of: pulsecast
|
|
spec:
|
|
replicas: 1
|
|
revisionHistoryLimit: 2
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: cloudflared
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: cloudflared
|
|
app.kubernetes.io/component: tunnel
|
|
app.kubernetes.io/part-of: pulsecast
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
securityContext:
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: cloudflared
|
|
# Public Docker Hub image; no Gitea pull secret needed for this pod.
|
|
image: cloudflare/cloudflared:latest
|
|
imagePullPolicy: IfNotPresent
|
|
args:
|
|
- tunnel
|
|
- --no-autoupdate
|
|
- --metrics
|
|
- 0.0.0.0:2000
|
|
- run
|
|
- --token
|
|
- $(TUNNEL_TOKEN)
|
|
env:
|
|
- name: TUNNEL_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: cloudflared
|
|
key: TUNNEL_TOKEN
|
|
- name: HOME
|
|
value: /tmp
|
|
ports:
|
|
- name: metrics
|
|
containerPort: 2000
|
|
protocol: TCP
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 200m
|
|
memory: 128Mi
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
volumeMounts:
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
startupProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: metrics
|
|
periodSeconds: 2
|
|
failureThreshold: 30
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: metrics
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: metrics
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 2
|
|
terminationGracePeriodSeconds: 30
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|