<p>I am trying to use the example cronjob that is explained through Kubernetes documentation <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">here</a>. However, when I check it on <a href="https://k8slens.dev/" rel="nofollow noreferrer">Lens</a> (a tool to display Kubernetes info), I receive an error upon creating a pod. The only difference between the Kubernetes example and my code is I added a namespace since I do not own the server I am working on. Any help is appreciated. Below is my error and yaml file.</p>
<pre><code>Error creating: pods &quot;hello-27928364--1-ftzjb&quot; is forbidden: exceeded quota: test-rq, requested: limits.cpu=16,limits.memory=64Gi,requests.cpu=16,requests.memory=64Gi, used: limits.cpu=1,limits.memory=2G,requests.cpu=1,requests.memory=2G, limited: limits.cpu=12,limits.memory=24Gi,requests.cpu=12,requests.memory=24Gi
</code></pre>
<p>This is my yaml file that I apply.</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
  namespace: test
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
</code></pre>

TheStudentProgrammer
<p>Your namespace seems to have a quota configured. Try to configure the resources on your CronJob, for example:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
  namespace: test
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
              resources:
                requests:
                  memory: &quot;64Mi&quot;
                  cpu: &quot;250m&quot;
                limits:
                  memory: &quot;128Mi&quot;
                  cpu: &quot;500m&quot;
          restartPolicy: OnFailure
</code></pre>
<p>Note the <strong>resources:</strong> and it's indentation.</p>
