When a container in a pod tries to use memory that exceeds its limit, the container fails with an OOMKilled (Out of Memory Killed) error.
This SAS KB article explains how to increase the pod's memory limit and circumvent the error.
For additional information, see Increase the Memory Limit for a Pod.
To circumvent this error, two workarounds are available: a temporary resolution and a permanent fix.
1. Confirm that the pod fails with an OOMKilled error. See the Container section in the "kubectl describe" output of the pod.
Here is an example:
$ kubectl describe pod sas-pod-name
Containers:
sas-container-name:
Container ID: containerd://container-id
Image: cr.sas.com/viya-4-x64_oci_linux_2-docker/sas-image-name
Image ID: cr.sas.com/viya-4-x64_oci_linux_2-docker/sas-image-id
Port: port-number/TCP
Host Port: 0/TCP
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: OOMKilled
2. Retrieve the current memory limit setting.
1. After you locate the object_type and resource_name from the steps in the previous section, add a PatchTransformer in kustomize.yaml.
Here is an example for the sas-identities deployment:
apiVersion: builtin
kind: PatchTransformer
metadata:
name: patch-identities-mem
patch: |-
- op: replace
path: /spec/template/spec/containers/0/resources/limits/memory
value: 2Gi
target:
kind: Deployment
name: sas-identities
2. Save the PatchTransformer in your deployment directory as a yaml file and add the path in the transformers block or kustomize.yaml.