How do I use json variables in a yaml file (Helm)

后端 未结 1 1907
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 23:43

I have a HELM values file which looks like so:

service:
  environment: dev
  spring_application_json: >-
    {
      \"spring\" : {
        \"boot\" : {
          


        
1条回答
  •  有刺的猬
    2021-01-05 00:06

    There's an example a bit like this in the docs for spring cloud dataflow but the format in their documentation has the quotes escaped.

    I was able to recreate the error and get past it by changing the values file entry to:

    service:
      spring_application_json:
        {
          "spring" : {
            "boot" : {
              "admin" : {
                "client" : {
                  "enabled" : "false",
                  "url" : "http://website1",
                  "instance" : {
                    "service-base-url" : "http://website2",
                    "management-base-url" : "http://website3"
                  }
                }
              }
            }
          }
        }
    

    And the deployment entry to:

        - name: SPRING_APPLICATION_JSON
          value: {{ .Values.service.spring_application_json | toJson | quote }}
    

    Notice no quotes around this part as that is handled anyway.

    0 讨论(0)
提交回复
热议问题