I've configured a CronJob with a YAML file (apiVersion: batch/v1beta1) with resource requests and limits, the pod is successfully instantiated and works till its natural end, but when terminates I saw it marked as OOMKilled.
My pod is working with a Docker container, which is started with a bash script that invokes some Java tools (like maven). I tried to setup a MAVEN_OPTS and JAVAOPTS like this:
env:
- name: JAVA_OPTS
value: "-Xms256M -Xmx1280M"
- name: MAVEN_OPTS
value: "-Xms256M -Xmx1280M"
That are values lower than the ones of the configured limit in the YAML.
I'd expected that the pod stops in complete status as the last echo of my ENTRY_POINT bash script is shown in the log of the pod but I get the OOMKilled.