---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pingdom-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: pingdom-operator
  template:
    metadata:
      labels:
        name: pingdom-operator
    spec:
      serviceAccountName: pingdom-operator
      containers:
        - name: pingdom-operator
          image: adrianriobo/pingdom-operator:0.1
          command:
          - pingdom-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "pingdom-operator"
            - name: PD_USERNAME
              valueFrom:
                secretKeyRef:
                  name: pingdom-credentials
                  key: username
            - name: PD_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: pingdom-credentials
                  key: password
            - name: PD_APIKEY
              valueFrom:
                secretKeyRef:
                  name: pingdom-credentials
                  key: apikey
