apiVersion: apps/v1
kind: Deployment
metadata:
  name: shawarma-webhook
  namespace: kube-system
  labels:
    k8s-app: shawarma-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: shawarma-webhook
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        k8s-app: shawarma-webhook
    spec:
      serviceAccountName: shawarma-webhook
      volumes:
      - name: secrets
        secret:
          secretName: shawarma-webhook-certificate
      containers:
      - name: shawarma-webhook
        imagePullPolicy: IfNotPresent
        image: centeredge/shawarma-webhook:test-001
        env:
        - name: LOG_LEVEL
          value: debug
        - name: SHAWARMA_IMAGE
          value: centeredge/shawarma:1.0.0
        ports:
        - name: https
          containerPort: 443
        volumeMounts:
        - name: secrets
          mountPath: /etc/shawarma-webhook/certs
        livenessProbe:
          httpGet:
            scheme: HTTPS
            path: /health
            port: https
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3
        resources:
          requests:
            cpu: 500m
            memory: 256Mi
          limits:
            cpu: 1000m
            memory: 512Mi
