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

✨Add ability to specify instance tenancy #1926

Merged
merged 2 commits into from
Sep 9, 2020
Merged

✨Add ability to specify instance tenancy #1926

merged 2 commits into from
Sep 9, 2020

Conversation

alexander-demicev
Copy link
Contributor

What this PR does / why we need it:
This PR adds the ability to specify instance tenancy and makes possible running dedicated instances.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 8, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @alexander-demichev. 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 /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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 8, 2020
api/v1alpha3/awsmachine_types.go Outdated Show resolved Hide resolved
pkg/cloud/services/ec2/instances_test.go Outdated Show resolved Hide resolved
@randomvariable
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 8, 2020
@randomvariable
Copy link
Member

/test pull-cluster-api-provider-aws-e2e

@randomvariable
Copy link
Member

/hold
for e2e

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 8, 2020
@randomvariable
Copy link
Member

e2e failure wasn't your fault, hoping this run works
/test pull-cluster-api-provider-aws-e2e

@randomvariable
Copy link
Member

/test pull-cluster-api-provider-aws-e2e

@k8s-ci-robot
Copy link
Contributor

@alexander-demichev: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-aws-e2e 255476119f921b07867d8da7a7fc12da88944722 link /test pull-cluster-api-provider-aws-e2e

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@randomvariable
Copy link
Member

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 9, 2020
@randomvariable
Copy link
Member

randomvariable commented Sep 9, 2020

There's a flake related to #1895, e2e otherwise looks good.
/approve

/assign @JoelSpeed
for lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: randomvariable

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 Sep 9, 2020
Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Just one question about the defaulting, otherwise LGTM

Comment on lines 77 to 82
// Default implements webhook.Defaulter so a webhook will be registered for the type
func (r *AWSMachineTemplate) Default() {
if r.Spec.Template.Spec.Tenancy == "" {
r.Spec.Template.Spec.Tenancy = "default"
}
}

Choose a reason for hiding this comment

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

I wonder if this could be achieved instead by using the OpenAPI definition? // +kubebuilder:default:=default?

Not sure if there is a particular preference for using a webhook over OpenAPI defaulting? Perhaps @randomvariable could answer that?

Alternative point, do we need to default this at all? The logic in the controller can handle an empty value (which defaults to the existing behaviour), so perhaps we can leave this with no default value at all?

Copy link
Member

Choose a reason for hiding this comment

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

Good point. Can probably use

+kubebuilder:default:=default

Alternative point, do we need to default this at all?

I'm not sure. Have seen some conflicts when using some of the CRD validation, but can't remember which ones conflict off hand. I would maybe try removing the defaulting, test that it works in the context of running the controller.

Copy link
Contributor Author

@alexander-demicev alexander-demicev Sep 9, 2020

Choose a reason for hiding this comment

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

The machine template creation doesn't cause any conflicts without the defaulting webhook. I think it can be dropped.

@randomvariable
Copy link
Member

/milestone v0.6.1

@k8s-ci-robot k8s-ci-robot added this to the v0.6.1 milestone Sep 9, 2020
Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/lgtm

Good work Alex, thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4373619 into kubernetes-sigs:master Sep 9, 2020
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants