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
- pip install --upgrade HelmState
- python3x
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.
helmstate commit --helm-chart my-helm-chart --version 1.0.0
helmstate commit --helm-chart my-helm-chart --version 1.0.1 --push
helmstate get --helm-chart my-helm-chart
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
helmstate commit --helm-chart my-helm-chart --version 1.0.0 --resource-group my-resource-group
helmstate commit --helm-chart my-helm-chart --version 1.0.0 --namespace my-namespace --resource-group my-resource-group
helmstate --help
gitkraken is a great git GUI, and works well to visualize the state tree.
pip install twine
pip install wheel
pip install -r requirements.txt
- Configure setup.py with new version.
- Package:
python setup.py bdist_wheel
- Check:
twine check dist/*
- Publish:
twine upload dist/*
- python -m unittest
- docker build .