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

Handling configurable machine setup/installation #104

Merged
merged 3 commits into from
Apr 21, 2018

Conversation

kcoronado
Copy link
Contributor

What this PR does / why we need it:
This PR modifies the GCE actuator to handle configurable Kubernetes versions, OS image, and startup scripts when creating clusters and starting up machines. It creates a new machine setup configmap that contains the different configurations that the GCE actuator can handle.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
#85

Special notes for your reviewer:
This PR was migrated from kubernetes-retired/kube-deploy#664.

Release note:

NONE

@kubernetes/kube-deploy-reviewers

- Rename GCEProviderConfig.Image field to OS
- Remove call to preloaded script in generate-image
- Create a machine-setup ConfigMap to mount the yaml file
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 19, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @kcoronado. Thanks for your PR.

I'm waiting for a kubernetes or kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 19, 2018
@kcoronado
Copy link
Contributor Author

/assign @krousey @jessicaochen

@@ -50,7 +54,12 @@ const (
ZoneAnnotationKey = "gcp-zone"
NameAnnotationKey = "gcp-name"

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm, I think you may need to rebase. You are re-adding the uid logic variable that was removed in another change.

} else {
return nil, fmt.Errorf("Instance %v %v %v is missing uid label.", config.Project, config.Zone, identifyingMachine.ObjectMeta.Name)
}
} else if uid != fmt.Sprintf("%v", machine.ObjectMeta.UID) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Another section of re-added logic that was removed.

@kcoronado
Copy link
Contributor Author

Sorry about that! I originally just copied and pasted the whole file from the old repo because I thought it was up to date. I went and double checked the diffs from this PR and the old PR and got rid of any additions that weren't in the old one (it was just the UID logic).

Copy link
Contributor

@jessicaochen jessicaochen left a comment

Choose a reason for hiding this comment

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

lgtm

@krousey
Copy link
Contributor

krousey commented Apr 20, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 20, 2018
@krousey
Copy link
Contributor

krousey commented Apr 20, 2018

/test pull-cluster-api-test

"testing"

clustercommon "k8s.io/kube-deploy/cluster-api/pkg/apis/cluster/common"
clusterv1 "k8s.io/kube-deploy/cluster-api/pkg/apis/cluster/v1alpha1"
Copy link
Contributor

Choose a reason for hiding this comment

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

New repo

@kcoronado
Copy link
Contributor Author

I thought I ran the tests when I migrated but I guess not :\ I fixed the paths so it's passing now.

@krousey
Copy link
Contributor

krousey commented Apr 20, 2018 via email

@krousey
Copy link
Contributor

krousey commented Apr 21, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kcoronado, krousey

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 21, 2018
@k8s-ci-robot k8s-ci-robot merged commit 262113e into kubernetes-sigs:master Apr 21, 2018
if configListPath != "" {
configWatch, err = machinesetup.NewConfigWatch(configListPath)
if err != nil {
glog.Errorf("Error creating config watch: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Was it deliberate that this is swallowing the error instead of returning it? If so, I think it's worth a comment why, because that's usually an anti-pattern and could use justification.

@@ -103,6 +112,15 @@ func NewMachineActuator(kubeadmToken string, machineClient client.MachineInterfa
}
}

// TODO: get rid of empty string check when we switch to the new bootstrapping method.
Copy link
Contributor

Choose a reason for hiding this comment

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

For each of these TODOs, it would be great to create a tracking issue with all the necessary context, and link to them in these comments. Otherwise, the actual meaning of "new bootstrapping method," and why an empty string check can be removed, etc. will slowly fade from people's memory.

return err
}
configMap := corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{Name: "machine-setup"},
Copy link
Contributor

Choose a reason for hiding this comment

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

This magic string is used in a few places. Is it possible to move it to a shared constant, and reference that instead?

chuckha pushed a commit to chuckha/cluster-api that referenced this pull request Oct 2, 2019
chuckha pushed a commit to chuckha/cluster-api that referenced this pull request Oct 2, 2019
Update Makefile that runs generates to use the generate boilerplate instead of the go boilerplate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants