apiVersion: apps/v1
kind: Deployment
metadata:
  name: pullup-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webhook
      release: pullup
  template:
    metadata:
      labels:
        app: webhook
        release: pullup
      annotations:
        prometheus.io/path: /metrics
        prometheus.io/port: "9100"
        prometheus.io/scrape: "true"
    spec:
      containers:
        - name: webhook
          image: tommy351/pullup-webhook
          imagePullPolicy: IfNotPresent
          ports:
            - name: webhook
              containerPort: 8080
            - name: metrics
              containerPort: 9100
            - name: health
              containerPort: 9101
          env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          readinessProbe:
            httpGet:
              path: /readyz
              port: health
          livenessProbe:
            httpGet:
              path: /healthz
              port: health
      serviceAccountName: pullup
