-
Notifications
You must be signed in to change notification settings - Fork 2
Monitoring pod activity in Kubernetes
paulalbert1 edited this page Apr 10, 2023
·
4 revisions
Monitoring pods in a Kubernetes environment can be tedious because new pods are routinely created and the names are unpredictable.
CloudWatch and the Kubernetes UI are always options, but they have certain drawbacks.
Here are some scripts for monitoring the activity of pods associated with a cron job and a deployment from the command line.
Install kubectl
and configure it to work with your Kubernetes instance.
- Download this script.
- Update privileges:
chmod +x streamLogsCronJob.sh
. - Update file with correct
CRONJOB_NAME
andNAMESPACE
. - Execute:
./streamLogsCronJob.sh
- Download this script.
- Update privileges:
chmod +x streamLogsDeployment.sh
. - Update file with correct
DEPLOYMENT_NAME
andNAMESPACE
. - Execute:
./streamLogsDeployment.sh