Helm Yaml configuration

1/14/2022

I have a problem. I have a json as below.

 "IpRateLimiting": {
    "EnableEndpointRateLimiting": true,
    "StackBlockedRequests": false,
    "HttpStatusCode": 429,
    "GeneralRules": [
      {
        "Endpoint": "*",
        "Period": "60s",
        "Limit": "2"
      }
    ]
  }

and I have a helm values.yaml as below.

    IPRATELIMITING_ENABLEENDPOINTRATELIMITING: "true"
    IPRATELIMITING_STACKBLOCKEDREQUESTS: "false"
    IPRATELIMITING_HTTPSTATUSCODE: "429"
    IPRATELIMITING_GENERALRULES:
    - ENDPOINT: "*"
      PERIOD: "61s"
      LIMIT: "2"

and I have a helm config.yaml as below.

  IPRATELIMITING__ENABLEENDPOINTRATELIMITING: {{ .Values.configMap.data.IPRATELIMITING_ENABLEENDPOINTRATELIMITING | quote }}
  IPRATELIMITING__STACKBLOCKEDREQUESTS: {{ .Values.configMap.data.IPRATELIMITING_STACKBLOCKEDREQUESTS | quote }}
  IPRATELIMITING__HTTPSTATUSCODE: {{ .Values.configMap.data.IPRATELIMITING_HTTPSTATUSCODE | quote }}
  IPRATELIMITING__GENERALRULES: {{ .Values.configMap.data.IPRATELIMITING_GENERALRULES | quote }}

I can't read GeneralRules (json array) values from here. How can I modify my helm config?

-- Oğuzhan KAYA
asp.net-core
helm3
json
kubernetes
yaml

0 Answers