stackstorm-k8s
stackstorm-k8s copied to clipboard
Allow setting requests/limits on init containers
I'm trying to deploy stackstorm-k8s into an environment that enforces resourcequota requiring limits to be defined to all containers and init containers. This environment does not provide a limit range or default namespace limits. It would be very helpful to be able to define resources and limits of the individual init containers or have a default values/limits set for them.
You can refer to st2web for other component configurations in values.yaml
st2web:
# Minimum 2 replicas are recommended to run st2web in HA mode
replicas: 2
# Tested resource consumption based on multiple requests to st2web within nginx
# Please adjust based on your conscious choice
resources:
requests:
memory: "25Mi"
cpu: "50m"
limits:
memory: "100Mi"
PR welcome. You'll need to add the resources section to each of the init containers. I count 13 init containers defined in:
templates/deployments.yaml- st2auth >
generate-htpasswd: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/deployments.yaml#L49 - st2sensorcontainer >
init-config: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/deployments.yaml#L1177 - st2client >
generate-st2client-config: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/deployments.yaml#L1619
- st2auth >
templates/jobs.yaml- job-st2-apikey-load >
wait-for-api: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/jobs.yaml#L136 - job-st2-apikey-load >
generate-st2client-config: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/jobs.yaml#L150 - job-st2-key-load >
generate-st2client-config: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/jobs.yaml#L276 - job-st2-register-content >
st2-register-content-custom-init: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/jobs.yaml#L412 - extra_hooks job >
generate-st2client-config: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/jobs.yaml#L645
- job-st2-apikey-load >
templates/_helpers.tpl, specifically the templates:stackstorm-ha.init-containers-wait-for-dbwait-for-db: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/_helpers.tpl#L197
stackstorm-ha.init-containers-wait-for-mqwait-for-queue: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/_helpers.tpl#L218
stackstorm-ha.packs-initContainers(there are 3 init containers in this template)st2-custom-pack: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/_helpers.tpl#L335st2-system-packs: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/_helpers.tpl#L357st2-pack-configs-from-helm: https://github.com/StackStorm/stackstorm-k8s/blob/master/templates/_helpers.tpl#L378
These are all pretty basic utility containers that do not need many resources. Is there a default we could put here? Or perhaps add a value like utilityResources (we have image.utilityImage to set the image, though we should not put resources under image)?