<p>Say that I have a job history limit &gt; 1, is there a way to use kubectl to find which jobs that have been spawned by a CronJob?</p>

Anders Strömberg
<p>Use label.</p>
<pre><code>$kubectl get jobs -n namespace -l created-by=cronjob
</code></pre>
<p><strong>created-by=cronjob</strong> which define at your cronjob.</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;* * * * *&quot;
  jobTemplate:
    metadata:
      labels:
        created-by: cronjob
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>
