80 lines
1.9 KiB
YAML
80 lines
1.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: shortener-service
|
|
namespace: urlshortener
|
|
labels:
|
|
app: shortener-service
|
|
component: backend
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: shortener-service
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: shortener-service
|
|
component: backend
|
|
spec:
|
|
containers:
|
|
- name: shortener-service
|
|
image: shortener-service:latest
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8083
|
|
name: http
|
|
protocol: TCP
|
|
env:
|
|
- name: SERVER_PORT
|
|
value: "8083"
|
|
- name: SPRING_APPLICATION_NAME
|
|
value: shortener-service
|
|
- name: SPRING_R2DBC_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: urlshortener-secrets
|
|
key: database-password
|
|
envFrom:
|
|
- configMapRef:
|
|
name: application-config
|
|
- configMapRef:
|
|
name: database-config
|
|
- configMapRef:
|
|
name: service-config
|
|
- secretRef:
|
|
name: urlshortener-secrets
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /actuator/health/liveness
|
|
port: 8083
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /actuator/health/readiness
|
|
port: 8083
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
startupProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8083
|
|
initialDelaySeconds: 0
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 30
|
|
restartPolicy: Always
|
|
|