apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout
  namespace: shop
  annotations:
    kubernetes.io/change-cause: "release 2.0 - add product cache warm-up"
spec:
  replicas: 3
  selector:
    matchLabels:
      app: checkout
  template:
    metadata:
      labels:
        app: checkout
        version: "2"
    spec:
      containers:
        - name: checkout
          image: python:3.12-alpine
          command: ["python", "-u", "/app/app.py"]
          env:
            - name: VERSION
              value: "2"
            - name: WARM_CACHE
              value: "1"
          resources:
            requests:
              cpu: 1500m
              memory: 48Mi
            limits:
              memory: 64Mi
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            periodSeconds: 3
          volumeMounts:
            - name: code
              mountPath: /app
      volumes:
        - name: code
          configMap:
            name: checkout-code
