- Add REDIS_URL env var using variable expansion from the existing trading-data-service-config ConfigMap (REDIS_HOST + REDIS_PORT). - This resolves the 'connecting to localhost:6379' crash on startup. - Matches the actual infrastructure configuration in customer1.
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: trading-data-service
|
|
namespace: customer1
|
|
labels:
|
|
app: trading-data-service
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: trading-data-service
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: trading-data-service
|
|
annotations:
|
|
checksum/config: trading-data-service-config
|
|
spec:
|
|
terminationGracePeriodSeconds: 30
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
fsGroup: 1000
|
|
containers:
|
|
- name: data-service
|
|
image: ghcr.io/sirius0xdev/trading-data-service:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8001
|
|
name: http
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
envFrom:
|
|
- configMapRef:
|
|
name: trading-data-service-config
|
|
env:
|
|
- name: REDIS_URL
|
|
value: "redis://$(REDIS_HOST):$(REDIS_PORT)/0"
|
|
- name: DB_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: trading-db-credentials
|
|
key: username
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: trading-db-credentials
|
|
key: password
|
|
startupProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8001
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 5
|
|
failureThreshold: 6
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8001
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8001
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|