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

Updated subnets field in Machinepool yaml #2903

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

shivi28
Copy link
Contributor

@shivi28 shivi28 commented Nov 2, 2021

What type of PR is this?
/kind bug

What this PR does / why we need it:
Updated doc and template machinepool flavour for subnet field.

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

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Updated machinepool template and doc for subnet field usage

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 2, 2021
@shivi28 shivi28 changed the title Updated subnets field in Machinepool Updated subnets field in Machinepool yaml Nov 2, 2021
@randomvariable
Copy link
Member

How is this template supposed to work full stop? We need a VPC created and AWSCluster controller to provision subnets before a subnet can be used in the machine pool. Otherwise, you might use BYOI, but this template doesn't support it.

This whole template needs revision and/or the MachinePool controller code needs fixing to work with VPCs provisioned by AWSCluster.

@sedefsavas
Copy link
Contributor

sedefsavas commented Nov 2, 2021

This whole template needs revision and/or the MachinePool controller code needs fixing to work with VPCs provisioned by AWSCluster.

Template doesn't work with the field set, but subnets is an optional field what are we trying to make it work here? When the subnets is nil, it uses AWSCluster subnets.

@sedefsavas
Copy link
Contributor

This whole template needs revision and/or the MachinePool controller code needs fixing to work with VPCs provisioned by AWSCluster.

@randomvariable why do we need to change the code?

@sedefsavas sedefsavas added kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 9, 2021
@sedefsavas sedefsavas added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Nov 9, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 9, 2021
@sedefsavas
Copy link
Contributor

Let's follow up on this before the release this week. cc @randomvariable

@@ -91,8 +91,6 @@ spec:
awsLaunchTemplate:
instanceType: "${AWS_CONTROL_PLANE_MACHINE_TYPE}"
sshKeyName: "${AWS_SSH_KEY_NAME}"
subnets:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep this in the docs:
subnets:

  • subnet-id

Btw, did you check if this field is working by any chance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes will receive a validation error. It says invalid type for io.x-k8s.cluster.infrastructure.v1beta1.AWSMachinePool.spec.subnets: got "string", expected "map";

So that's why I removed it from doc as well. Please let me know if you think we should still keep it?

@shivi28
Copy link
Contributor Author

shivi28 commented Dec 9, 2021

@sedefsavas I tried multiple use cases in local and found

  1. If you have any existing network(VPC and subnet IDs) and want to create AWSMachines in given subnet IDs via AWSMachinePool. Then we have to add existing network in AWSCluster Spec and desired subnet IDs in AWSMachinePool Spec. This will create all AWSMachines in subnets mentioned by AWSMachinePool.spec.subnets
  2. But if you want to use default VPC created by AWSCluster and use any existing subnet IDs in AWSMachinePool, then it will throw a ValidationError: One or more security groups in the launch template are not linked to the VPCs configured in the Auto Scaling group.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 9, 2021
@sedefsavas
Copy link
Contributor

@shivi28

I confirmed that this works with correct subnet ids that belongs to the VPC cluster is in.

But if you want to use default VPC created by AWSCluster and use any existing subnet IDs in AWSMachinePool, then it will throw a ValidationError: One or more security groups in the launch template are not linked to the VPCs configured in the Auto Scaling group.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2021
@sedefsavas
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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 Dec 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2618f61 into kubernetes-sigs:main Dec 13, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Dec 13, 2021
richardchen-db pushed a commit to databricks/cluster-api-provider-aws-1 that referenced this pull request Jan 14, 2023
Updated subnets field in Machinepool yaml
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. kind/bug Categorizes issue or PR as related to a bug. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
5 participants