Files
URLShortener/k8s/base/deployments/analytics-service-deployment.yaml

80 lines
1.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: analytics-service
namespace: urlshortener
labels:
app: analytics-service
component: backend
spec:
replicas: 2
selector:
matchLabels:
app: analytics-service
template:
metadata:
labels:
app: analytics-service
component: backend
spec:
containers:
- name: analytics-service
image: analytics-service:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
protocol: TCP
env:
- name: SERVER_PORT
value: "8080"
- name: SPRING_APPLICATION_NAME
value: analytics-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: 8080
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
startupProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 30
restartPolicy: Always