-
My pod environment variables are configured using configMapRef and secretRef.
Then I run mirrord cli however there are no environment variables in the local process.
How should I configure remote configMapRef/secretRef environment variables to the local process? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 17 replies
-
Hi @kyfk thanks for reaching out. It is quite weird that you are facing this issue, as it seems to work just fine for me. I use the following yaml files:
pod yaml:
taken directly from this simple example to test your problem: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ package main
import (
"fmt"
"os"
)
func main() {
envVariables := os.Environ()
fmt.Println("Environment Variables:")
for _, envVar := range envVariables {
fmt.Println(envVar)
}
} My command line:
seems to have all the env as I specify in configMap. testing in a different namespace also works fine:
Now somethings that we should look at in your case would be:
Sorry for the troubles, hope we can get your thing working asap. |
Beta Was this translation helpful? Give feedback.
@kyfk I'm pretty sure the issue is that mirrord chooses first container if not explicitly specified (while it ignores mesh containers by default).
You can choose the
game-server
container, which I think is your desired target like this:mirrord exec -c --target-namespace abc --target pod/abc-ns8wq-xkptj/container/game-server go run cmd/abc/main.go