如何在 helm install 命令中使用 --set 覆盖多行字符串?

Igo*_*adi 7 kubernetes kubernetes-helm

rawConfig我需要在部署时在多行字符串内安装带有动态“project_id”标志的舵

例子values.yaml

sinks:
  console:
    type: "console"
    inputs: ["kafka"]
    rawConfig: |
      target = "stdout"

      encoding.codec = "json"

  stackdriver:
    type: "gcp_stackdriver_logs"
    inputs: ["kafka"]
    rawConfig: |
      healthcheck = true
      log_id = "mirth-channels-log"
      project_id = "my_project"
      resource.type = "k8s_cluster"
Run Code Online (Sandbox Code Playgroud)

如何覆盖project_idrawConfig 中的这个值?我正在尝试这样做:

 helm install vector helm/vector --values helm/vector-agent/values.yaml -n my-namespace --set sinks.stackdriver.rawConfig='\nlog_id\ =\ "mirth-channels-log"\nproject_id\ =\ "my_project_test"\nresource.type\ =\ "k8s_cluster"\n'
Run Code Online (Sandbox Code Playgroud)

但这不起作用

Mat*_*att 4

使用第二个 --values 如下所示:

# values_patch.yaml
sinks:
  stackdriver:
    rawConfig: |
      healthcheck = true
      log_id = "mirth-channels-log"
      project_id = "SOME_OTHER_PROJECT_ID"
      resource.type = "k8s_cluster"
Run Code Online (Sandbox Code Playgroud)
$ helm install [...] --values values_patch.yaml
Run Code Online (Sandbox Code Playgroud)