Add dedicated Cloudflare Tunnel for portfolio

This commit is contained in:
2026-07-16 06:08:54 +00:00
parent 4b8aeb524e
commit 08c458a078
12 changed files with 447 additions and 0 deletions
+125
View File
@@ -0,0 +1,125 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: portfolio-edge
namespace: portfolio-edge
labels:
app.kubernetes.io/name: cloudflared
app.kubernetes.io/instance: portfolio-edge
app.kubernetes.io/component: edge
app.kubernetes.io/part-of: portfolio-platform
spec:
replicas: 2
revisionHistoryLimit: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app.kubernetes.io/name: cloudflared
app.kubernetes.io/instance: portfolio-edge
template:
metadata:
labels:
app.kubernetes.io/name: cloudflared
app.kubernetes.io/instance: portfolio-edge
app.kubernetes.io/component: edge
app.kubernetes.io/part-of: portfolio-platform
spec:
serviceAccountName: portfolio-edge
automountServiceAccountToken: false
terminationGracePeriodSeconds: 30
securityContext:
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
seccompProfile:
type: RuntimeDefault
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app.kubernetes.io/name: cloudflared
app.kubernetes.io/instance: portfolio-edge
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: cloudflared
app.kubernetes.io/instance: portfolio-edge
containers:
- name: cloudflared
image: cloudflare/cloudflared:2026.7.2
imagePullPolicy: IfNotPresent
command:
- cloudflared
- tunnel
- --no-autoupdate
- --loglevel
- info
- --metrics
- 0.0.0.0:2000
- run
env:
- name: TUNNEL_TOKEN
valueFrom:
secretKeyRef:
name: portfolio-edge-tunnel-token
key: token
ports:
- name: metrics
containerPort: 2000
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: tmp
mountPath: /tmp
resources:
requests:
cpu: 25m
memory: 64Mi
ephemeral-storage: 16Mi
limits:
cpu: 250m
memory: 256Mi
ephemeral-storage: 128Mi
startupProbe:
httpGet:
path: /ready
port: metrics
periodSeconds: 3
timeoutSeconds: 2
failureThreshold: 40
readinessProbe:
httpGet:
path: /ready
port: metrics
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
livenessProbe:
httpGet:
path: /ready
port: metrics
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
volumes:
- name: tmp
emptyDir:
medium: Memory
sizeLimit: 16Mi