apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: grafana-operator
  template:
    metadata:
      labels:
        name: grafana-operator
    spec:
      serviceAccountName: grafana-operator
      containers:
        - name: grafana-operator
          image: quay.io/integreatly/grafana-operator:latest
          args:
            - '--grafana-image=quay.io/openshift/origin-grafana'
            - '--grafana-image-tag=4.2'
            - '--image-pull-secret=entitled-registry'
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - grafana-operator
          imagePullPolicy: Always
          readinessProbe:
            exec:
              command:
                - stat
                - /tmp/operator-sdk-ready
            initialDelaySeconds: 4
            periodSeconds: 10
            failureThreshold: 1
          env:
            - name: TEMPLATE_PATH
              value: /usr/local/bin/templates
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "grafana-operator"
