-
Notifications
You must be signed in to change notification settings - Fork 65
Generate kubeadm cloud init code #42
Generate kubeadm cloud init code #42
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckha The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chuckha my two cents.
Let me know if/how I can help in this effort
c8aa601
to
24e888f
Compare
1f5af57
to
970b205
Compare
@chuckha do you need any help with this? |
@CHA if you need some help here, I'm happy to jump in |
970b205
to
e2ce620
Compare
e2ce620
to
20c32ba
Compare
/assign @fabriziopandini This is ready to unblock you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chuckha thanks!
I'm ok with this change as it is- TODOs for follow-up PRs:
- implement "control-plane-ready: yes" or similar mechanism to orchestrate node joining orders (and possibly drop the init-lock mechanism)
- define priority/how to handle overlapping values between CAPBK and CAPI
- define sanity checks about machine spec and kubeadmConfig (e.g a machine that has label control plane should reject a kubeadmConfig with
JoinConfiguration.ControlPlane == false
)
controllers/bootstrapdata.go
Outdated
// TODO: sub in things in the cluster configuration like the cluster name and other data we can extract from the cluster object | ||
config.Spec.ClusterConfiguration.APIVersion = "v1beta1" | ||
config.Spec.ClusterConfiguration.Kind = "ClusterConfiguration" | ||
clusterdata, err := json.Marshal(config.Spec.ClusterConfiguration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chuckha
There is a potential overlap between network settings in CAPBK.v1alpha2.KubeadmConfig.ClusterConfiguration
and network settings in CAPI.v1alpha2.Cluster
. What is expected behavior here? (once I know the behavior, I can fix it also in a fallow PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes e.g for the CAPBK.controlplaneEndpoint
/ CAPI.APIEndpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you're right. I'll open a ticket to address this later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
516dbee
to
eb761b6
Compare
eb761b6
to
fb04d9c
Compare
This PR generates the `kubeadm init` bootstrap data It will wait unitl the infrastructure is ready before allowing anything beyond the bootstrap control plane from joining the cluster. Signed-off-by: Chuck Ha <[email protected]>
Signed-off-by: Chuck Ha <[email protected]>
fb04d9c
to
fcd7edf
Compare
Thanks! Let's get this merged and move on with the next iteration |
return ctrl.Result{}, err | ||
} | ||
|
||
config.Status.BootstrapData = cloudInitData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that BootstrapData is defined as []byte, does this have implications on serialization that we need to worry about?
Signed-off-by: Chuck Ha [email protected]
What this PR does / why we need it:
This PR generates the control-plane-init cloud init script, but it is incomplete. I just ran out of time this week and wanted to get some code out for folks to look at and think about.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Related to #18
Closes #16
Special notes for your reviewer:
Definitely not done. Please see TODOs
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note:
/cc @amy @vincepri @liztio @ncdc @detiber