apiVersion: apps/v1
kind: Deployment
metadata:
  name: metal3-baremetal-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: metal3-baremetal-operator
  template:
    metadata:
      labels:
        name: metal3-baremetal-operator
    spec:
      serviceAccountName: metal3-baremetal-operator
      containers:
        - name: baremetal-operator
          image: quay.io/metal3-io/baremetal-operator:master
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - /baremetal-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
        # Temporary workaround to talk to an external Ironic process until Ironic is running in this pod.
        - name: ironic-proxy
          image: alpine/socat
          command: ["socat", "tcp-listen:6385,fork,reuseaddr", "tcp-connect:172.22.0.1:6385"]
          imagePullPolicy: Always
        - name: ironic-inspector-proxy
          image: alpine/socat
          command: ["socat", "tcp-listen:5050,fork,reuseaddr", "tcp-connect:172.22.0.1:5050"]
          imagePullPolicy: Always
