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
- Variables
- func GetFilesRecursive(f fs.FS, root string) ([]string, error)
- func MergeProfileValues(profile string, sets []string) (map[string]interface{}, error)
- func SetsContainSubstring(sets []string, sub string) bool
- type CloudCoreHelmTool
- type Helper
- type KubeCloudHelmInstTool
- type Options
- type Renderer
- type TemplateFilterFunc
Constants ¶
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" )
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 ¶
var ( ErrListProfiles = errors.New("can not list profiles") ValidProfiles = map[string]bool{VersionProfileKey: true, IptablesMgrProfileKey: true, ControllerManagerProfileKey: true} )
Functions ¶
func MergeProfileValues ¶ added in v1.16.0
MergeProfileValues merges values from specified profile and directly via --set.
func SetsContainSubstring ¶ added in v1.12.0
SetsContainSubstring checks whether a substring contains in string set
Types ¶
type CloudCoreHelmTool ¶ added in v1.16.0
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
func (c *CloudCoreHelmTool) Upgrade(opts *types.CloudUpgradeOptions) error
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
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
GetRelease gets a helm release by release name, returns a nil value if not found.
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
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) RenderManifest ¶
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.