Skip to content

Commit

Permalink
WIP run ironic on the bootstrap VM
Browse files Browse the repository at this point in the history
This is being used to test openshift-metal3/kni-installer#100
  • Loading branch information
Steven Hardy committed Jun 12, 2019
1 parent 9b9bf09 commit cb94d67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
25 changes: 4 additions & 21 deletions 04_setup_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,16 @@ if sudo podman pod exists ironic-pod ; then
sudo podman pod rm ironic-pod -f
fi

# set password for mariadb
mariadb_password=$(echo $(date;hostname)|sha256sum |cut -c-20)

# Create pod
sudo podman pod create -n ironic-pod

# Start dnsmasq, http, mariadb, and ironic containers using same image
sudo podman run -d --net host --privileged --name dnsmasq --pod ironic-pod \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/rundnsmasq ${IRONIC_IMAGE}

# We start only the httpd and *downloader containers so that we can provide
# cached images to the bootstrap VM
sudo podman run -d --net host --privileged --name httpd --pod ironic-pod \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/runhttpd ${IRONIC_IMAGE}

sudo podman run -d --net host --privileged --name mariadb --pod ironic-pod \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/runmariadb \
--env MARIADB_PASSWORD=$mariadb_password ${IRONIC_IMAGE}

sudo podman run -d --net host --privileged --name ironic --pod ironic-pod \
--env MARIADB_PASSWORD=$mariadb_password \
-v $IRONIC_DATA_DIR:/shared ${IRONIC_IMAGE}

sudo podman run -d --net host --privileged --name ipa-downloader --pod ironic-pod \
sudo podman run -d --name ipa-downloader --pod ironic-pod \
-v $IRONIC_DATA_DIR:/shared ${IPA_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh

sudo podman run -d --net host --privileged --name coreos-downloader --pod ironic-pod \
sudo podman run -d --name coreos-downloader --pod ironic-pod \
-v $IRONIC_DATA_DIR:/shared ${COREOS_DOWNLOADER_IMAGE} /usr/local/bin/get-resource.sh $RHCOS_IMAGE_URL

# Start Ironic Inspector
sudo podman run -d --net host --privileged --name ironic-inspector \
--pod ironic-pod -v $IRONIC_DATA_DIR:/shared "${IRONIC_INSPECTOR_IMAGE}"
14 changes: 0 additions & 14 deletions 06_create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ if [ ! -d ocp ]; then
generate_ocp_install_config ocp
fi

# Make sure Ironic is up
export OS_TOKEN=fake-token
export OS_URL=http://localhost:6385/

wait_for_json ironic \
"${OS_URL}/v1/nodes" \
20 \
-H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: wait-for-json" -H "X-Auth-Token: $OS_TOKEN"

if [ $(sudo podman ps | grep -w -e "ironic$" -e "ironic-inspector$" -e "dnsmasq" -e "httpd" | wc -l) != 4 ]; then
echo "Can't find required containers"
exit 1
fi

# Call kni-installer to deploy the bootstrap node and masters
create_cluster ocp

Expand Down
4 changes: 2 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export RHCOS_IMAGE_FILENAME_LATEST="rhcos-ootpa-latest.qcow2"
# Ironic vars
export IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic:master"}
export IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"quay.io/metal3-io/ironic-inspector:master"}
export IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"quay.io/higginsd/resource-downloader-ipa:master"}
export COREOS_DOWNLOADER_IMAGE=${COREOS_DOWNLOADER_IMAGE:-"quay.io/higginsd/resource-downloader-coreos:master"}
export IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"quay.io/metal3-io/ironic-ipa-downloader:master"}
export COREOS_DOWNLOADER_IMAGE=${COREOS_DOWNLOADER_IMAGE:-"quay.io/openshift-metal3/rhcos-downloader:master"}
export IRONIC_DATA_DIR="$WORKING_DIR/ironic"

export KUBECONFIG="${SCRIPTDIR}/ocp/auth/kubeconfig"
Expand Down

0 comments on commit cb94d67

Please sign in to comment.