Skip to main content

Python bindings for Helm: Kubernetes package manager

Project description

Python bindings for the Helm package manager

How to use PyHelm

In order to install a Helm chart using PyHelm, you can perform the following steps:

Load a chart using ChartBuilder

from pyhelm.chartbuilder import ChartBuilder

chart = ChartBuilder({"name": "nginx-ingress", "source": {"type": "repo", "location": "https://kubernetes-charts.storage.googleapis.com"}})

This will cause the chart to cloned locally, and any additional use of chart will reference the local copy. You can also used a local chart by using "type": "directory", as well as cloning from a git repo using "type": "git"

Installing a chart

from pyhelm.chartbuilder import ChartBuilder
from pyhelm.tiller import Tiller

tiller = Tiller(TILLER_HOST)
chart = ChartBuilder({"name": "nginx-ingress", "source": {"type": "repo", "location": "https://kubernetes-charts.storage.googleapis.com"}})
tiller.install_release(chart.get_helm_chart(), dry_run=False, namespace='default')

This snippet will install the nginx-ingress chart on a Kubernetes cluster where Tiller is installed (assuming TILLER_HOST points to a live Tiller instance). Take note that in most Helm installations Tiller isn’t accessible in such a manner, and you will need to perform a Kubernetes port-forward operation to access Tiller. The Tiller class supports other operations other than installation, including release listing, release updating, release uninstallation and getting release contents.

Helm gRPC

The helm gRPC libraries are located in the hapi directory. They were generated with the grpc_tools.protoc utility against Helm 2.11. Should you wish to re-generate them you can easily do so:

git clone https://github.com/kubernetes/helm ./helm
python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. _proto/hapi/chart/*
python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. _proto/hapi/services/*
python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. _proto/hapi/release/*
python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. _proto/hapi/version/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhelm-0.0.10.dev21.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyhelm-0.0.10.dev21-py2-none-any.whl (42.8 kB view details)

Uploaded Python 2

File details

Details for the file pyhelm-0.0.10.dev21.tar.gz.

File metadata

  • Download URL: pyhelm-0.0.10.dev21.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for pyhelm-0.0.10.dev21.tar.gz
Algorithm Hash digest
SHA256 d25b31bf0ffcce5de6c75003f928225d530de8251fdec893b68f267e83998382
MD5 126718c2e9ffaeb71096f414b2767850
BLAKE2b-256 4a9a95c4ec841cf26215d0324268c2ae6348d7703af6943d4f4032cbf67af129

See more details on using hashes here.

File details

Details for the file pyhelm-0.0.10.dev21-py2-none-any.whl.

File metadata

  • Download URL: pyhelm-0.0.10.dev21-py2-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for pyhelm-0.0.10.dev21-py2-none-any.whl
Algorithm Hash digest
SHA256 481159a5ecc3675aaf365f486724b3f8647553fe1eede7b9dea1d71f51c1435c
MD5 7d1e408f7e01bb809432a1551b20b19f
BLAKE2b-256 414ce11bfd33722a3a039b2775f4983dd1ea78be95dfa1c2c4e86709e25e2e2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page