-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
eksctl does not report error if it can not write kubeconfig file #1402
Comments
And just to add one more detail: When running as subprocess inside AWS Lambda, other binaries can write to /tmp, and only "eksctl" can not. In python I'm executing different commands as:
kubeconfig_file_name = '/tmp/kubeconfig' The following works (both "echo" and simple python script) :
But the eksctl command (binary compiled from Go) can not write to file:
|
The issue with file permission is due to the below line, in which the error is not bubble up to caller Please confirm again you can run above python snippet with /tmp/kubeconfig again, I tried but it is working as expected for me.
|
I can write to /tmp when executing locally on my machine As far as I understand there are 2 issues here:
Or into any other directory where you do not have permission to write.
--- So if the #1 is resolved, then at least we can catch this error inside Lambda.
where eksctlmgr is the lambda I mentioned above. |
Point 2 seems to be related to AWS/SAM local setup or configuration. I don't think there is anything we can do from Might need inputs from others as well. @martina-if @cPu1 |
About Point 2: Yes. it's most likely question to AWS lambda setup. |
@sayboras One more update: --- I added infinite loop inside Lambda handler function and executed locally using sam:
Then logged into container
and did the following:
As you can see: :-) Now the question is "What is so special about system calls which eksctl uses to write to a file? And: I'm continuing to work with AWS support. |
One more fact, which might help to identify potential issue in eksctl: --- Inside Lambda using default file name for kubeconfig works !!! if set $HOME to /tmp:
|
the PR #1406 has been merged, it will not fix issue with /tmp permission. However, can you help to take latest eksctl from master and try to run again ? Just want to see the actually error message. |
What happened?
I launched "eksctl utils write-kubeconfig ...." in a subprocess of an automation script while that subprocess did not have permissions to write to filesystem.
Instead of reporting an error, the output of the command was:
[ℹ] using region us-west-2
[✔] saved kubeconfig as ""
Note: it just showed the filename as blank. so my first thought was that I did not pass "--kubeconfig" parameter correctly.
What you expected to happen?
I would expect that eksctl report an error instead of ( [✔] saved kubeconfig as "" )
Something like ( [✖] Permission denied. Could not write to file "provided_path_to_kubeconfig")
How to reproduce it?
It can be reproduces if one tries to write kubeconfig in a directory where user does not have write permissions. Actual problem was in Linux, but it's the same in Mac OS X
--- the following works fine:
--- the following does not work:
Anything else we need to know?
I'm using eksctl inside the AWS Lambda and I'm using downloaded binary.
Lambda is assuming an appropriate IAM role which has "eks:*" in it's policy,
So "eksctl cluster create ...." works fine.
Versions
Please paste in the output of these commands:
Logs
Include the output of the command line when running eksctl. If possible, eksctl should be run with debug logs.
The text was updated successfully, but these errors were encountered: