Code Monkey home page Code Monkey logo

helmfile-action's Introduction

Helmfile

Tests Container Image Repository on GHCR Go Report Card Slack Community #helmfile Documentation

Deploy Kubernetes Helm Charts

English | 简体中文

About

Helmfile is a declarative spec for deploying helm charts. It lets you...

  • Keep a directory of chart value files and maintain changes in version control.
  • Apply CI/CD to configuration changes.
  • Periodically sync to avoid skew in environments.

To avoid upgrades for each iteration of helm, the helmfile executable delegates to helm - as a result, helm must be installed.

Highlights

Declarative: Write, version-control, apply the desired state file for visibility and reproducibility.

Modules: Modularize common patterns of your infrastructure, distribute it via Git, S3, etc. to be reused across the entire company (See #648)

Versatility: Manage your cluster consisting of charts, kustomizations, and directories of Kubernetes resources, turning everything to Helm releases (See #673)

Patch: JSON/Strategic-Merge Patch Kubernetes resources before helm-installing, without forking upstream charts (See #673)

Status

May 2024 Update - We are inviting Helmfile v1 rc testers! Please see the v1 proposal here and the latest rc release in the releases page. Please file feature requests in Discussions and bugs in Issues.

March 2022 Update - The helmfile project has been moved to helmfile/helmfile from the former home roboll/helmfile. Please see roboll/helmfile#1824 for more information.

Installation

1: Binary Installation

download one of releases

2: Package Manager

  • Archlinux: install via pacman -S helmfile
  • openSUSE: install via zypper in helmfile assuming you are on Tumbleweed; if you are on Leap you must add the kubic repo for your distribution version once before that command, e.g. zypper ar https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Leap_\$releasever kubic
  • Windows (using scoop): scoop install helmfile
  • macOS (using homebrew): brew install helmfile

3: Container

For more details, see run as a container

Make sure to run helmfile init once after installation. Helmfile uses the helm-diff plugin.

Getting Started

Let's start with a simple helmfile and gradually improve it to fit your use-case!

Suppose the helmfile.yaml representing the desired state of your helm releases looks like:

repositories:
- name: prometheus-community
  url: https://prometheus-community.github.io/helm-charts

releases:
- name: prom-norbac-ubuntu
  namespace: prometheus
  chart: prometheus-community/prometheus
  set:
  - name: rbac.create
    value: false

Sync your Kubernetes cluster state to the desired one by running:

helmfile apply

Congratulations! You now have your first Prometheus deployment running inside your cluster.

Iterate on the helmfile.yaml by referencing:

Docs

Please read complete documentation

Contributing

Welcome to contribute together to make helmfile better: contributing doc

Attribution

We use:

  • semtag for automated semver tagging. I greatly appreciate the author(pnikosis)'s effort on creating it and their kindness to share it!

Users

Helmfile has been used by many users in production:

For more users, please see: Users

License

MIT

Star History

Star History Chart

helmfile-action's People

Contributors

bartogabriel avatar bonddim avatar dependabot[bot] avatar github-actions[bot] avatar jkroepke avatar metiletan avatar yxxhero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

helmfile-action's Issues

`Error: Parameter token or opts.auth is required`

I'm getting this error and I can't figure out why, since there's no mention of token or opts.auth in the source code. Here's a sample workflow:

name: test
on: workflow_dispatch

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Install helmfile
        uses: helmfile/[email protected]

And the output:

Run helmfile/[email protected]
  with:
    helmfile-version: latest
    helm-version: latest
    helm-plugins: https://github.com/databus/helm-diff
Error: Parameter token or opts.auth is required

Any ideas? Thanks!

Setup with `helmfile init --force` by default

Helmfile has a default way to setup everything it uses by using helmfile init --force. It installs Helm, helm-diff, helm-secrets, helm-s3, helm-git with their helmfile recommended versions check here.

Currently to setup those default helmfile (basic) plugins we need to specify them as follows (maybe breaking tested compatibility):

- uses: helmfile/[email protected]
  with:
    helmfile-version: 'v0.150.0'
    helm-version: 'v3.11.0'
    helm-plugins: >
      https://github.com/databus23/helm-diff,
      https://github.com/jkroepke/helm-secrets
    helmfile-args: apply --environment prod

PS: I'm not pushing for the removal of helm-plugins: or helm-version: optioons.

First introduction of helmfile init: helmfile/helmfile#389

Use log group to organize actions logs

The helmfile/helmfile-action is very verbose.

The whole helm plugin install is printed to stdout which is a log if helm-diff is installed.

The aggregate logs better, it would be great if the helm plugin install logs could be moved into a log group.

This can be archived by

            echo "::group::My title"
            echo "Inside group"
            echo "::endgroup::"

or using action/core functions.

ref: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

specify working directory

A repository may have multiple helmfile.yaml files across different directories. It would be useful if the action allowed to specify the working directory.

All outputs are empty?

I'm trying to take the stdout of helmfile diff and and post it as a comment in the PR. Every output seems to be empty (I've tried helmfile-stdout, helmfile-stderr and exit-code). Am I missing something? I've verified that writing static text in the pr comment action works as expected, and I can get outputs from other actions and add them as a comment.

    - name: Run helmfile
       id: helmfile_diff
       uses: helmfile/[email protected]
       with:
         helmfile-args: diff --environment staging
    - name: Helmfile Diff Comment
      uses: mshick/add-pr-comment@v2
      with:
        message: | 
          ${{ steps.helmfile_diff.outputs.helmfile-stdout }}

Support diff --detailed-exitcode

The running helmfile diff --detailed-exitcode expect exit code 2 on a success run.

From github actions point of view, it's not possible to allow specific exit code. If helm diff detect changes, it would exit with exit code 2 and helmfile, too. This would result into an action failure.

Proposed solution:

Catch the exit code 2 from helmfile and return exit code 0 to GitHub actions. The exit code should be stored into an output variable.

Use-Case: Run the deploy step only if there is a diff.

Missing v1 tag

The example from README.md

- uses: helmfile/helmfile-action@v1

fails with:

Unable to resolve action `helmfile/helmfile-action@v1`, unable to find version `v1`

Reason: There is no such release or tag for v1 on this repository.

Hint: I'm using a workflow to update the floating tag. However, the Release for the tag needs to be created once.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.