---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    atix.de/technique: declarative object configuration
  labels:
    app: worker
    component: worker
    part-of: voting
  name: worker-go
  namespace: voting
spec:
  minReadySeconds: 0
  replicas: 3
  selector:
    matchLabels:
      app: worker
      component: worker
      part-of: voting
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: worker
        component: worker
        part-of: voting
    spec:
      containers:
      - image: docker.pkg.github.com/atix-ag/voting-app-code/worker-go
        name: worker-go
        resources:
          requests:
            memory: "16Mi"
            cpu: "100m"
          limits:
            memory: "64Mi"
            cpu: "500m"
        ports:
        - name: probe-port
          containerPort: 8080
        envFrom:
        - prefix: REDIS_
          configMapRef:
            name: options-redis
        - prefix: POSTGRES_
          configMapRef:
            name: options-db
        - prefix: POSTGRES_
          secretRef:
            name: db-secret
        startupProbe:
          httpGet:
            path: /startz
            port: probe-port
          initialDelaySeconds: 1
          timeoutSeconds: 1
          failureThreshold: 1
        livenessProbe:
          httpGet:
            path: /livez
            port: probe-port
          initialDelaySeconds: 0
          timeoutSeconds: 1
          failureThreshold: 1
...
