---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: admission-webhook-k8s
  labels:
    app: admission-webhook-k8s
spec:
  selector:
    matchLabels:
      app: admission-webhook-k8s
  template:
    metadata:
      labels:
        app: admission-webhook-k8s
    spec:
      serviceAccount: admission-webhook-sa
      containers:
        - name: admission-webhook-k8s
          image: ghcr.io/networkservicemesh/ci/cmd-admission-webhook-k8s:e4b6f9c
          imagePullPolicy: IfNotPresent
          readinessProbe:
            httpGet:
              path: /ready
              port: 443
              scheme: HTTPS
          env:
            - name: SPIFFE_ENDPOINT_SOCKET
              value: unix:///run/spire/sockets/agent.sock
            - name: NSM_SERVICE_NAME
              value: admission-webhook-svc
            - name: NSM_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: NSM_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: NSM_ANNOTATION
              value: networkservicemesh.io
            - name: NSM_CONTAINER_IMAGES
              value: ghcr.io/networkservicemesh/ci/cmd-nsc:558a619
            - name: NSM_INIT_CONTAINER_IMAGES
              value: ghcr.io/networkservicemesh/ci/cmd-nsc-init:a3edfa9
            - name: NSM_LABELS
              value: spiffe.io/spiffe-id:true
            - name: NSM_ENVS
              value: NSM_LOG_LEVEL=TRACE
