apiVersion: apps/v1
kind: Deployment
metadata:
  name: apirator
  labels:
    app: apirator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: apirator
  template:
    metadata:
      labels:
        name: apirator
        app: apirator
    spec:
      serviceAccountName: apirator
      containers:
        - name: apirator
          image: apirator/apirator
          command:
            - apirator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                configMapKeyRef:
                  name: apirator-config
                  key: WATCH_NAMESPACE
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              valueFrom:
                configMapKeyRef:
                  name: apirator-config
                  key: OPERATOR_NAME