A few helper scripts are available in ${baseDir}/cluster/k8s/localdev/ to assist with debugging pods.
These scripts assume:
- The entire cluster is running locally
- Only a single pod replica per controller
- Containers inside of controlled pods must have a name that matches the pod's template
- For example, if RC creates pods that named clowder-clowder-HASH, the scripts can only attempt to read the clowder-clowder container within this pod.
env.sh
A naive script to save some typing whilst debugging service/pod linkage, this script will print any environment variables present in the target container.
Example usage:
. env.sh clowder-clowder
The above command will locate the clowder-clowder-* pod and, assuming there is only one, print out the environment variable's from the clowder-clowder container within the pod.
exec.sh
A naive script to save some typing whilst debugging service/pods in general, this script will execute an arbitrary command in the target container.
Example usage:
. exec.sh clowder-clowder "curl -L localhost:9000"
The above command will locate the clowder-clowder-* pod and, assuming there is only one, will execute the given command inside of the clowder-clowder container within the pod.
logs.sh
A naive script to save some typing whilst debugging service/pods in general, this script will display the logs from the target container
Example usage:
. logs.sh clowder-clowder
The above command will locate the clowder-clowder-* pod and, assuming there is only one, will print out the logs of the clowder-clowder container within the pod.