Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to specify resources for init container #125

Closed
adam8797 opened this issue Jun 29, 2023 · 0 comments · Fixed by #128 or #129
Closed

Add an option to specify resources for init container #125

adam8797 opened this issue Jun 29, 2023 · 0 comments · Fixed by #128 or #129

Comments

@adam8797
Copy link
Contributor

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:https://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:https://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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant