【问题标题】:Skaffold doesn't accept "command" parameter in yamlSkaffold 不接受 yaml 中的“命令”参数
【发布时间】:2021-07-15 14:06:57
【问题描述】:

这是我正在使用的 Skaffold yaml:

apiVersion: skaffold/v1
kind: Config
metadata:
  name: myapp-api
build:
  artifacts:
  - image: elodie/myapp-api
    context: .
    docker:
      dockerfile: Dockerfile
deploy:
  helm:
    releases:
    - name: elodie-api
      chartPath: bitnami/node
      remote: true
      setValues:
        command: ['/bin/bash', '-ec', 'npm start']
        image.repository: elodie/myapp-api
        service.type: LoadBalancer
        getAppFromExternalRepository: false
        applicationPort: 6666
      setValueTemplates:
        image.tag: "{{ .DIGEST_HEX }}"

我在添加命令配置时收到 parsing skaffold config: error parsing skaffold configuration file: unable to parse config: yaml: unmarshal errors: line 16: cannot unmarshal !!seq into string 错误,但该值是直接从 bitnami 提供的 values.yaml 中提取的。

为什么会出现这个错误,有什么想法吗?

【问题讨论】:

    标签: kubernetes-helm skaffold


    【解决方案1】:

    setValues 被转换为--set 参数序列到helm。所以`setValues: 只支持字符串值。

    Helm 确实支持represent other structures with --set 的方式。看起来你应该可以使用:

    setValues:
      command: "{/bin/bash, -ec, npm start}"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      • 2013-03-15
      • 2013-05-23
      • 2022-11-25
      • 2017-04-27
      相关资源
      最近更新 更多