Files
s3-balance/deploy/kubernetes/deployment.yaml
2025-09-13 22:30:40 +08:00

92 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: s3-balance-deployment
namespace: s3-balance
labels:
app: s3-balance
tier: backend
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
selector:
matchLabels:
app: s3-balance
template:
metadata:
labels:
app: s3-balance
tier: backend
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- s3-balance
topologyKey: kubernetes.io/hostname
containers:
- name: s3-balance
image: s3-balance:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
env:
- name: TZ
value: "Asia/Shanghai"
volumeMounts:
- name: config
mountPath: /app/config
readOnly: true
- name: data
mountPath: /app/data
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config
configMap:
name: s3-balance-config
- name: data
emptyDir: {}
restartPolicy: Always
terminationGracePeriodSeconds: 30