Managing Pods
Kubernetes Commands
Access inside a pod kubectl exec -ti <pod_name> -n <namespace_name> -- /bin/bash Find and stop p...
Add a New CronJob
Option 1: Create a CronJob Using a YAML Manifest 1. Create a new cronjob.yaml file: apiVersion: b...
Managing CronJobs List
List all CronJobs in the current namespace: kubectl get cronjobs This will display a list of a...
Deleting Log Files inside other Pods Using CronJob
apiVersion: batch/v1 kind: CronJob metadata: name: delete-server-log namespace: <namespace> s...
Bash Script to Delete Log Files Inside Pods Based on Retention Days
#!/bin/bash # Retention days for log files (delete files older than this many days) RETENTION_DA...
Bash Script to Delete Log Files Inside Pods Based on Retention Days with Different Target Folders
#!/bin/bash # Retention days for log files (delete files older than this many days) RETENTION_DA...
Fix Error Agent Unavailable on Rancher
Find agent pod for Rancher kubectl get pods -n cattle-system Show error logs kubectl logs -n cat...