...

Package helm

import "github.com/chaos-mesh/chaos-mesh/pkg/helm"
Overview
Index
Examples

Overview ▾

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

Constants

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

func DownloadChaosMeshChartTgz

func DownloadChaosMeshChartTgz(ctx context.Context, version string) (string, error)

Example

Code:

path, err := DownloadChaosMeshChartTgz(context.Background(), "2.2.0")
if err != nil {
    panic(err)
}
fmt.Fprintln(os.Stderr, path)

func FetchChaosMeshChart

func FetchChaosMeshChart(ctx context.Context, version, local string) (*chart.Chart, error)

Example

Code:

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

func GetChaosMeshChartTgzPath

func GetChaosMeshChartTgzPath(ctx context.Context, version, local string) (string, error)

func NewRESTClientGetter

func NewRESTClientGetter(clientConfig clientcmd.ClientConfig) genericclioptions.RESTClientGetter

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

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

func (*HelmClient) UninstallRelease

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

func (*HelmClient) UpgradeRelease

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

type ReleaseService

ReleaseService introduces all the operations about Helm Release

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