apache / couchdb-helm

Apache CouchDB Helm Chart
https://couchdb.apache.org/
Apache License 2.0
49 stars 64 forks source link

Add an option to specify resources for init container #125

Closed adam8797 closed 1 year ago

adam8797 commented 1 year ago

Hey all,

I would like to see the ability to specify requests/limits on the statefulset init container(s).

Is your feature request related to a problem? Please describe. We have some restrictions in our cluster where all pods must define their requests and limits. We've had to introduce a LimitRange with default values just for this helm chart. I believe this option should be in the chart itself.

Describe the solution you'd like In the values file, I would like to provide the following:

...

## Optional resource requests and limits for the CouchDB container
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
resources: {}
  # requests:
  #  cpu: 100m
  #  memory: 128Mi
  # limits:
  #  cpu: 56
  #  memory: 256Gi

## Optional resource requests and limits for the Initialization Container for CouchDB
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
initResources: {}
  # requests:
  #  cpu: 100m
  #  memory: 128Mi
  # limits:
  #  cpu: 56
  #  memory: 256Gi

...

Describe alternatives you've considered There is no way to directly specify the resources that an initcontainer should consume. You have to create a LimitRange object similar to this:

apiVersion: v1
kind: LimitRange
metadata:
    name: mem-range
spec:
  limits:
    - type: Container
      default:
        cpu: '1'
        memory: 512Mi
      defaultRequest:
        cpu: '1'
        memory: 512Mi

But this is now a namespace wide default