Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
Signed-off-by: George Jenkins <[email protected]>
  • Loading branch information
gjenkins8 committed Jan 19, 2024
1 parent b60ee03 commit ebcc86d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 20 deletions.
33 changes: 22 additions & 11 deletions content/en/docs/sdk/examples.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
---
title: "Examples"
description: "Explains various advanced features for Helm power users"
aliases: ["/docs/advanced_helm_techniques"]
description: "Examples various features if the Helm SDK"
weight: 2
---

This document runs though a series of examples of using the Helm SDK

# Actions
## Actions

These examples are meant to be fully working. The code lives in the `sdkexamples` directory. The below driver runs through each example:
These examples are intended to document various SDK functionalities The code is intended to be fully working, and lives in the `sdkexamples` directory.

{{< highlightexamplego file="sdkexamples/main.go" >}}
The final example documents a driver which can run these actions, including the necessary helper functions.

## Install Action
### Install Action

This example installs the given chart/release, for the given version and values.

{{< highlightexamplego file="sdkexamples/install.go" >}}

## Upgrade Action
### Upgrade Action

This example upgrades the given release, with the given chart, version and values.

{{< highlightexamplego file="sdkexamples/upgrade.go" >}}

## Uninstall Action
### Uninstall Action

This example uninstalls the given release

{{< highlightexamplego file="sdkexamples/uninstall.go" >}}

## List Action
### List Action

This example lists all released charts (in the currently configured namespace)

{{< highlightexamplego file="sdkexamples/list.go" >}}

## Pull Action
### Pull Action

{{< highlightexamplego file="sdkexamples/list.go" >}}
This example pulls a chart from an OCI repository

{{< highlightexamplego file="sdkexamples/pull.go" >}}

### Driver

The driver here shows the necessary auxillary functions needed for the Helm SDK actions to function. And shows the above examples in action, to pull, install, update, and uninstall the 'podinfo' chart from an OCI repository.

{{< highlightexamplego file="sdkexamples/main.go" >}}
28 changes: 19 additions & 9 deletions content/en/docs/sdk/gosdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,29 @@ description: "Introduces the Helm Go SDK"
aliases: ["/docs/gosdk"]
weight: 1
---
Helm provides a Go SDK to enable building software and tools that leverage Helm
charts for managing Kubernetes software deployment (In fact, the Helm CLI is just one such tool).
Helm provides a Go SDK to enable building software and tools that leverage Helm charts and Helm functionality for managing Kubernetes software deployment. In fact, the Helm CLI is just one such tool(!).

Full API documentation can be found at [https://pkg.go.dev/helm.sh/helm/v3](https://pkg.go.dev/helm.sh/helm/v3),
but a brief overview of some of the main types of packages and a simple example follow
below.
Currently, the SDK has been functionally separated from the Helm CLI, and the SDK can (and is) used by standalone tooling. The Helm project has committed to API stability for the SDK. But... as a warning, the SDK has some rough edges remaining from the initial work to separate the CLI and the SDK. Which the Helm project aims to improve and over time provide a cleaner SDK API.

# Main packages
Full API documentation can be found at [https://pkg.go.dev/helm.sh/helm/v3](https://pkg.go.dev/helm.sh/helm/v3).

## Actions
A brief overview of some of the main types of packages follow below.

## Main packages

### Actions

[pkg/action](https://pkg.go.dev/helm.sh/helm/v3/pkg/action) provides the main operations that Helm can action on charts. `install`, `upgrade`, `pull`, etc. These are often used one-to-one by the Helm CLI commands.

## Chartutil
### Chartutil

[pkg/chartutil](https://pkg.go.dev/helm.sh/helm/v3/pkg/chartutil) provides high level functionality for working with Helm charts.


## Compatibility

The Helm SDK explicitly follows the Helm backwards compatibility guarantees:

<https://github.com/helm/community/blob/main/hips/hip-0004.md>

[pkg/chartutil](https://pkg.go.dev/helm.sh/helm/v3/pkg/chartutil) provides high level functionality for working with Helm charts. For example, unpacking.
That is, break changes will only be made over major versions.

0 comments on commit ebcc86d

Please sign in to comment.