I changed my heapsize in the sas-opendistro custom resource to 3G and the memory requests and limits were changed to 6G, so this calculation appears to be heapsize x role count, as mine is a single-node topology so the node has both master and data roles.
$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"6","memory":"2G"},"requests":{"cpu":"500m","memory":"2G"}}
$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/nodes/0/heapsize","value":"3G"}]'
For CPU, I patched the custom resource path /spec/template/spec/containers/0/resources, and the values I set were what the stateful set had applied.
$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources","value":{"requests":{"cpu":"300m"},"limits":{"cpu":"4"}}}]'
$ k delete sts sas-opendistro-default-0
$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"4","memory":"6G"},"requests":{"cpu":"300m","memory":"6G"}}
--
Greg Wootton | Principal Systems Technical Support Engineer