b3426f7493
Added a /health endpoint for application health monitoring Implemented logging filter to suppress health check requests from logs Updated Dockerfile and Kubernetes deployment to use the new health check endpoint Incremented production image tag version
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: math-exercises-app
|
|
labels:
|
|
app: math-exercises
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: math-exercises
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: math-exercises
|
|
spec:
|
|
# Security context for the pod
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
fsGroup: 2000
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: math-exercises
|
|
image: math-exercises:latest
|
|
ports:
|
|
- containerPort: 8000
|
|
# Security context for the container
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
# Resource limits and requests
|
|
resources:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "250m"
|
|
limits:
|
|
memory: "128Mi"
|
|
cpu: "500m"
|
|
# Liveness probe
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 90
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
# Readiness probe
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
# Environment variables from ConfigMap
|
|
envFrom:
|
|
- configMapRef:
|
|
name: math-exercises-config
|