metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.6k stars 100 forks source link

Plugin Mirrord on Intellij IDEA cannot auth eks cluster #2465

Open fabianolemos-pp opened 1 month ago

fabianolemos-pp commented 1 month ago

Bug Description

I'm trying to use Mirrord to mirror a demo application for testing on IntelliJ using this plugin , but on starting the application, I get the message:

Failed to create Kubernetes API. KubeError( Auth( AuthExecRun { cmd: "AWS_PROFILE=\"**************\" KUBERNETES_EXEC_INFO=\"{\\\"kind\\\":\\\"ExecCredential\\\",\\\"apiVersion\\\":\\\"client.authentication.k8s.io/v1beta1\\\",\\\"spec\\\":{\\\"interactive\\\":true}}\" \"aws\" \"--region\" \"us-east-1\" \"eks\" \"get-token\" \"--cluster-name\" \"*********\" \"--output\" \"json\"", status: ExitStatus( unix_wait_status( 65280, ), ), out: Output { status: ExitStatus( unix_wait_status( 65280, ), ), stdout: "", stderr: "\n[Errno 2] No such file or directory: '/var/run/secrets/eks.amazonaws.com/serviceaccount/token'\n", }, }, ), )

The cluster is on AWS using the EKS service, and my access is only through aws update-kubeconfig.

Using the command line directly works fine.

Steps to Reproduce

  1. Install plugin available on https://plugins.jetbrains.com/plugin/19772-mirrord/versions/stable
  2. Config mirrord.json, according you enviroment
  3. Try to start the springboot application;

Backtrace

No response

Relevant Logs

No response

Your operating system and version

Linux

Local process

mvn spring-boot run

Local process version

No response

Additional Info

No response

aviramha commented 1 month ago

Hi, This kind of issue (where Kube auth fails on IDE but succeeds on CLI) is often because of environment variables difference between terminal and IDE. Can you check your run configuration if you have any AWS env variable set? if not, please create an app that only prints the environment variables - run it via terminal and via IDE and see what's the difference. (without mirrord) - there's probably some AWS env that should be in IDE or shouldn't be..

aviramha commented 1 month ago

Hi, Any update on this?