<p>I'd like to create a Job to kill the following pod every single minute or any time when is created.</p>

<p>My testing pod is:</p>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
    containers: 
    -   name: myapp-container
        image: busybox
        command: ['sh', '-c', 'echo Hello &amp;&amp; sleep 3600']
</code></pre>

<p>Is it possible to do that?</p>

Nembone
<p>Yes, you can delete the pods with kubectl within the cluster.
First, you need to create a set of RBAC(Role-based access control) object.
Here is the sample.</p>

<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  name: test # this is service account for binding the pod
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: test # This defines a role and what API it can access
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["delete", "get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: test # This will bind the role and service account
subjects:
- kind: ServiceAccount
  name: test
roleRef:
  kind: Role 
  name: test 
  apiGroup: rbac.authorization.k8s.io
</code></pre>

<p>These objects will define a proper RABC rule so that the pod created can interact with Kubernetes's corresponding API.
Then, you can define your Job with a Cronjob type like this.</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: kill-pod
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: test
          containers:
          - name: kill-pod
            image: bitnami/kubectl:latest
            command:
            - kubectl
            args:
            - delete
            - pod
            - sth
          restartPolicy: OnFailure
</code></pre>
