-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ [WIP] Introduce bootstrap provider for ignition #3437
✨ [WIP] Introduce bootstrap provider for ignition #3437
Conversation
Hi @dongsupark. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Make sure you add an OWNERS or OWNERS_ALIASES file |
@@ -0,0 +1,164 @@ | |||
/* |
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.
We can probably remove the v1alpha2 APIs completely
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.
We can probably remove the v1alpha2 APIs completely
Removed v1alpha2 completely.
// +kubebuilder:subresource:status | ||
|
||
// KubeadmConfig is the Schema for the kubeadmconfigs API | ||
type KubeadmConfig struct { |
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 suspect this type will need to be renamed to avoid conflicting with the cloud-init based bootstrap provider.
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 suspect this type will need to be renamed to avoid conflicting with the cloud-init based bootstrap provider.
Right. I renamed related structures to KubeadmIgnition*
.
exp/kubeadm-ignition/types/README.md
Outdated
@@ -0,0 +1,9 @@ | |||
# Kubeadm types |
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.
If these are the same types being used by the cloud-init based bootstrap provider, you might be able to just import those rather than keeping a separate copy here as well.
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.
If these are the same types being used by the cloud-init based bootstrap provider, you might be able to just import those rather than keeping a separate copy here as well.
Right.
I removed unnecessary types, and tried to use existing types outside of exp
.
Though types related to systemd units should stay here under exp/kubeadm-ignition/types
.
exp/util/secret/consts.go
Outdated
@@ -0,0 +1,54 @@ | |||
/* |
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.
Similar with these util/secret
helpers, if they are the same as the cloud-init based bootstrap provider, might be worth it to just import those instead.
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.
Removed util/secret
from exp
, and just used one in the upper-level.
@dongsupark let me know when this one is ready for a first pass |
Added |
An experimental bootstrap provider for ignition. It originally comes from https://github.com/fossabot/cluster-api-bootstrap-provider-kubeadm-ignition See also #3430
#3430 is currently in the v0.3.9 milestone, due in a few days. Do we anticipate this is ready to merge by then, or should we push this back? |
"bytes" | ||
"encoding/json" | ||
"errors" | ||
"github.com/aws/aws-sdk-go/aws" |
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.
https://github.com/kubernetes-sigs/cluster-api-provider-aws why are there AWS specific things in here? Any AWS provider code should go in CAPA https://github.com/kubernetes-sigs/cluster-api-provider-aws
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.
From what I understand, Ignition needs a source from which it pulls its configuration. This implementation is using S3 at the moment. We may want/need to support multiple sources, and S3 could/would be a reasonable choice when running on AWS. I don't know there's any simple way to keep source-specific code out of the bootstrap provider, unless you went with a plugin model, where the plugins lived in separate repos. That, however, would make deployment a lot more complicated.
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.
A bootstrap provider that lives in the Cluster API repo being infrastructure agnostic should be a requirement IMO otherwise we're setting a precedent and breaking one of the core principles of Cluster API. If it's not straightforward it should come with a design proposal.
"I don't know there's any simple way to keep source-specific code out of the bootstrap provider" --> sounds like we need to do a bit more research around this.
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.
https://github.com/flatcar-linux/ignition/blob/master/doc/supported-platforms.md gives a good overview of using ignition with different platforms
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.
+1 making this agnostic, let's discuss and design a solution that is agnostic. We have prior art with object references, or we could make this based on the infrastructure provider used (infra providers would provide the code that runs here)
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.
would this be okay to switch to a generic S3 API? Like minio?
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.
Possibly 🤔 We try to be as agnostic as possible, what that really comes down to is provider interfaces that are satisfied with third party installations.
For example, we could abstract away this interface to be a metadata provider
. Then, the AWS provider could contribute the AWS code, GCP, Azure can do the same with time.
What do you all think?
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.
this might should be part of the #3761 design
|
||
templateBackend, err := ignition.NewS3TemplateBackend(userdataDir, userDataBucket) | ||
if err != nil { | ||
setupLog.Error(err, "unable to create aws s3 session") |
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 comment
cc @vincepri
There are a couple of issues left in individual infrastructure providers that have cloud-init-specific implementations. |
/milestone Next |
@dongsupark: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
WIP for rebasing this on v1alpha4 https://github.com/kinvolk/cluster-api/pull/1 Regardless, I'm hoping we can find a short term way forward while we figure out the architecture needed for #3761 |
|
||
const ( | ||
KubernetesDefaultVersion = "v1.17.4" | ||
IngitionSchemaVersion = "2.2.0" |
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.
Ignition config spec 2.x is unmaintained and unsupported upstream. New code should use 3.x, either with or without compatibility code for 2.x. One approach is to generate 3.x structs and then use ign-converter to downconvert when needed.
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.
just to add here: ign-converter also goes the other way, i.e. we're using it to migrate clusters provisioned with Ign0.x/spec 2.2.0 to Ign2.x/spec 3
Are the AWS and ignition version issues the only thing blocking merge? |
An experimental bootstrap provider for ignition, to support OS like Flatcar Container Linux or Ignition.
As discussed with @vincepri , the code is located under
exp
, so it can be isolated from other parts.It originally comes from
https://github.com/fossabot/cluster-api-bootstrap-provider-kubeadm-ignition.
Fixes #3430