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-api
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          command:
            - /bin/runironic-api
          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-conductor
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          command:
            - /bin/runironic-conductor
          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-log-watch
          image: quay.io/metal3-io/ironic
          imagePullPolicy: Always
          command:
            - /bin/runlogwatch.sh
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
        - name: ironic-inspector
          image: quay.io/metal3-io/ironic-inspector
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: ironic-bmo-configmap
        - name: ironic-inspector-log-watch
          image: quay.io/metal3-io/ironic-inspector
          imagePullPolicy: Always
          command:
            - /bin/runlogwatch.sh
          volumeMounts:
            - mountPath: /shared
              name: ironic-data-volume
      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: {}