apiVersion: apps/v1
kind: Deployment
metadata:
  name: $APP
  labels:
    app: $APP
spec:
  replicas: 2
  selector:
    matchLabels:
      app: $APP
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: $APP
    spec:
      containers:
        - name: $APP
          image: $IMAGE
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 100m
              memory: 200Mi
            limits:
              cpu: 200m
              memory: 400Mi
          ports:
            - containerPort: 8080
          livenessProbe:
            initialDelaySeconds: 30
            httpGet:
              path: /health
              port: 8080
          readinessProbe:
            initialDelaySeconds: 30
            httpGet:
              path: /health
              port: 8080
          env:
            - name: REDIS_URL
              value: rediss://10.102.0.11:6378
            - name: CACHE_TTL_SECONDS
              value: "300"
