<p>I want to create a crone in the cluster which should have access to all of the namespaces, I don't want to configure that job in each and every namespace as I have multiple namespaces. Is this possible?
Edit: I want to run same cronjob in all namespace</p>

<p>You can use helm to achieve this, either <strong>static</strong> namespaces or <strong>dynamic</strong> all namespaces.</p>
<pre><code>{{- range $namespaces := .Values.namespaces }}
apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
  namespace: {{ $namespaces }}
spec:
  schedule: &quot;* * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox:1.28
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
---
{{- end }} 

</code></pre>
<p>and values file</p>
<pre><code>namespaces:
  - namesapce-1
  - namesapce-2
</code></pre>
<p>Dynamic namespaces:</p>
<pre><code>helm install my-cronjob  helm-chart --set &quot;namespaces={$(k get ns | awk 'BEGIN{ORS=&quot;,&quot;} { if (NR&gt;1) print $1}')}&quot;
</code></pre>
<p>A complete working example <a href="https://github.com/adiii717/multi-namespace-deployment" rel="nofollow noreferrer">multi-namespace-deployment</a></p>
