apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhook
  namespace: system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webhook
  template:
    metadata:
      labels:
        app: webhook
    spec:
      containers:
      - name: webhook
        image: webhook:latest
        command:
        - uvicorn
        args:
        - main:app
        - --host=0.0.0.0
        - --port=8443
        - --ssl-keyfile=/tmp/serving-certs/tls.key
        - --ssl-certfile=/tmp/serving-certs/tls.crt
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8443
            scheme: HTTPS
        ports:
        - containerPort: 8443
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 500m
            memory: 512Mi
        volumeMounts:
        - mountPath: /tmp/serving-certs
          name: serving-certs
          readOnly: true
      serviceAccountName: webhook
      terminationGracePeriodSeconds: 10
      volumes:
      - name: serving-certs
        secret:
          secretName: webhook-server-cert