Skip to content

Commit

Permalink
data/bootstrap: Replace openshift.sh with cluster-bootstrap
Browse files Browse the repository at this point in the history
With this commit, I take advantage of
openshift/cluster-bootstrap@fc5e0941 (start: wire the library-go
dynamic client create, 2019-02-05, openshift/cluster-bootstrap#14) to
replace our previous openshift.sh (with a minor change to the manifest
directory).  I'm currently using a cp in bootkube.sh to shift those
manifests into the generic directory; I plan on consolidating
Openshift into Manifests in pkg/asset/manifests in follow-up work.

This change is especially important since the pivot to loopback
kubeconfigs in openshift.sh: 82d81d9 (data/data/bootstrap: use
loopback kubeconfig for API access, 2019-07-24, openshift#2086), because once
cluster-bootstrap (launched from bootkube.sh) decides it's done it
tears down the bootstrap control plane.  Without the bootstrap control
plane, further attempts by openshift.sh to push manifests via the
loopback kubeconfig fail [1].

We could roll reporting into bootkube.sh as well (dropping
progress.service), but Abhinav wanted to keep it separate [2].

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1748452
[2]: openshift#1381 (comment)
  • Loading branch information
wking committed Sep 17, 2019
1 parent 40ac25c commit 108a45b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 59 deletions.
7 changes: 7 additions & 0 deletions data/data/bootstrap/files/usr/local/bin/bootkube.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ systemctl restart cri-o.service

mkdir --parents ./{bootstrap-manifests,manifests}

if [ ! -f openshift-manifests.done ]
then
echo "Moving OpenShift manifests in with the rest of them"
cp openshift/* manifests/
touch openshift-manifests.done
fi

if [ ! -f cvo-bootstrap.done ]
then
echo "Rendering Cluster Version Operator Manifests..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARTIFACTS="/tmp/artifacts"

echo "Gathering bootstrap journals ..."
mkdir -p "${ARTIFACTS}/bootstrap/journals"
for service in release-image bootkube openshift kubelet crio approve-csr
for service in release-image bootkube kubelet crio approve-csr
do
journalctl --boot --no-pager --output=short --unit="${service}" > "${ARTIFACTS}/bootstrap/journals/${service}.log"
done
Expand Down
42 changes: 0 additions & 42 deletions data/data/bootstrap/files/usr/local/bin/openshift.sh

This file was deleted.

1 change: 0 additions & 1 deletion data/data/bootstrap/files/usr/local/bin/report-progress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ wait_for_existance() {

echo "Waiting for bootstrap to complete..."
wait_for_existance /opt/openshift/.bootkube.done
wait_for_existance /opt/openshift/.openshift.done

echo "Reporting install progress..."
while ! oc --config="$KUBECONFIG" create -f - <<-EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ wait_for_existance() {

echo "Waiting for bootstrap to complete..."
wait_for_existance /opt/openshift/.bootkube.done
wait_for_existance /opt/openshift/.openshift.done

## remove the routes setup so that we can open up the blackhole
systemctl stop gcp-routes.service
Expand Down
12 changes: 0 additions & 12 deletions data/data/bootstrap/systemd/units/openshift.service

This file was deleted.

4 changes: 2 additions & 2 deletions data/data/bootstrap/systemd/units/progress.service
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Unit]
Description=Report the completion of the cluster bootstrap process
# Workaround for https://github.com/systemd/systemd/issues/1312
Wants=bootkube.service openshift.service
After=bootkube.service openshift.service
Wants=bootkube.service
After=bootkube.service

[Service]
ExecStart=/usr/local/bin/report-progress.sh /opt/openshift/auth/kubeconfig
Expand Down

0 comments on commit 108a45b

Please sign in to comment.