apiVersion: apps/v1
kind: Deployment
metadata:
  name: route-reflector-operator
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      name: route-reflector-operator
  template:
    metadata:
      labels:
        name: route-reflector-operator
    spec:
      serviceAccountName: route-reflector-operator
      containers:
        - name: route-reflector-operator
          # Replace this with the built image name
          image: REPLACE_IMAGE
          command:
          - route-reflector-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "route-reflector-operator"
            - name: DATASTORE_TYPE
              value: "etcdv3"
            - name: ETCD_ENDPOINTS
              valueFrom:
                configMapKeyRef:
                  key: etcd_endpoints
                  name: calico-config
            - name: ETCD_CA_CERT_FILE
              valueFrom:
                configMapKeyRef:
                  key: etcd_ca
                  name: calico-config
            - name: ETCD_KEY_FILE
              valueFrom:
                configMapKeyRef:
                  key: etcd_key
                  name: calico-config
            - name: ETCD_CERT_FILE
              valueFrom:
                configMapKeyRef:
                  key: etcd_cert
                  name: calico-config
          volumeMounts:
            - mountPath: /calico-secrets
              name: calico-etcd-secrets
      volumes:
        - name: calico-etcd-secrets
          secret:
            secretName: calico-etcd-secrets
        - name: cluster-info
          configMap:
           name: cluster-info
