From c55ed9d57db82e157fa9743a9a0023dc1acb1885 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Thu, 20 Jun 2019 10:40:10 -0700 Subject: [PATCH] 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 --- 02_configure_host.sh | 5 +++++ 08_deploy_bmo.sh | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/02_configure_host.sh b/02_configure_host.sh index 3187632da..28ee8a7b7 100755 --- a/02_configure_host.sh +++ b/02_configure_host.sh @@ -135,6 +135,11 @@ for port in 80 5050 6385 ; do fi done +# Allow access to httpd on baremetal network for image cache. +if ! sudo iptables -C INPUT -i baremetal -p tcp -m tcp --dport 80 -j ACCEPT > /dev/null 2>&1; then + sudo iptables -I INPUT -i baremetal -p tcp -m tcp --dport 80 -j ACCEPT +fi + # Allow ipmi to the virtual bmc processes that we just started if [ "${RHEL8}" = "True" ] ; then sudo firewall-cmd --zone=libvirt --add-port=6230-6235/udp diff --git a/08_deploy_bmo.sh b/08_deploy_bmo.sh index a03cabcd7..f30286842 100755 --- a/08_deploy_bmo.sh +++ b/08_deploy_bmo.sh @@ -13,9 +13,22 @@ 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