kubernetes 无法解析YAML:将YAML转换为JSON时出错:在"高级"字段行未找到预期键

beq87vna  于 2023-02-21  发布在  Kubernetes
关注(0)|答案(1)|浏览(240)

构建抛出错误:-没有找到预期的关键行“高级”字段下面是我写的yaml文件剪

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: {{ .Values.service.name }}-sqs
spec:
  scaleTargetRef:
    name: {{ .Values.service.name }}
  minReplicaCount: {{ .Values.hpa.minReplicaCount }}
  maxReplicaCount: {{ .Values.hpa.maxReplicaCount }}
  fallback:
    failureThreshold: 3
    replicas: {{ .Values.hpa.minReplicaCount }}
  advanced:
    behavior:
      scaleDown:
        stabilizationWindowSeconds: {{ .Values.hpa.scaleDown.stabilizationWindowSeconds}} 
        policies:
{{ toYaml .Values.hpa.scaleDown.policies | indent 6 }}
      scaleUp:
        stabilizationWindowSeconds: {{ .Values.hpa.scaleUp.stabilizationWindowSeconds}}  
        policies:
{{ toYaml .Values.hpa.scaleUp.policies | indent 6 }}
        selectPolicy: {{ .Values.hpa.selectPolicyForScaleUp}} ```
pbossiut

pbossiut1#

Rafał Leszko所述,您提供的yaml文件中存在一些格式和缩进问题。您可以在部署图表之前使用**helm lint**来验证您的图表。Helm Linter将验证您的图表语法,并打印出所有会中断代码工作的错误、警告和信息。(来源:舵手文件)

相关问题