#helmfile (2021-08)

https://github.com/roboll/helmfile

Questions and discussion around helmfile https://github.com/roboll/helmfile and https://github.com/cloudposse/helmfiles Archive: https://archive.sweetops.com/helmfile/

2021-08-31

bradym avatar
bradym

Running into an issue with the bitnami/redis chart.

My release:

  - name: redis
    version: 15.0.4
    atomic: false
    cleanupOnFail: false
    chart: bitnami/redis
    labels:
      app: "{{`{{ .Release.Name }}`}}"
    namespace: default
    missingFileHandler: Error
    dependencies:
      - chart: bitnami/common
        version: 1.8.0
        alias: common
    values:
      - values-infra/redis.values.yaml.gotmpl

redis.values.yaml.gotmpl is the default values file with a couple tweaks, and I’m getting this error:

in helmfiles/local-infra.yaml: [failed to render values files "values-infra/redis.values.yaml.gotmpl": failed to render [values-infra/redis.values.yaml.gotmpl], because of template: stringTemplate:1220:47: executing "stringTemplate" at <{{template "common.names.fullname" .}}>: template "common.names.fullname" not defined]

If I don’t try to include a values file it works fine. Any ideas?

2021-08-21

Andrew White avatar
Andrew White

Hi – I feel like I’m missing something simple here, hoping someone can help me out. If I define an ingress in a paperless_values.yml.gotmpl file like so:

ingress:
  main:  # see: <https://github.com/k8s-at-home/charts/blob/master/charts/stable/paperless/values.yaml#L39>
    enabled: true
    <SNIP>
env:
  PAPERLESS_TIME_ZONE: America/Los_Angeles

And reference from my helmfile:

  - name: paperless
    namespace: {{ .Values.paperless.namespace }}
    chart: k8s-at-home/paperless
    version: 7.0.0
    values:
      - paperless_values.yml.gotmpl

Everything works swimmingly. But if I move the ingress key inline into the helmfile as follows, helmfile-diff tells me there’s no longer an ingress for that release.

  - name: paperless
    namespace: {{ .Values.paperless.namespace }}
    chart: k8s-at-home/paperless
    version: 7.0.0
    values:
      - paperless_values.yml.gotmpl
      - ingress:
          main:  # see: <https://github.com/k8s-at-home/charts/blob/master/charts/stable/paperless/values.yaml#L39>
            enabled: true
            <SNIP>

What am I missing here?

2021-08-19

Mark juan avatar
Mark juan

Do anyone know how to add cloudwatch as data source in grafana using this helm chart https://github.com/prometheus-community/helm-charts?

GitHub - prometheus-community/helm-charts: Prometheus community Helm charts attachment image

Prometheus community Helm charts. Contribute to prometheus-community/helm-charts development by creating an account on GitHub.

1
1
Mark juan avatar
Mark juan

Tried with this but didnt worked out ,

 grafana:additionalDataSources: 
 - name: Cloudwatch
      type: cloudwatch
      jsonData:
        authType: arn
        assumeRoleArn: "${ASSUME_ROLE_ARN}"
        defaultRegion: "${CLUSTER_REGION}"

2021-08-10

2021-08-09

rms1000watt avatar
rms1000watt

Does anyone have any recommendations for diff ‘ing helm chart changes against live helm charts? helm-diff is nice, but I’m convinced it runs everything synchronously rather than concurrently? :sob:

(even tho this line is here) (ah, this for loop might be the synchronous part.. hmm)

I have 41 releases at the moment that takes about 2m 30s to complete with helm-diff, which is really slow

I usually run it like helmfile -f stuff.yaml diff

toast-gear avatar
toast-gear

could you just use background tasks to run multiple diffs at once?

2021-08-06

batistein avatar
batistein

I have the following values:

  service:
    - servicea:
      db: 
      	enabled: true
    - serviceb:
      	something: 
      	  another: "hello"
  servicegroup:
    group1:
      callerservice:
        db: 
          enabled: true
    group2:
      db:
        enabled: false
      something:
      	another: "hi"

Now I need to range over these values and find only the keys with “db”. Later the value of the key db should be passed to a template

This is what I have so far.

{{- range $db:= .Values }}
  {{ printf "%s" $db }}
  {{- if hasKey $db "db" }}
  {{ printf "success: %s" $db }}
  {{- end }}
  {{- if not (kindIs "string" $db) }}
    {{- range $db2:= $db }}
    {{ printf "%s" $db2 }}
    {{- if hasKey $db2 "db" }}
    {{ printf "success: %s" $db2 }}
    {{- end }}
    {{- if not (kindIs "string" $db2) }}
      {{- range $db3:= $db2 }}
      {{ printf "%s" $db3 }}
      {{- if hasKey $db3 "db" }}
      {{ printf "success: %s" $db3 }}
      {{- end }}
    {{- end }}
    {{- end }}
    {{- end }}
  {{- end }}
{{- end }}

the problem i have is that i have arrays and they cause the following error: executing “stringTemplate” at <$db>: wrong type for value; expected map[string]interface {}; got string

besides, it doesn’t look very nice either, if that could be solved recursively somehow I would be very grateful.

2021-08-05

Balazs Varga avatar
Balazs Varga

could somebody please share a transformers example for deployment where set spec/strategy ? Thanks

rei avatar

Hello, I am having difficulties loading remote values files from a private GitLab repository using this proposed syntax: https://github.com/roboll/helmfile/tree/v0.140.0#loading-remote-environment-values-files

I try to use the following URLs:

<https://gitlab.com/><company>/<project>/<repo_name>/-/raw/{{ env "CI_COMMIT_SHA" | default "-" }}/config/config.yaml?private_token={{ env "CI_JOB_TOKEN" }}
git::<https://gitlab.com/><company>/<project>/<repo_name>[email protected]/config.yaml?ref={{ env "CI_COMMIT_SHA" | default "-" }}

Interestingly when calling directly go-getter "<https://gitlab.com/><company>/<project>/<repo_name>/-/raw/<CI_COMMIT_SHA>/config/config.yaml?private_token=<SECRET>" ./foo it works.

Any ideas?

rei avatar

The solution was in the test code here:

https://github.com/roboll/helmfile/blob/ae942c5288895c84c79171e5446773e4cb41c4ce/pkg/remote/remote_test.go#L67

Use an @ to separate the path from the GIT url…

rei avatar

The following syntax using an @ worked for me:

environments:
  cluster-azure-us-west:
    values:
      - git::<https://gitlab.com/org/[email protected]/config/config.test.yaml?ref=main> # Public Gilab Repo
  cluster-gcp-europe-west:
    values:
      - git::<https://ci>:{{ env "CI_JOB_TOKEN" }}@gitlab.com/org/[email protected]/config.dev.yaml?ref={{ env "APP_COMMIT_SHA" }}  # Private Gitlab Repo

2021-08-03

Tim Birkett avatar
Tim Birkett

Has anyone used helmfile and helm-x together had problems with crds (the helm release trying to create/take ownership of them, they already exist from non helm-x install)?

    keyboard_arrow_up