     (.setTty container true)
     (.setStdin container true)
 
-    (.putRequestsItem resources "memory" (double->quantity (* memory-multiplier computed-mem)))
-    (.putLimitsItem resources "memory" (double->quantity (* memory-multiplier computed-mem)))
-    (.putRequestsItem resources "cpu" (double->quantity cpus))
-    (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 cpus)))
+    (set-mem-cpu-resources resources computed-mem computed-mem cpus cpus)
+
     (when (pos? gpus)
       (.putLimitsItem resources "nvidia.com/gpu" (double->quantity gpus))
       (.putRequestsItem resources "nvidia.com/gpu" (double->quantity gpus))

    (merge pod-labels-defaults
           pod-labels-from-job-labels
           pod-labels-from-job-application)))

(defn ^V1Pod task-metadata->pod
  "Given a task-request and other data generate the kubernetes V1Pod to launch that task."

    ; 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)
