apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhooks-extension
  namespace: tekton-pipelines
  labels:
    app: webhooks-extension
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webhooks-extension
  template:
    metadata:
      labels:
        app: webhooks-extension
    spec:
      serviceAccountName: tekton-webhooks-extension
      containers:
        - name: webhooks-extension
          image: webhooksExtensionImage
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /liveness
              port: 8080
          readinessProbe:
            httpGet:
              path: /readiness
              port: 8080
          env:
          - name: PORT
            value: "8080"
          - name: INSTALLED_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: DOCKER_REGISTRY_LOCATION
            value: DOCKER_REPO
          - name: WEB_RESOURCES_DIR
            value: web
          - name: WEBHOOK_CALLBACK_URL
            value: "http://listener.IPADDRESS.nip.io"
          # If the WEBHOOK_CALLBACK_URL's protocol is https, should ssl verification be enabled/disabled
          - name: SSL_VERIFICATION_ENABLED
            value: "false"
          - name: SERVICE_ACCOUNT
            valueFrom:
              fieldRef:
                fieldPath: spec.serviceAccountName