-
Notifications
You must be signed in to change notification settings - Fork 4k
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] k8s resources cannot be updated with EndpointAccess.PRIVATE. #10036
Comments
Hi @chiyiliao - Thanks for reaching out, unfortunately I am unable to reproduce this. You mentioned:
Are you sure the lambda isn't connected to the VPC? We have added explicit logic to connect the handler to the VPC in case Also, if indeed the handler wasn't connected and couldn't access the cluster endpoint, your initial deployment should have failed as well with a timeout error, as well as any additional ones. Can you share exactly how are you running Could you please attach the handler logs? You can find them if you navigate to the lambda with a description of Thanks! |
I might confused some steps and cdk versions during my testing. Failed to create resource. Error: Command '['aws', 'eks', 'update-kubeconfig', '--role-arn', 'arn:aws:iam::xxxxxxxxxxxxxxx:role/test-eks', '--name', 'test-eks', '--kubeconfig', '/tmp/kubeconfig']' returned non-zero exit status 255. Logs: /aws/lambda/test-eks-awscdkawseksKubectlPr-Handler886CB40B-23193CKFEATKS at invokeUserFunction (/var/task/framework.js:95:19) at process._tickCallback (internal/process/next_tick.js:68:7) I made an another testing. 9:43:45 | UPDATE_FAILED | Custom::AWSCDK-EKS-KubernetesResource | test-eks...g/Resource/Default There is no NAT in the VPC environment, so lambda function cannot connect to internet IP, is this limitation cause the problem? |
@chiyiliao Just to make I understand, you saying that:
Is that correct? |
My scenario is as below:
|
@chiyiliao This definitely seems to be related to the fact that your VPC doesn't have a NAT since the However that doesn't explain how this works when you use Is your VPC created with CDK? mind sharing the code you use to create it? are you using a VpcEndpoint? |
No, my VPC was not created by CDK. |
Hi, I am having weird behavior as well; but reading the comment above... is it mandatory to have a NAT? Cheers, |
To those interested in this issue, please have a look at this issue i've created that explains about the internet requirements of the cluster VPC. If needed, lets continue the discussion over there. This issue will be closed soon. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
More detailed description of the issue. It's not possible to define kubectl subnets and security group directly in eks constructor. However, custom resource lambda function requires the subnets and security group:
Solution. Kubectl subnets and security group can be defined using
|
k8s resources create by add_manifest() was not updated after CDK code updated.
It only occurred when EndpointAccess set to PRIVATE.
Reproduction Steps
Create cluster as below first (VPC without NAT):
Deploy it
Modify add_manifest to below (just remove "delete" verbs from rules):
Deploy it
What did you expect to happen?
"kubectl get ClusterRole test-role -o yaml" command should return verbs without "delete"
What actually happened?
"kubectl get ClusterRole test-role -o yaml" command return verbs with "delete"
But "delete" does not exist in cloudformation, it seems like cloudformation updated successful, but the action of kubectl was not successful.
Environment
Other
It seems like lambda function xxxxxxx-awscdkawseksKubectlPr-Handlerxxxxxxx do not run in VPC environment,
cause the lambda function could not connect to API server endpoint.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: