From e4b8d9a41483cbc87c59dace2d9991aff3665042 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Thu, 20 Jun 2019 10:40:10 -0700 Subject: [PATCH] WIP: Use the new baremetal ironic pod to deploy the BMO Switch to using the new ironic + baremetal operator pod. Depends on: https://github.com/metal3-io/baremetal-operator/pull/212 --- 08_deploy_bmo.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/08_deploy_bmo.sh b/08_deploy_bmo.sh index a03cabcd7..849cd0431 100755 --- a/08_deploy_bmo.sh +++ b/08_deploy_bmo.sh @@ -13,9 +13,32 @@ export BMOPATH="$GOPATH/src/github.com/metal3-io/baremetal-operator" cp -r $BMOPATH/deploy ocp/. sed -i 's/namespace: .*/namespace: openshift-machine-api/g' ocp/deploy/role_binding.yaml +# Kill the dnsmasq container on the host since it is performing DHCP and doesn't +# allow our pod in openshift to take over. +for name in dnsmasq ironic-inspector ; do + sudo podman ps | grep -w "$name$" && sudo podman stop $name +done + # Start deploying on the new cluster oc --config ocp/auth/kubeconfig apply -f ocp/deploy/service_account.yaml --namespace=openshift-machine-api oc --config ocp/auth/kubeconfig apply -f ocp/deploy/role.yaml --namespace=openshift-machine-api oc --config ocp/auth/kubeconfig apply -f ocp/deploy/role_binding.yaml oc --config ocp/auth/kubeconfig apply -f ocp/deploy/crds/metal3_v1alpha1_baremetalhost_crd.yaml -oc --config ocp/auth/kubeconfig apply -f ocp/deploy/operator.yaml --namespace=openshift-machine-api + +oc --config ocp/auth/kubeconfig apply -f ocp/deploy/ironic_bmo_configmap.yaml --namespace=openshift-machine-api +# I'm leaving this as is for debugging but we could easily generate a random password here. +oc --config ocp/auth/kubeconfig delete secret mariadb-password --namespace=openshift-machine-api || true +oc --config ocp/auth/kubeconfig create secret generic mariadb-password --from-literal password=password --namespace=openshift-machine-api + +oc --config ocp/auth/kubeconfig adm --as system:admin policy add-scc-to-user privileged system:serviceaccount:openshift-machine-api:baremetal-operator +oc --config ocp/auth/kubeconfig apply -f ocp/deploy/operator_ironic.yaml -n openshift-machine-api + +# Sadly I don't see a way to get this from the json.. +POD_NAME=$(oc --config ocp/auth/kubeconfig get pods -n openshift-machine-api | grep metal3-baremetal-operator | cut -f 1 -d ' ') + +# Make sure our pod is running. +echo "Waiting for baremetal-operator pod to become ready" | lolcat +while [ $(oc --config ocp/auth/kubeconfig get pod $POD_NAME -n openshift-machine-api -o json | jq .status.phase) != '"Running"' ] +do + sleep 5 +done