From 3c8609ea631066c78ef08f57ff0458f492bb0dd2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:09:46 +0000 Subject: [PATCH 1/2] Initial plan From b3e222378b4010d116e9fdcf4785eb07a67c3d05 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:12:07 +0000 Subject: [PATCH 2/2] Fix kubectl exec command syntax: use -- separator and grep instead of Select-String Co-authored-by: Thomas1782k <66938593+Thomas1782k@users.noreply.github.com> --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e16bef..db37057 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -# thomas.github.com \ No newline at end of file +# thomas.github.com + +## Kubernetes Debugging + +### Checking environment variables in a pod + +To inspect environment variables (e.g., database/datasource settings) in a running container, use the correct `kubectl exec` syntax with `--` to separate the pod name from the command: + +```bash +kubectl exec -n contentautomation contentautomation-appmanager-557994955f-5x254 -- printenv | grep -E "DB|POSTGRES|JDBC|SPRING_DATASOURCE" +``` + +**Common mistakes to avoid:** + +| Incorrect | Correct | +|-----------|---------| +| `kubectl exec - ` (single dash) | `kubectl exec -- ` (double dash) | +| `Select-String` (PowerShell only) | `grep -E` (Linux/bash) | + +The single `-` causes the error `exec: "-": executable file not found in $PATH` because kubectl tries to execute `-` as a command inside the container instead of treating it as the argument separator.