Skip to main content

Python library for managing Helm releases using Helm 3.

Project description

pyhelm3

Python library for managing Helm releases using Helm 3 (i.e. Tiller-less Helm).

Installation

pyhelm3 can be installed directly from GitHub using pip:

pip install git+https://github.com/stackhpc/pyhelm3.git

Usage

from pyhelm3 import Client


# This will use the Kubernetes configuration from the environment
client = Client()
# Specify the kubeconfig file to use
client = Client(kubeconfig = "/path/to/kubeconfig")
# Specify the kubecontext to use
client = Client(kubecontext = "kubecontext")
# Specify a custom Helm executable (by default, we expect 'helm' to be on the PATH)
client = Client(executable = "/path/to/helm")


# List the deployed releases
releases = await client.list_releases(all = True, all_namespaces = True)
for release in releases:
    revision = await release.current_revision()
    print(release.name, release.namespace, revision.revision, str(revision.status))


# Get the current revision for an existing release
revision = await client.get_current_revision("cert-manager", namespace = "cert-manager")
chart_metadata = await revision.chart_metadata()
print(
    revision.release.name,
    revision.release.namespace,
    revision.revision,
    str(revision.status),
    chart_metadata.name,
    chart_metadata.version
)


# Fetch a chart
chart = await client.get_chart(
    "cert-manager",
    repo = "https://charts.jetstack.io",
    version = "v1.8.x"
)
print(chart.metadata.name, chart.metadata.version)
print(await chart.readme())


# Install or upgrade a release
revision = await client.install_or_upgrade_release(
    "cert-manager",
    chart,
    { "installCRDs": True },
    atomic = True,
    wait = True
)
print(
    revision.release.name,
    revision.release.namespace,
    revision.revision,
    str(revision.status)
)


# Uninstall a release
#   Via the revision
revision = await client.get_current_revision("cert-manager", namespace = "cert-manager")
await revision.release.uninstall(wait = True)
#   Or directly by name
await client.uninstall_release("cert-manager", namespace = "cert-manager", wait = True)

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

pyhelm3-0.3.2.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

pyhelm3-0.3.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file pyhelm3-0.3.2.tar.gz.

File metadata

  • Download URL: pyhelm3-0.3.2.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyhelm3-0.3.2.tar.gz
Algorithm Hash digest
SHA256 e9125a001e185dfd3c04c5ac21d24d5283c4570453b202970fe30e874a431e0a
MD5 46819141bd12b35668786b96c91137b4
BLAKE2b-256 83c9e97e0c5e0b225baf01e09d324b294aecaaed685adbded44c2453afcfc6fb

See more details on using hashes here.

Provenance

File details

Details for the file pyhelm3-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pyhelm3-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyhelm3-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e09213f79e54fd31a1d8d4de076889acfc55e726816bce53f3262a43ee80270
MD5 e20f9b6c527bf9d6e612cbd6cd11ff9d
BLAKE2b-256 e0cfd23920e0cd389061e1a7caa512b69f8b4a6121e2258143251c224b6e8ba3

See more details on using hashes here.

Provenance

Supported by

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