Files
CosmicClash/deploy/k8s/base/control-plane-deployment.yaml
T

88 lines
2.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: control-plane
namespace: cosmic-clash
labels:
app.kubernetes.io/name: control-plane
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: control-plane
template:
metadata:
labels:
app.kubernetes.io/name: control-plane
spec:
serviceAccountName: control-plane
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: control-plane
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app.kubernetes.io/name: control-plane
containers:
- name: control-plane
image: ghcr.io/cosmic-clash/control-plane@sha256:0000000000000000000000000000000000000000000000000000000000000000
args:
- --rate-limit=120
- --rate-limit-window=1m
- --rate-limit-max-keys=10000
ports:
- name: http
containerPort: 8080
readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 5
timeoutSeconds: 2
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 1
memory: 512Mi
env:
- name: COSMIC_CLASH_POSTGRES_DSN
valueFrom:
secretKeyRef:
name: cosmic-clash-database
key: dsn
- name: COSMIC_CLASH_WORKLOAD_SECRET
valueFrom:
secretKeyRef:
name: cosmic-clash-workload
key: secret