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

[release-2.4] 🐛 ec2: instances: fix assigning public IP #4908

Conversation

k8s-infra-cherrypick-robot

This is an automated cherry-pick of #4892

/assign richardcase

Fix machines getting a public IP even when user-supplied subnets don't have MapPublicIpOnLaunch.

r4f4 added 3 commits April 4, 2024 15:17
It's not enough to check MapPublicIPOnLaunch since public subnets can
have that off.
In the scenario where the user brings their own VPC, if no subnet ID is
set in the machine spec and PublicIP is true, CAPA will choose one from
the available public subnets. However, if the subnet doesn't have
MapPublicIPOnLaunch == true, the instance will not be assigned a public
IP. As a result, the instance will have no internet access, contrary to
the user's expectation.

This change guarantees an instance will be assigned a public IP even if
the subnet doesn't do it on instance launch. Instead, we set the option
in the instance's network interface.
The tests check that a NetworkInterface is defined with
`AssociatePublicIpAddress` in the `RunInstances` input.
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 4, 2024
@k8s-ci-robot k8s-ci-robot requested review from faiq and vincepri April 4, 2024 15:17
@k8s-ci-robot k8s-ci-robot added needs-priority size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 4, 2024
@Ankitasw
Copy link
Member

Ankitasw commented Apr 5, 2024

/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 Apr 5, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitasw

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 5, 2024
@Ankitasw Ankitasw added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 5, 2024
@k8s-ci-robot k8s-ci-robot merged commit 64b1546 into kubernetes-sigs:release-2.4 Apr 5, 2024
15 checks passed
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. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants