apiVersion: apps/v1
kind: Deployment
metadata:
  name: metrics-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      name: metrics-webhook
  template:
    metadata:
      labels:
        name: metrics-webhook
    spec:
      serviceAccountName: metrics-webhook
      containers:
        - name: metrics-webhook
          image: docker.io/iovchynnikov/metrics-webhook:latest
          command:
            - metrics-webhook
          imagePullPolicy: IfNotPresent
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "metrics-webhook"
