简体   繁体   English

Helm Chart:将 YAML 转换为 JSON 时出错:yaml:此上下文中不允许映射值

[英]Helm Chart: error converting YAML to JSON: yaml: mapping values are not allowed in this context

I am trying to install akv28s secrets using helm template but it fails, I am unable to diagnose the issue in helm, have tried online yaml validators but no help.我正在尝试使用 helm 模板安装 akv28s secrets 但它失败了,我无法诊断 helm 中的问题,已尝试在线 yaml 验证器但没有帮助。 Using --debug flags renders me the expected manifest使用 --debug 标志使我得到预期的清单

values.yaml值.yaml

akv2k8s:
  enabled: true
  vaults:
    vaultcmms:
      secretkey: secretvalue
      secretkey1: secretvalue1
    vaulttenant:
      secretkey: secretvalue
      secretkey1: secretvalue2

akv28s.yaml akv28s.yaml

{{- if .Values.akv2k8s.enabled -}}
{{- range $vault, $content := .Values.akv2k8s.vaults }}
  {{- range $key, $value := $content }}
    apiVersion: spv.no/v2beta1
    kind: AzureKeyVaultSecret
    spec:
      vault: {{ $vault }}
        name: {{ $key}}
        object:
          name: {{ $value}}
          type: secret
    {{- end }}
    {{- end }}
    {{- end }}

I was making a mistake by specifying the vault value in the wrong hierarchy It should be like我通过在错误的层次结构中指定保险库值而犯了一个错误它应该是这样的

spec:
  vault: 
    name: {{ $vault }}
    object:
      name: {{ $value }}
      type: secret

This solved my issue.这解决了我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 YAML 转换为 JSON 时出错:此上下文中不允许映射值(Azure 上下文) - error converting YAML to JSON: mapping values are not allowed in this context ( Azure context) helm 不使用 values.yaml 文件 - helm doesnt use the values.yaml file 解析 loadbalancer.yaml 时出错:将 YAML 转换为 JSON 时出错:yaml:第 4 行:找到无法启动任何令牌的字符 - error parsing loadbalancer.yaml: error converting YAML to JSON: yaml: line 4: found character that cannot start any token 如何解决“YAML 文件(Azure DevOps)中的意外值和映射错误” - How to resolve 'Unexpected value & mapping error in YAML file (Azure DevOps)' Azure DevOps YAML 管道错误:解析块映射时未找到预期的密钥 - Azure DevOps YAML Pipeline Error: While parsing a block mapping did not find expected key YAML - 使用 Yaml 配置文件部署期间的验证错误 - YAML - Validation error during deployment using Yaml config file 在 Yaml 文件中使用 powershell 内联脚本时出现错误“解析块映射时找不到预期的键” - when using powershell inline script in Yaml file I get error "while parsing a block mapping did not find expected key" 无法使用自定义值升级 airflow helm chart - unable to upgrade airflow helm chart with custom values Azure DevOps 管道 - YAML 格式错误? - Azure DevOps Pipeline - YAML formatting error? YAML Azure DevOps 管道上的解析器错误 - YAML Parser error on Azure DevOps Pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM