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
          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
            - name: OPERATOR_NAME
              value: "baremetal-operator"
            - name: DEPLOY_KERNEL_URL
              value: "http://172.22.0.1/images/ironic-python-agent.kernel"
            - name: DEPLOY_RAMDISK_URL
              value: "http://172.22.0.1/images/ironic-python-agent.initramfs"
            - name: IRONIC_ENDPOINT
              value: "http://localhost:6385/v1/"
        # 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
