helm

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Copyright 2024 The KubeEdge Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 The KubeEdge Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 The KubeEdge Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DefaultBaseHelmDir   = ""
	DefaultAddonsHelmDir = "addons"

	// DefaultProfileFilename is the name of the default profile yaml file.
	DefaultProfileFilename = "version.yaml"

	DefaultHelmTimeout = time.Duration(60 * time.Second)

	VersionProfileKey           = "version"
	IptablesMgrProfileKey       = "iptablesmgr"
	ControllerManagerProfileKey = "controllermanager"
	ExternalIptablesMgrMode     = "external"
	InternalIptablesMgrMode     = "internal"
	EdgemeshProfileKey          = "edgemesh"
)
View Source
const (
	// YAMLSeparator is a separator for multi-document YAML files.
	YAMLSeparator = "\n---\n"

	// DefaultProfileString is the name of the default profile.
	DefaultProfileString = "version"

	// NotesFileNameSuffix is the file name suffix for helm notes.
	// see https://helm.sh/docs/chart_template_guide/notes_files/
	NotesFileNameSuffix = ".txt"

	// Chart Release Name
	ReleaseName = "kubeedge"
)

Variables

View Source
var (
	ErrListProfiles = errors.New("can not list profiles")
	ValidProfiles   = map[string]bool{VersionProfileKey: true, IptablesMgrProfileKey: true, ControllerManagerProfileKey: true}
)

Functions

func GetFilesRecursive

func GetFilesRecursive(f fs.FS, root string) ([]string, error)

func MergeProfileValues added in v1.16.0

func MergeProfileValues(profile string, sets []string,
) (map[string]interface{}, error)

MergeProfileValues merges values from specified profile and directly via --set.

func SetsContainSubstring added in v1.12.0

func SetsContainSubstring(sets []string, sub string) bool

SetsContainSubstring checks whether a substring contains in string set

Types

type CloudCoreHelmTool added in v1.16.0

type CloudCoreHelmTool struct {
	util.Common
}

CloudCoreHelmTool a cloudcore helm chart operation wrapping tool

func NewCloudCoreHelmTool added in v1.16.0

func NewCloudCoreHelmTool(kubeConfig, kubeedgeVersion string) *CloudCoreHelmTool

NewCloudCoreHelmTool creates a new instance of CloudCoreHelmTool

func (*CloudCoreHelmTool) Install added in v1.16.0

func (c *CloudCoreHelmTool) Install(opts *types.InitOptions) error

Install uses helm client to install cloudcore release

func (*CloudCoreHelmTool) Uninstall added in v1.16.0

func (c *CloudCoreHelmTool) Uninstall(opts *types.ResetOptions) error

Uninstall uses helm client to uninstall cloudcore release

func (*CloudCoreHelmTool) Upgrade added in v1.16.0

Upgrade uses helm client to upgrade cloudcore release

type Helper added in v1.16.0

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

Helper a helm client wrapping tool.

func NewHelper added in v1.16.0

func NewHelper(kubeconfig, namespace string) (*Helper, error)

NewHelper creates a new instance of Helper, and initialize the configuration for reuse.

func (*Helper) GetConfig added in v1.16.0

func (h *Helper) GetConfig() *action.Configuration

func (*Helper) GetRelease added in v1.16.0

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

GetRelease gets a helm release by release name, returns a nil value if not found.

func (*Helper) GetValues added in v1.16.0

func (h *Helper) GetValues(releaseName string) (map[string]interface{}, error)

GetValues returns a helm release installed values.

type KubeCloudHelmInstTool

type KubeCloudHelmInstTool struct {
	util.Common
	AdvertiseAddress string
	Manifests        string
	Namespace        string
	Sets             []string
	Profile          string
	ProfileKey       string
	ExternalHelmRoot string
	Force            bool
	SkipCRDs         bool
	DryRun           bool
	Action           string
	// contains filtered or unexported fields
}

KubeCloudHelmInstTool embeds Common struct It implements ToolsInstaller interface

func (*KubeCloudHelmInstTool) InstallTools

func (cu *KubeCloudHelmInstTool) InstallTools() error

InstallTools downloads KubeEdge for the specified version and makes the required configuration changes and initiates cloudcore.

func (*KubeCloudHelmInstTool) RunHelmInstall

func (cu *KubeCloudHelmInstTool) RunHelmInstall(baseHelmRoot string) error

RunHelmInstall renders the Charts with the given values, then installs the Charts to the cluster.

func (*KubeCloudHelmInstTool) RunHelmManifest

func (cu *KubeCloudHelmInstTool) RunHelmManifest(baseHelmRoot string) error

func (*KubeCloudHelmInstTool) TearDown

func (cu *KubeCloudHelmInstTool) TearDown() error

TearDown method will remove the edge node from api-server and stop cloudcore process

type Options added in v1.16.0

type Options struct {
	ValueFiles    []string // -f/--values
	StringValues  []string // --set-string
	Values        []string // --set
	FileValues    []string // --set-file
	JSONValues    []string // --set-json
	LiteralValues []string // --set-literal
}

Options captures the different ways to specify values

func (*Options) MergeValues added in v1.16.0

func (opts *Options) MergeValues() (map[string]interface{}, error)

MergeValues merges values from files specified via -f/--values and directly via --set-json, --set, --set-string, or --set-file, marshaling them to YAML

type Renderer

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

Renderer is a helm template renderer for a fs.FS.

func NewGenericRenderer

func NewGenericRenderer(files fs.FS, dir, componentName, namespace string, profileValsMap map[string]interface{}, skipCRDs bool) *Renderer

NewFileTemplateRenderer creates a TemplateRenderer with the given parameters and returns a pointer to it. helmChartDirPath must be an absolute file path to the root of the helm charts.

func (*Renderer) LoadChart

func (h *Renderer) LoadChart() error

LoadChart would load the given charts.

func (*Renderer) RenderManifest

func (h *Renderer) RenderManifest() (string, error)

RenderManifest renders the current helm templates with the current values and returns the resulting YAML manifest string.

func (*Renderer) RenderManifestFiltered

func (h *Renderer) RenderManifestFiltered(filter TemplateFilterFunc) (string, error)

RenderManifestFiltered filters templates to render using the supplied filter function.

type TemplateFilterFunc

type TemplateFilterFunc func(string) bool

Jump to

Keyboard shortcuts

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