Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
35 lines
1.3 KiB
YAML
35 lines
1.3 KiB
YAML
# NOT EXECUTED: the sandbox that produced this module has no Docker daemon, so no cluster was
|
|
# available. These manifests are checked only for YAML syntax. Apply them to a test cluster first.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: orders-consumer
|
|
spec:
|
|
# KEDA/HPA owns the replica count once the ScaledObject exists; leave `replicas` unset.
|
|
selector:
|
|
matchLabels:
|
|
app: orders-consumer
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: orders-consumer
|
|
spec:
|
|
# Must exceed spring.lifecycle.timeout-per-shutdown-phase (25s) plus a margin, otherwise
|
|
# Kubernetes sends SIGKILL while the container is still finishing its batch.
|
|
terminationGracePeriodSeconds: 60
|
|
containers:
|
|
- name: app
|
|
image: registry.example.com/keda-consumer:1.0.0 # build with your usual image pipeline
|
|
env:
|
|
- name: SPRING_KAFKA_BOOTSTRAP_SERVERS
|
|
value: kafka.kafka.svc.cluster.local:9092
|
|
ports:
|
|
- containerPort: 8080
|
|
readinessProbe:
|
|
httpGet: {path: /actuator/health/readiness, port: 8080}
|
|
livenessProbe:
|
|
httpGet: {path: /actuator/health/liveness, port: 8080}
|
|
resources:
|
|
requests: {cpu: 250m, memory: 512Mi}
|
|
limits: {memory: 512Mi}
|