helm

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package helm introduces the integration with helm, for example: install / upgrade Chaos Mesh on remote cluster

Index

Examples

Constants

View Source
const ChaosMeshHelmRepo = "https://charts.chaos-mesh.org"

Variables

This section is empty.

Functions

func DownloadChaosMeshChartTgz

func DownloadChaosMeshChartTgz(ctx context.Context, version string) (string, error)
Example
path, err := DownloadChaosMeshChartTgz(context.Background(), "2.2.0")
if err != nil {
	panic(err)
}
fmt.Fprintln(os.Stderr, path)
Output:

func FetchChaosMeshChart

func FetchChaosMeshChart(ctx context.Context, version string) (*chart.Chart, error)
Example
chart, err := FetchChaosMeshChart(context.Background(), "2.2.0")
if err != nil {
	panic(err)
}
fmt.Fprintln(os.Stderr, chart.Name())
fmt.Fprintln(os.Stderr, chart.Metadata.Version)
fmt.Fprintln(os.Stderr, chart.AppVersion())
Output:

func NewRESTClientGetter

func NewRESTClientGetter(clientConfig clientcmd.ClientConfig) genericclioptions.RESTClientGetter

Types

type HelmClient

type HelmClient struct {
	// contains filtered or unexported fields
}

func NewHelmClient

func NewHelmClient(restClientGetter genericclioptions.RESTClientGetter, logger logr.Logger) (*HelmClient, error)

func (*HelmClient) GetRelease

func (h *HelmClient) GetRelease(namespace string, releaseName string) (*release.Release, error)

func (*HelmClient) UninstallRelease

func (h *HelmClient) UninstallRelease(namespace string, releaseName string) (*release.UninstallReleaseResponse, error)

func (*HelmClient) UpgradeOrInstall

func (h *HelmClient) UpgradeOrInstall(namespace string, releaseName string, chart *chart.Chart, values map[string]interface{}) (*release.Release, error)

type ReleaseService

type ReleaseService interface {
	/*GetRelease would fetch the installed release.
	 */
	GetRelease(namespace string, releaseName string) (*release.Release, error)

	/*UpgradeOrInstall would upgrade the existed release or install a new one.
	namespace is the namespace of the release, it should be an existed namespace.
	releaseName introduces the name of the release.
	chart is the chart with certain version to be installed.
	values is the values to be used in the chart, it is also so-called Config in helm's codes.
	It will return the installed/upgraded release and error if any.
	*/
	UpgradeOrInstall(namespace string, releaseName string, chart *chart.Chart, values map[string]interface{}) (*release.Release, error)

	UninstallRelease(namespace string, releaseName string) (*release.UninstallReleaseResponse, error)
}

ReleaseService introduces all the operations about Helm Release

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL