Files

90 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: url-shortener
labels:
app.kubernetes.io/component: app
spec:
replicas: 0
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app.kubernetes.io/name: url-shortener
app.kubernetes.io/component: app
template:
metadata:
labels:
app.kubernetes.io/name: url-shortener
app.kubernetes.io/component: app
spec:
serviceAccountName: url-shortener
automountServiceAccountToken: false
imagePullSecrets:
- name: harbor-registry
terminationGracePeriodSeconds: 120
securityContext:
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
fsGroup: 65532
seccompProfile:
type: RuntimeDefault
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: url-shortener
app.kubernetes.io/component: app
topologyKey: kubernetes.io/hostname
containers:
- name: app
image: registry.dahyeon.us/dahyeon/url-shortener
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: url-shortener-config
- secretRef:
name: url-shortener-secrets
ports:
- name: http
containerPort: 3000
protocol: TCP
startupProbe:
httpGet:
path: /health/live
port: http
periodSeconds: 5
failureThreshold: 24
livenessProbe:
httpGet:
path: /health/live
port: http
periodSeconds: 15
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /health/ready
port: http
periodSeconds: 10
timeoutSeconds: 3
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: "1"
memory: 512Mi