Skip to main content

Helm State

PyPI version Build Status MIT license

The Helm State tool is a simple GitOps tool with helm and kubernetes in mind. The Helm State tool stores deployed helm versions in git branches, where it will be easy to track previously deployed versions and which version is currently running.

The full helm version state is stored in a state.yaml file versioned by a git branch with this naming convention:

  • my-resource_group/my-namespace/my-helm-chart

Content structure of state.yaml:

my-resource-group:
  my-namespace:
    my-helm-chart: 
      version: 1.0.0

Install Or Upgrade

  • pip install --upgrade HelmState

Prerequisites

  • python3x

Usage

The Helm State is available as a command line tool with helmstate.

First of all, either clone or initialize a new repository to where the state will be stored. Then, try out some of the commands below with current working directory set to the repository folder.

Commit new helm states and push last commit

helmstate commit --helm-chart my-helm-chart --version 1.0.0
helmstate commit --helm-chart my-helm-chart --version 1.0.1 --push

Get current helm state

helmstate get --helm-chart my-helm-chart

Revert current helm state 2 commits back and push last revert

helmstate commit --helm-chart my-helm-chart --version 1.0.0
helmstate commit --helm-chart my-helm-chart --version 1.0.1
helmstate commit --helm-chart my-helm-chart --version 1.0.2
helmstate revert --helm-chart my-helm-chart --commits 1
helmstate revert --helm-chart my-helm-chart --commits 1 --push

Split different environments in resource groups

helmstate commit --helm-chart my-helm-chart --version 1.0.0 --resource-group my-resource-group

Set kubectl namespace to where the helm artifact was deployed

helmstate commit --helm-chart my-helm-chart --version 1.0.0 --namespace my-namespace --resource-group my-resource-group

More details with help

helmstate --help

Visualize State Tree With GitKraken

gitkraken is a great git GUI, and works well to visualize the state tree.

alt text

Development

Dependencies:

  • pip install twine
  • pip install wheel
  • pip install -r requirements.txt

Publish New Version.

  1. Configure setup.py with new version.
  2. Package: python setup.py bdist_wheel
  3. Check: twine check dist/*
  4. Publish: twine upload dist/*

Run Unit Tests

  • python -m unittest
  • docker build .

Metadata

Release files for HelmState 1.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for HelmState 1.0.22
File Interpreter ABI Platform
HelmState-1.0.22-py3-none-any.whl Python 3 none any Details

Release files / HelmState-1.0.22-py3-none-any.whl

Download URL HelmState-1.0.22-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
474f2878c3e799b685d1c1d6695555ed7eb0fa852fb095f9acf18fe096ba86d3
BLAKE2b-256 checksum
How to use checksums
cba1b7642c9963d09d89056b886e067bcb0268da45bcb0ee9e4515f51f7c160b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.14

Release history Release notifications | RSS feed

This release

1.0.22 This release

1 release file

1.0.21

1 release file

1.0.20

1 release file

1.0.19

1 release file

1.0.18

1 release file

1.0.17

1 release file

1.0.16

1 release file

1.0.15

1 release file

1.0.14

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page