apiVersion: apps/v1
kind: Deployment
metadata:
  name: metal3-ironic
spec:
  replicas: 1
  selector:
    matchLabels:
      name: metal3-ironic
  template:
    metadata:
      labels:
        name: metal3-ironic
    spec:
      hostNetwork: true
      containers:
        - name: ironic-dnsmasq
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          securityContext:
             capabilities:
               add: ["NET_ADMIN"]
          command:
            - /bin/rundnsmasq
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
        - name: mariadb
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          command:
            - /bin/runmariadb
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
          env:
            - name: MARIADB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mariadb-password
                  key: password
        - name: ironic-httpd
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          securityContext:
             capabilities:
               add: ["NET_ADMIN"]
          command:
            - /bin/runhttpd
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
        - name: ironic
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          command:
            - /bin/runironic
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
          env:
            - name: MARIADB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mariadb-password
                  key: password
        - name: ironic-inspector
          image: quay.io/metal3-io/ironic-inspector
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
      initContainers:
        - name: ironic-ipa-downloader
          image: quay.io/metal3-io/ironic-ipa-downloader
          imagePullPolicy: Always
          command:
            - /usr/local/bin/get-resource.sh
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
      volumes:
        - name: ironic-data-volume
          emptyDir: {}