apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: webhook
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: webhook
    app.kubernetes.io/part-of: tekton-pipelines
    app.kubernetes.io/version: v0.32.1
    pipeline.tekton.dev/release: v0.32.1
    version: v0.32.1
  name: tekton-pipelines-webhook
  namespace: tekton-pipelines
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: webhook
      app.kubernetes.io/instance: default
      app.kubernetes.io/name: webhook
      app.kubernetes.io/part-of: tekton-pipelines
  template:
    metadata:
      labels:
        app: tekton-pipelines-webhook
        app.kubernetes.io/component: webhook
        app.kubernetes.io/instance: default
        app.kubernetes.io/name: webhook
        app.kubernetes.io/part-of: tekton-pipelines
        app.kubernetes.io/version: v0.32.1
        pipeline.tekton.dev/release: v0.32.1
        version: v0.32.1
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/os
                operator: NotIn
                values:
                - windows
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app.kubernetes.io/component: webhook
                  app.kubernetes.io/instance: default
                  app.kubernetes.io/name: webhook
                  app.kubernetes.io/part-of: tekton-pipelines
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: CONFIG_LEADERELECTION_NAME
          value: config-leader-election
        - name: CONFIG_FEATURE_FLAGS_NAME
          value: feature-flags
        - name: WEBHOOK_SERVICE_NAME
          value: tekton-pipelines-webhook
        - name: WEBHOOK_SECRET_NAME
          value: webhook-certs
        - name: METRICS_DOMAIN
          value: tekton.dev/pipeline
        image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook:v0.32.1@sha256:3e9beebdc80184231a9e147b20b9e8f15e7445af9b0e05dc6f05ce396c1f8500
        livenessProbe:
          httpGet:
            path: /health
            port: probes
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 5
        name: webhook
        ports:
        - containerPort: 9090
          name: metrics
        - containerPort: 8008
          name: profiling
        - containerPort: 8443
          name: https-webhook
        - containerPort: 8080
          name: probes
        readinessProbe:
          httpGet:
            path: /readiness
            port: probes
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 5
        resources:
          limits:
            cpu: 500m
            memory: 500Mi
          requests:
            cpu: 100m
            memory: 100Mi
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - all
          runAsGroup: 65532
          runAsUser: 65532
      serviceAccountName: tekton-pipelines-webhook
