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

(aws-eks) Proxy settings in kubectlEnvironment should be passed onto provider-framework Lambda #12608

Closed
starchx opened this issue Jan 20, 2021 · 3 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p1

Comments

@starchx
Copy link

starchx commented Jan 20, 2021

The Issue (Bug)

Since #10200, for VPC that:

  • requires proxy for all outbound connections
  • has no Lambda VPC endpoint

All kubectl applies are failing, even with proper proxy set in kubectlEnvironment.

framework.onEvent lambda function -- involves --> kubectl lambda function

Since CDK 1.80, framework.onEvent lambda function has been put into VPC: https://github.com/aws/aws-cdk/blob/v1.80.0/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts#L179
and the proxy environments are not added. framework.onEvent lambda function can no longer makes call to Lambda API to invoke function.

Environment

  • CDK CLI Version: N/A
  • Module Version: aws-eks 1.80 onwards
  • Node.js Version: 10.14
  • OS: all
  • Language: TypeScript

Other information

Proposals:
A: Take framework.onEvent lambda function out of VPC (same as 1.79), and only leaves kubectl function inside the VPC.
B: Add proxy (set in kubectlEnvironment) to framework.onEvent lambda function

@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Jan 20, 2021
@iliapolo
Copy link
Contributor

Hi @starchx Thanks for reporting this. We will address it.

In the meanwhile, I can offer the following workaround, to remove the VPC configuration from the framework function:

const providerStack = Stack.of(cluster).node.tryFindChild('@aws-cdk/aws-eks.KubectlProvider') as cdk.NestedStack;
const providerOnEvent = providerStack.node.findAll().filter(c => c.node.id.includes('framework-onEvent'))[0].node.defaultChild as lambda.CfnFunction;
providerOnEvent.addPropertyDeletionOverride('VpcConfig');

@iliapolo iliapolo added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 labels Jan 20, 2021
@iliapolo
Copy link
Contributor

Just for reference, this issue contains information on which VPC endpoints need to exist in order for the framework functions to successfully invoke the handlers.

@iliapolo iliapolo removed their assignment Jun 27, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 28, 2022
@github-actions github-actions bot closed this as completed Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

No branches or pull requests

2 participants