apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-ingress-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: nginx-ingress-operator
  template:
    metadata:
      labels:
        name: nginx-ingress-operator
    spec:
      serviceAccountName: nginx-ingress-operator
      containers:
        - name: nginx-ingress-operator
          # Replace this with the built image name if necessary
          # For Openshift, use: registry.connect.redhat.com/nginx/nginx-ingress-operator:<version>
          image: nginx/nginx-ingress-operator:latest
          command:
          - nginx-ingress-operator
          imagePullPolicy: IfNotPresent
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "nginx-ingress-operator"
