     (merge pod-labels-defaults
            pod-labels-from-job-labels
            pod-labels-from-job-application)))
+
+(defn set-mem-cpu-resources
+  "Given a resources object and a CPU and memory request and limit, update the resources object to reflect the
+  desired requests and limits."
+  [^V1ResourceRequirements resources memory-request memory-limit cpu-request cpu-limit]
+  (let [{:keys [set-container-cpu-limit?]} (config/kubernetes)]
+    (.putRequestsItem resources "memory" (double->quantity (* memory-multiplier memory-request)))
+    (.putLimitsItem resources "memory" (double->quantity (* memory-multiplier memory-limit)))
+    (.putRequestsItem resources "cpu" (double->quantity cpu-request))
+    (when set-container-cpu-limit?
+      ; Some environments may need pods to run in the "Guaranteed"
+      ; QoS, which requires limits for both memory and cpu
+      (.putLimitsItem resources "cpu" (double->quantity cpu-limit)))))
 
 (defn ^V1Pod task-metadata->pod
   "Given a task-request and other data generate the kubernetes V1Pod to launch that task."

            (.setReadinessProbe container readiness-probe)))

          ; resources
          (.putRequestsItem resources "cpu" (double->quantity cpu-request))
          (when set-container-cpu-limit?
            (.putLimitsItem resources "cpu" (double->quantity cpu-limit)))
          (.putRequestsItem resources "memory" (double->quantity (* memory-multiplier memory-request)))
          (.putLimitsItem resources "memory" (double->quantity (* memory-multiplier memory-limit)))
          (.setResources container resources)

          (.setVolumeMounts container [(sandbox-volume-mount-fn true) (sidecar-workdir-volume-mount-fn false)])

    ; init container
    (when use-cook-init?
      (when-let [{:keys [command image]} init-container]
        (let [container (V1Container.)
              get-resource-requirements-fn (fn [fieldname] (if use-cook-sidecar?
                                                             (get-in sidecar [:resource-requirements fieldname])
                                                             0))
              total-memory-request (add-as-decimals computed-mem (get-resource-requirements-fn :memory-request))
              total-memory-limit (add-as-decimals computed-mem (get-resource-requirements-fn :memory-limit))
              total-cpu-request (add-as-decimals cpus (get-resource-requirements-fn :cpu-request))
              total-cpu-limit (add-as-decimals cpus (get-resource-requirements-fn :cpu-limit))
              resources (V1ResourceRequirements.)]
          ; container
          (.setName container cook-init-container-name)
          (.setImage container image)
