0

I have a helm chart and values file.

part of helm chart:
    - name: RAM
      value: "{{ .Values.resources.requests.memory | trimSuffix "Mi" }}"

here, how can i make it such that if I have values in Mi or Gi, both should get stripped. Also, if its Gi, appropriately convert that Gi(meaning GB's) .. multiply the value by 1000.

rawwar
  • 4,834
  • 9
  • 32
  • 57
  • 1
    Helm doesn't have any built-in support for parsing Kubernetes resource units. You can look for a `Mi` string suffix, but in the general case this is a tricky problem to solve in Helm. Can the program figure out its own memory limits, maybe by looking at the Linux cgroups subsystem, without an explicit environment-variable setting? – David Maze Nov 30 '22 at 02:02
  • So, alternative is to use %cpu. i think, that is easier than this? what do you say @DavidMaze – rawwar Nov 30 '22 at 16:06

0 Answers0