apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world
  labels:
    app.kubernetes.io/component: application-handler
    app.kubernetes.io/version: v0.1
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/component: application-handler
  strategy:
    rollingUpdate:
      maxSurge: 50%
      maxUnavailable: 50%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/component: application-handler
        app.kubernetes.io/version: v0.1
    spec:
      serviceAccountName: $(SERVICEACCOUNT)
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels: {}
            topologyKey: kubernetes.io/hostname
      containers:
      - name: hello-world
        image: harbor.svc.y6b.de/kubernetes/gunicorn_hello_world:v0.1
        livenessProbe:
          httpGet:
            path: /
            port: $(PORT)
            scheme: HTTP
          initialDelaySeconds: 5
        readinessProbe:
          httpGet:
            path: /
            port: $(PORT)
            scheme: HTTP
        ports:
        - containerPort: 8081
          protocol: TCP
          name: http
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
