apiVersion: apps/v1
kind: Deployment
metadata:
  name: newrelic-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: newrelic-operator
  template:
    metadata:
      labels:
        name: newrelic-operator
    spec:
      serviceAccountName: newrelic-operator-test
      containers:
        - name: newrelic-operator
          # Replace this with the built image name
          image: sstarcher/newrelic-operator:latest
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - newrelic-operator
          imagePullPolicy: Always
          env:
            - name: NEW_RELIC_APIKEY
              value: REPLACE_ME_NEW_RELIC_APIKEY
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "newrelic-operator"
