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

fix: Pass security groups and subnets into RunInstances dry-run #7844

Conversation

jonathan-innis
Copy link
Contributor

@jonathan-innis jonathan-innis commented Mar 5, 2025

Fixes #7834

Description

Ensure that we model our RunInstances request to look like the launch template that we use for launch with CreateFleet. If we don't specify any details about subnet or security group, EC2 will attempt to validate with the user's default VPC -- if the user doesn't have a default VPC, the request will fail (even if the EKS cluster and subnets that they were attempting to launch into weren't associated with the default VPC)

How was this change tested?

make presubmit
/karpenter snapshot

We deleted the default VPCs from regions in our CI accounts -- this ensures that we are testing the bug that happened here. If tests succeed, that's an indication that this is no longer an issue

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jonathan-innis jonathan-innis requested a review from a team as a code owner March 5, 2025 16:48
@jonathan-innis jonathan-innis requested a review from tzneal March 5, 2025 16:48
@jonathan-innis jonathan-innis marked this pull request as draft March 5, 2025 16:48
Copy link

netlify bot commented Mar 5, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit bb6ed2f
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67c890f980b65f0008b87eb1

Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-547ac700b66303c5a4314aacbfb32e93dd37bd17.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-547ac700b66303c5a4314aacbfb32e93dd37bd17" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

@coveralls
Copy link

coveralls commented Mar 5, 2025

Pull Request Test Coverage Report for Build 13682414938

Details

  • 19 of 25 (76.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 67.137%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/nodeclass/validation.go 19 25 76.0%
Totals Coverage Status
Change from base Build 13669133528: 0.006%
Covered Lines: 6760
Relevant Lines: 10069

💛 - Coveralls

@jonathan-innis jonathan-innis force-pushed the pass-subnets-security-groups-validation branch from 547ac70 to abd16f6 Compare March 5, 2025 17:12
Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@jonathan-innis jonathan-innis force-pushed the pass-subnets-security-groups-validation branch from abd16f6 to 4d18b4a Compare March 5, 2025 17:34
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-abd16f6d694561be449a575fd7fd4f1cc292ce98.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-abd16f6d694561be449a575fd7fd4f1cc292ce98" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-4d18b4a4b9236a2fec7c25e92b20d6754dc65900.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-4d18b4a4b9236a2fec7c25e92b20d6754dc65900" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

@jonathan-innis jonathan-innis force-pushed the pass-subnets-security-groups-validation branch 4 times, most recently from 8d0c188 to 7d40d91 Compare March 5, 2025 17:55
@jonathan-innis jonathan-innis marked this pull request as ready for review March 5, 2025 17:56
Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@jonathan-innis jonathan-innis force-pushed the pass-subnets-security-groups-validation branch from 7d40d91 to e2414b8 Compare March 5, 2025 17:58
Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@jonathan-innis jonathan-innis force-pushed the pass-subnets-security-groups-validation branch from e2414b8 to bb6ed2f Compare March 5, 2025 17:59
Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-7d40d9121b2d7fb86761f79bd8945d71031464b2.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-7d40d9121b2d7fb86761f79bd8945d71031464b2" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-bb6ed2f69a14af8fe10bb1b2a84332645d395e3f.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-bb6ed2f69a14af8fe10bb1b2a84332645d395e3f" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Contributor

@jigisha620 jigisha620 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jonathan-innis jonathan-innis merged commit dd9dc93 into aws:main Mar 5, 2025
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api error VPCIdNotSpecified: No default VPC for this user
5 participants