How to Suspend All Kubernetes CronJobs

Problem

CronJobs running on the cluster need to be (temporarily) suspended (such as for a maintenance activity).

Environment

  • Platform9 Managed Kubernetes - All Versions
  • kubectl

Procedure

  1. Export Kubeconfig.
  2. Retrieve a list of all CronJobs across all namespaces and patch their spec.
Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard