Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# thomas.github.com
# 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 <pod> - <command>` (single dash) | `kubectl exec <pod> -- <command>` (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.