skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

How to let helm version read environment variables when using skaffold deploy

Open foursunZero opened this issue 10 months ago • 1 comments

apiVersion: skaffold/v2beta28
kind: Config
metadata:
  name: vmstack
deploy:
  helm:
    flags:
      upgrade:
        - --timeout
        - 600s
        - --debug
      install:
        - --debug
    releases:
      - name: vm-operator
        repo: https://victoriametrics.github.io/helm-charts/
        remoteChart: victoria-metrics-operator
        version: {{ .CHART_VERSION }}

I tried to configure as above and deploy as follows, but an error was reported during the deployment process

$ skaffold deploy 
parsing skaffold config: error parsing skaffold configuration file: unable to re-marshal YAML without dotted keys: unable to parse YAML: yaml: invalid map key: map[string]interface {}{".CHART_VERSION":interface {}(nil)}

How to dynamically select the version to be deployed?

foursunZero avatar Jan 22 '25 16:01 foursunZero

I ran into this error when trying to use setValueTemplates. In case it helps, the solution was to quote the template string:

version: "{{ .CHART_VERSION }}"

acj avatar May 15 '25 16:05 acj