首页 > 解决方案 > 错误:解析 ssl2.yaml 时出错:将 YAML 转换为 JSON 时出错:yaml:第 22 行:未找到预期的密钥

问题描述

错误:解析 ssl2.yaml 时出错:将 YAML 转换为 JSON 时出错:yaml:第 22 行:未找到预期的密钥

apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: ambassador-certs
  # cert-manager will put the resulting Secret in the same Kubernetes namespace
  # as the Certificate. Therefore you should put this Certificate in the same namespace as Ambassador.
  # eg. if you deploy ambassador to ambassador namespace, you need to change to namespace: ambassador
  namespace: default
spec:
  # naming the secret name certificate ambassador-certs is important because
  # ambassador just look for this particular name
  secretName: ambassador-certs
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  dnsNames:
  - mikiwiki.es
  acme:
    config:
    - http01:
        ingressClass: nginx
      domains:
     - mikiwiki.es

标签: kubernetes

解决方案


最后一行有缩进错误。

只需在其上添加一个空格:

      domains:
      - mikiwiki.es

推荐阅读