-
Notifications
You must be signed in to change notification settings - Fork 1.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
Flux v2 support does not work on Windows #3445
Comments
Thanks for reporting this @wat-usmdon , and for providing lots of detail 😄 . Flux v2 support is still experimental and we are glad to see someone is attempting to use it: we weren't really sure before 😅 . We will look into this issue asap and hopefully come up with a resolution quickly. |
If I'm setting up a new cluster today should I still be using Flux v1 despite #2963? |
So Flux v2 itself is not experimental. All eksctl is doing is using config to run the new flux for you after your cluster is ready. You therefore have the option to do something like:
with each command separately which is 100% the same thing as what eksctl is doing (just not with a handy 2-in-1 config). |
I would definitely recommend switching to Flux 2 if the option to run separate commands is possible. |
This fixes it for me diff --git a/pkg/executor/executor.go b/pkg/executor/executor.go
index 7a7fec10..1945bda2 100644
--- a/pkg/executor/executor.go
+++ b/pkg/executor/executor.go
@@ -45,6 +45,7 @@ func (e ShellExecutor) ExecInDir(command string, dir string, args ...string) err
func (e ShellExecutor) buildCmd(command string, args ...string) *exec.Cmd {
cmd := exec.Command(command, args...)
+ cmd.Env = os.Environ()
for k, v := range e.envVars {
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", k, v))
} I'll probably use the separate commands for now anyway. |
Cool, and thanks for the fix tip 😄 |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Same issue for me, solving that by running flux bootstrap manually after cluster is provisioned, but it would be really nice to make it work through eksctl. |
What were you trying to accomplish?
I'm trying to deploy an EKS cluster with Flux v2 from a Windows environment.
What happened?
Cluster creation works fine, but whenever it gets to the part where Flux is installed or whenever I run
eksctl enable flux
I get an error about needing to runaws configure
.This happens only with eksctl. If I run
flux check --pre
directly I pass all prerequisite checks.How to reproduce it?
You should be able to reproduce this with any configuration for Flux v2 as long as you are on Windows because it doesn't actually get to the part where it tries to apply the configuration. The examples should be fine. I don't have anything special in my config except my private repository info.
Logs
Anything else we need to know?
eksctl 0.40.0 downloaded by Scoop on Windows 10. AWS credentials are a token saved in ~/.aws/credentials.
Versions
Apparent cause
I can see that eksctl is launching flux which is launching kubectl which is launching
aws eks get-token
. Running any of these commands without eksctl works perfectly.If I have procmon running when I run these commands I can see that
aws eks get-token
is invoked with a very different environment when launched from eksctl. Specifically, the successful invocations have all my normal environment variables but the unsuccessful notifications only haveGITHUB_TOKEN
(blank)PATH
HOME
AWS_ACCESS_KEY_ID
(blank)AWS_SECRET_ACCESS_KEY
(also blank)SYSTEMROOT
AWS_STS_REGIONAL_ENDPOINTS
KUBERNETES_EXEC_INFO
. If I start removing variables from my shell and runningaws eks get-token
myself, I start getting the same behavior as eksctl after deleting the variableHOMEPATH
. I guess Python uses this variable for finding ~/.aws.In executor.go there is code that creates a command and copies environment variables into it, but only the specified environment variables are copied. Looking at the Go documentation apparently what this means is that if executor.go wants to pass any environment variables to a child process than those environment variables become the only environment variables passed to the child process (except
SYSTEMROOT
). I think this code needs to start by populating the child process environment with the current process environment first. On Linux, Python must be locating the home directory by reading /etc/passwd or something, at least as a fallback.The text was updated successfully, but these errors were encountered: