Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootkube: Inject bootstrap MachineConfigs into cluster #1189

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 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 @@ -201,6 +201,15 @@ echo "etcd cluster up. Killing etcd certificate signer..."

podman rm --force etcd-signer
rm --force /etc/kubernetes/manifests/machineconfigoperator-bootstrap-pod.yaml
# Copy the bootstrap MCs to inject into the target cluster
# Yes this is a brutal hack, need to improve the MCC bootstrap above
# 9a so we're after 99 - should change the others to 50- or something?
for x in /etc/mcs/bootstrap/machine-configs/*.yaml; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these come from in the first place? Looks like /etc/mcs has only been mentioned in 6da1973 (#879), but I don't see any installer code obviously populating it. Maybe it's here? If so, is there a reason you couldn't address this entirely within openshift/machine-config-operator?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of the current code is here openshift/machine-config-operator#367 (comment)

but I don't see any installer code obviously populating it.

AIUI it's the static pod which we are just removing above this code:
/etc/kubernetes/manifests/machineconfigoperator-bootstrap-pod.yaml

If so, is there a reason you couldn't address this entirely within openshift/machine-config-operator?

Maybe - I didn't write this code and am still learning things here, so alternative suggestions appreciated!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand things though...that bootstrap pod is what's serving out the Ignition to the masters. We don't have masters online until after echo "etcd cluster up. Killing etcd certificate signer..." (right?)

I believe we won't even have the machineconfigs CRD in the cluster until the MCO comes online. So we will end up waiting in openshift.service for that - similar to how we wait for the cluster API objects and inject those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I don't see any installer code obviously populating it.

AIUI it's the static pod which we are just removing above this code:
/etc/kubernetes/manifests/machineconfigoperator-bootstrap-pod.yaml

So can we update that code to make these alterations? It's maybe here calling here?

So we will end up waiting in openshift.service for that - similar to how we wait for the cluster API objects and inject those.

I'm not sure how this comes into this pull request, but I'm pushing to get openshift.service and openshift.sh functionality moved into cluster-bootstrap. See #1147, which I'm going to reroll after cluster-bootstrap picks up openshift/library-go#220.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So can we update that code to make these alterations?

Mmm...this code needs to generate content to inject into the target cluster. The static pod is running on the bootstrap before the cluster, right?

but I'm pushing to get openshift.service and openshift.sh functionality moved into cluster-bootstrap.

That makes sense to me...I was surprised at the low-tech nature of openshift.sh.

bn=$(basename $x)
(echo 'apiVersion: machineconfiguration.openshift.io/v1'
echo 'kind: MachineConfig'
python -c 'import sys,yaml; d=yaml.load(open(sys.argv[1])); del d["metadata"]["ownerReferences"]; yaml.dump(d, sys.stdout)' $x) > /opt/openshift/openshift/9a-${bn}
done

echo "Starting cluster-bootstrap..."

Expand Down