apiVersion: apps/v1
kind: Deployment
metadata:
  name: podmu-deployment
  namespace: podmu
  labels:
    app: podmu
spec:
  replicas: 1
  selector:
    matchLabels:
      app: podmu
  template:
    metadata:
      labels:
        app: podmu
    spec:
      containers:
      - name: podmu
        image: podmu/podmu:latest
        imagePullPolicy: Always
        env:
        - name: GODEBUG
          value: x509ignoreCN=0
        args:
        - -port=8443
        - -cfgDir=/etc/webhook/config
        - -tlsCertFile=/etc/webhook/certs/cert.pem
        - -tlsKeyFile=/etc/webhook/certs/key.pem
        - -insecureSkipVerify=false
        - -alsologtostderr
        - -v=6
        - 2>&1
        ports:
        - name: default-port
          containerPort: 8443
        readinessProbe:
          httpGet:
            path: /healthz
            port: default-port
            scheme: HTTPS
          initialDelaySeconds: 5
          periodSeconds: 30
        livenessProbe:
          httpGet:
            path: /healthz
            port: default-port
            scheme: HTTPS
          initialDelaySeconds: 10
          periodSeconds: 30
        volumeMounts:
        - name: webhook-certs
          mountPath: /etc/webhook/certs
          readOnly: true
        - name: webhook-config
          mountPath: /etc/webhook/config
          readOnly: true
        resources:
          limits:
            cpu: 100m
            memory: 50Mi
      volumes:
      - name: webhook-certs
        secret:
          secretName: podmu-certs
      - name: webhook-config
        configMap:
          name: podmu-cm
