Giter Club home page Giter Club logo

pyhelm3's Introduction

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 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)

pyhelm3's People

Contributors

mkjpryor avatar nikpaushkin avatar

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.