<p>I am using jsonnet to describe deployment configuration for Kubernetes.</p>

<pre><code>{
  apiVersion: 'apps/v1',
  kind: 'Deployment',
  metadata: {
    name: 'dapi-test-pod',
  },
  spec: {
    selector: {
      matchLabels: {
        app: 'dapi-test-pod',
      },
    },
    template: {
      metadata: {
        labels: {
          app: 'dapi-test-pod',
        },
      },
      spec: {
        containers: [
          {
            name: 'test-container',
            image: 'library/nginx',
          },
        ]
      },
    },
  },
}
</code></pre>

<p>Create deployment using kubecfg:</p>

<pre><code>kubecfg show k8s/deployment.jsonnet | kubectl apply -f -
</code></pre>

<p>Everything is going well, but is there any great way to delete deployment using <code>kubecfg</code> and <code>jsonnet</code> file.</p>

<p>I reproduced your scenario on my cluster and basically the same logic will works for deleting it. </p>

<pre><code>kubecfg show k8s/deployment.jsonnet | kubectl delete -f -
</code></pre>

<p>This command will delete everything described in the manifest. </p>

<p>Or you can just delete using bare kubectl:</p>

<pre><code>kubectl delete deployment dapi-test-pod
</code></pre>
