title: How to check when "kubectl delete" failed with "timeout waiting for ... to be synced"
body: <p>I have a Kubernetes v1.10.2 cluster and a cronjob on it.
  The job config is set to:</p>
  
  <pre><code>   failedJobsHistoryLimit: 1
    successfulJobsHistoryLimit: 3
  </code></pre>
  
  <p>But it has created more than ten jobs, which are all successful and not removed automatically.
  Now I am trying to delete them manually, with <code>kubectl delete job XXX</code>, but the command timeout as:</p>
  
  <pre><code>$  kubectl delete job XXX
  error: timed out waiting for "XXX" to be synced
  </code></pre>
  
  <p>I want to know how can I check in such a situation. Is there a log file for the command execution?</p>
  
  <p>I only know the <code>kubectl logs</code> command, but it is not for such a situation.</p>
  
  <p>"kubectl get" shows the job has already finished:</p>
  
  <pre><code>status:
    active: 1
    completionTime: 2018-08-27T21:20:21Z
    conditions:
    - lastProbeTime: 2018-08-27T21:20:21Z
      lastTransitionTime: 2018-08-27T21:20:21Z
      status: "True"
      type: Complete
    failed: 3
    startTime: 2018-08-27T01:00:00Z
    succeeded: 1
  </code></pre>
  
  <p>and "kubectl describe" output as:</p>
  
  <pre><code>$ kubectl describe job test-elk-xxx-1535331600 -ntest
  Name:           test-elk-xxx-1535331600
  Namespace:      test
  Selector:       controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
  Labels:         controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
                  job-name=test-elk-xxx-1535331600
  Annotations:    &lt;none&gt;
  Controlled By:  CronJob/test-elk-xxx
  Parallelism:    0
  Completions:    1
  Start Time:     Mon, 27 Aug 2018 01:00:00 +0000
  Pods Statuses:  1 Running / 1 Succeeded / 3 Failed
  Pod Template:
    Labels:  controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
             job-name=test-elk-xxx-1535331600
    Containers:
     xxx:
      Image:      test-elk-xxx:18.03-3
      Port:       &lt;none&gt;
      Host Port:  &lt;none&gt;
      Args:
        --config
        /etc/elasticsearch-xxx/xxx.yml
        /etc/elasticsearch-xxx/actions.yml
      Limits:
        cpu:     100m
        memory:  100Mi
      Requests:
        cpu:        100m
        memory:     100Mi
      Environment:  &lt;none&gt;
      Mounts:
        /etc/elasticsearch-xxx from xxx-configs (ro)
    Volumes:
     xxx-configs:
      Type:      ConfigMap (a volume populated by a ConfigMap)
      Name:      test-elk-xxx
      Optional:  false
  Events:        &lt;none&gt;
  </code></pre>
  
  <p>It indicates still one pod running, but I don't know how to figure out the pod name.</p>