当前位置:网站首页>helm安装
helm安装
2022-08-11 05:28:00 【秋天已北】
安装helm
wget https://mirrors.huaweicloud.com/helm/v3.0.3/helm-v3.0.3-linux-amd64.tar.gz
tar -xvzf helm-v3.0.3-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/
helm
[[email protected] ~]# helm
The Kubernetes package manager
Common actions for Helm:
- helm search: search for charts
- helm pull: download a chart to your local directory to view
- helm install: upload the chart to Kubernetes
- helm list: list releases of charts
Environment variables:
+------------------+-----------------------------------------------------------------------------+
| Name | Description |
+------------------+-----------------------------------------------------------------------------+
| $XDG_CACHE_HOME | set an alternative location for storing cached files. |
| $XDG_CONFIG_HOME | set an alternative location for storing Helm configuration. |
| $XDG_DATA_HOME | set an alternative location for storing Helm data. |
| $HELM_DRIVER | set the backend storage driver. Values are: configmap, secret, memory |
| $HELM_NO_PLUGINS | disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins. |
| $KUBECONFIG | set an alternative Kubernetes configuration file (default "~/.kube/config") |
+------------------+-----------------------------------------------------------------------------+
Helm stores configuration based on the XDG base directory specification, so
- cached files are stored in $XDG_CACHE_HOME/helm
- configuration is stored in $XDG_CONFIG_HOME/helm
- data is stored in $XDG_DATA_HOME/helm
By default, the default directories depend on the Operating System. The defaults are listed below:
+------------------+---------------------------+--------------------------------+-------------------------+
| Operating System | Cache Path | Configuration Path | Data Path |
+------------------+---------------------------+--------------------------------+-------------------------+
| Linux | $HOME/.cache/helm | $HOME/.config/helm | $HOME/.local/share/helm |
| macOS | $HOME/Library/Caches/helm | $HOME/Library/Preferences/helm | $HOME/Library/helm |
| Windows | %TEMP%\helm | %APPDATA%\helm | %APPDATA%\helm |
+------------------+---------------------------+--------------------------------+-------------------------+
Usage:
helm [command]
Available Commands:
completion Generate autocompletions script for the specified shell (bash or zsh)
create create a new chart with the given name
dependency manage a chart's dependencies
env Helm client environment information
get download extended information of a named release
help Help about any command
history fetch release history
install install a chart
lint examines a chart for possible issues
list list releases
package package a chart directory into a chart archive
plugin install, list, or uninstall Helm plugins
pull download a chart from a repository and (optionally) unpack it in local directory
repo add, list, remove, update, and index chart repositories
rollback roll back a release to a previous revision
search search for a keyword in charts
show show information of a chart
status displays the status of the named release
template locally render templates
test run tests for a release
uninstall uninstall a release
upgrade upgrade a release
verify verify that a chart at the given path has been signed and is valid
version print the client version information
Flags:
--add-dir-header If true, adds the file directory to the header
--alsologtostderr log to standard error as well as files
--debug enable verbose output
-h, --help help for helm
--kube-context string name of the kubeconfig context to use
--kubeconfig string path to the kubeconfig file
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log-dir string If non-empty, write log files in this directory
--log-file string If non-empty, use this log file
--log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "/root/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "/root/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "/root/.config/helm/repositories.yaml")
--skip-headers If true, avoid header prefixes in the log messages
--skip-log-headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level number for the log level verbosity
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
Use "helm [command] --help" for more information about a command.
k8s集群rbac权限设置
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
在k8s集群内安装Tiller
helm init --upgrade --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.9.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
要是上面这个命令报错:
$HELM_HOME has been configured at /root/.helm.
Error: error installing: the server could not find the requested resource
这说明api的版本有些落后,则使用如下命令弄一弄:
helm init --upgrade --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.9.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed '[email protected]: extensions/[email protected]: apps/[email protected]' | kubectl apply -f -
一旦安装完成,使用helm version命令验证客户端和服务器端版本
[[email protected] linux-amd64]# helm version
Client: &version.Version{
SemVer:"v2.9.0", GitCommit:"f6025bb9ee7daf9fee0026541c90a6f557a3e0bc", GitTreeState:"clean"}
Server: &version.Version{
SemVer:"v2.9.0", GitCommit:"f6025bb9ee7daf9fee0026541c90a6f557a3e0bc", GitTreeState:"clean"}
不能出网的内网,如何初始化helm服务?
前面的操作,只是表示Helm已在服务端和客户端就绪,而如果真正应用一个heml chart仓库在k8s中,才能发挥Helm的真正作用。
其实在第5步时,如果没有连上网络,是不能够正常运行的。会报错。
一个连随时联网的网络,按网上大路货操作,就是可以了。但如果在一个封闭的内网呢?网外的任何chart仓库都是不能访问的,那如何玩helm呢?
1,自己启动一个heml仓库空服务
helm serve --address localhost:8005 &
更新第5步的命令如下:
helm init --upgrade --service-account tiller --tiller-image xxx/3rd_part/tiller:v2.9.0 --stable-repo-url http://localhost:8005/
需要helm部署时,从应用的官网下载chart文件
https://github.com/helm/charts/
更新chart后,打包成tgz文件
helm package .
使用heml命令更新到k8s(因为没有chart仓库,可能需要先删除老的,再部署新的)
helm del --purge gitlab-runner
helm install --namespace gitlab --name gitlab-runner gitlab-runner-0.17.0-beta.tgz
一个快捷打包和更新应用的命令
helm package . && helm upgrade gitlab-runner gitlab-runner-0.17.0-beta.tgz
边栏推荐
猜你喜欢
智能风控中台设计与落地
何凯明新作ViTDET:目标检测领域,颠覆分层backbone理念
USB in NRZI to encode the data
JS进阶网页特效(pink老师笔记)
华为IOT平台温度过高时自动关闭设备场景试用
Vscode remote connection server terminal zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting
Invalid revision: 3.18.1-g262b901-dirty
The third phase of the contributor task is wonderful
Fourth Paradigm OpenMLDB optimization innovation paper was accepted by VLDB, the top international database association
开源机器学习数据库OpenMLDB贡献者计划全面启动
随机推荐
关于if(x)和while(x)的解释
Certificate of SearchGuard configuration
MSP430学习总结——时钟UCS
华为IOT设备消息上报和消息下发验证
jdbc接口文档参考,jdbc接口方法逻辑探究
127.0.0.1 已拒绝连接
贡献者任务第三期精彩来袭
Vscode remote connection server terminal zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting
Some formulas for system performance and concurrency
Fourth Paradigm OpenMLDB optimization innovation paper was accepted by VLDB, the top international database association
实时特征计算平台架构方法论和基于 OpenMLDB 的实践
C language implementation guess Numbers (with source code, can be directly run)
如何快速转行做产品经理
红外线应用-红外遥控
品优购项目实战笔记
STM32学习总结(二)——GPIO
Jetpack使用异常问题集锦
Visual studio2019 配置使用pthread
Day 85
USB中用NRZI来编码数据