Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables from the vars: block of the helmfile component are not passed as values #987

Open
kinseii opened this issue Jan 30, 2025 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@kinseii
Copy link

kinseii commented Jan 30, 2025

Describe the Bug

I checked the https://github.com/cloudposse/atmos/tree/main/examples/demo-helmfile example by changing the paths a bit and now I'm pretty sure that the variables from the vars: block of the helmfile component are not passed to the chart as values.

Expected Behavior

As I understand the design of the helmfile component, variables from the vars: block should be passed as values.

Steps to Reproduce

components/helmfile/nginx-demo/v1.0.0/helmfile.yaml:

repositories:
  - name: bitnami
    url: https://charts.bitnami.com/bitnami

releases:
  - name: nginx
    namespace: default
    chart: bitnami/nginx
    force: true
    hooks:
      - events: ["presync"]
        command: "kubectl"
        args: ["apply", "-f", "manifests/"]
      - events: ["postuninstall"]
        command: "kubectl"
        args: ["delete", "-f", "manifests/"]
      - events: ["postsync"]
        command: "bash"
        showlogs: true
        args: ["-c", 'echo -n "Nginx-demo successfully started!"']
    transformers:
      - apiVersion: builtin
        kind: AnnotationsTransformer
        metadata:
          name: notImportantHere
        annotations:
          redeploy: '{{ now }}'
        fieldSpecs:
        - path: spec/template/metadata/annotations
          create: true

components/helmfile/nginx-demo/v1.0.0/manifests:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-demo-custom-html
data:
  index.html: |
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Rickroll</title>
        <style>
          body, html {
            font-family: 'Optimistic Text', -apple-system, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
            margin: 0;
            padding: 0;
            height: 100%;
            width: 100%;
            background: #030711;
            color: #ccc;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
          }
          iframe {
            display: flex;
            align-items: center;
            justify-content: center;
          }
        </style>
      </head>
      <body>
        <h1>Brought to you by Atmos</h1>
        <iframe src="https://player.vimeo.com/video/375468729?h=d063a6fe74" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
      </body>
    </html>

stacks/catalog/nginx-demo.yaml:

components:
  helmfile:
    nginx-demo:
      metadata:
        type: abstract
        component: nginx-demo/v1.0.0
      vars:
        image:
          tag: latest
        service:
          type: ClusterIP
          port: 80
        replicaCount: 1
        ingress:
          enabled: true
          hostname: nginx-demo.example.com
          paths:
            - /
          extraHosts:
            - name: nginx-demo.example2.com
              path: /
        readinessProbe:
          initialDelaySeconds: 1
          periodSeconds: 2
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 3
        persistence:
          enabled: false
        extraVolumes:
          - name: nginx-demo-custom-html
            configMap:
              name: nginx-demo-custom-html
        extraVolumeMounts:
          - name: nginx-demo-custom-html
            mountPath: /app/index.html
            subPath: index.html
            readOnly: true

stacks/orgs/my-company/prod:

import:
  - catalog/nginx-demo

components:
  helmfile:
    nginx-demo:
      metadata:
        type: real
      vars:
        ingress:
          hostname: nginx-demo.my-company.com

Screenshots

No response

Environment

OS: Windows 11, WSL 2.1.3.0
Atmos: v1.153.2 on linux/amd64
Helm: v3.17.0
Helmfile: v0.170.1

Additional Context

So nginx runs completely with default values, it does not mount configmap with custom-html, it does not create kind: Ingress, etc.

$ helm ls -aA
NAME                            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                                                                   APP VERSION
nginx                           default         1               2025-01-30 03:06:37.653811604 -0800 PST deployed        nginx-18.3.5                                                            1.27.3
$ helm get values nginx
USER-SUPPLIED VALUES:
null
@kinseii kinseii added the bug 🐛 An issue with the system label Jan 30, 2025
@kinseii kinseii changed the title Values from the vars block of the helmfile component are not passed as values Values from the vars: block of the helmfile component are not passed as values Jan 30, 2025
@kinseii kinseii changed the title Values from the vars: block of the helmfile component are not passed as values Variables from the vars: block of the helmfile component are not passed as values Jan 30, 2025
@kinseii
Copy link
Author

kinseii commented Jan 30, 2025

Please fix it, much needed to protect the PoC on Atmos in front of the management team

@kinseii
Copy link
Author

kinseii commented Jan 30, 2025

Here screenshot from Slack:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant