<p>I created a CronJob resource with</p>

<pre><code>kubectl create -f cronjob.yaml
</code></pre>

<p>Now I have too much mess on my comp,cronjob attempts to create one node every </p>

<pre><code>15 minutes
batch-job-every-fifteen-minutes-1528876800-h8dsj   0/1       Pending              0          39m
batch-job-every-fifteen-minutes-1528877700-d8g9d   0/1       Pending              0          24m
batch-job-every-fifteen-minutes-1528878600-kbdmb   0/1       Pending              0          9m
</code></pre>

<p>How to perform the opposite operation?
How to delete the resource? </p>

Richard Rublev
<p>You can delete it with this command:</p>

<pre><code>kubectl delete -f cronjob.yaml
</code></pre>

<p>It is also possible to delete it directly by name:</p>

<pre><code>kubectl delete cronjob batch-job-every-fifteen-minutes
</code></pre>

<p>I am not sure whether the generated Pods and Jobs also get deleted with this command. You can delete them like this:</p>

<pre><code>kubectl delete job batch-job-every-fifteen-minutes-1528876800
kubectl delete job batch-job-every-fifteen-minutes-1528877700
kubectl delete job batch-job-every-fifteen-minutes-1528878600

kubectl delete pod batch-job-every-fifteen-minutes-1528876800-h8dsj
kubectl delete pod batch-job-every-fifteen-minutes-1528877700-d8g9d
kubectl delete pod batch-job-every-fifteen-minutes-1528878600-kbdmb
</code></pre>

<p>This solution assumes you are using the <code>default</code> namespace. If you do not, you have to add the <code>--namespace $NAMESPACE</code> argument to <code>kubectl</code>.</p>
