您好,登錄后才能下訂單哦!
helm的三個核心概念:
helm安裝有四種方式:
helm install stable/mysql
helm install mysql-2.3.tgz
helm install mysql/
helm install http://127.0.0.1:8879/charts/mysql
首先查找包,如想要安裝mysql,helm search mysql
,mysql是個關鍵字,如果一個chart中的chart.yaml文件內定義了這個關鍵字,則可以被搜索到.
$ helm search mysql
NAME CHART VERSION APP VERSION DESCRIPTION
stable/mysql 1.3.0 5.7.14 Fast, reliable, scalable, and easy to use open-source rel...
stable/mysqldump 2.5.0 2.4.1 A Helm chart to help backup MySQL databases using mysqldump
stable/prometheus-mysql-exporter 0.5.1 v0.11.0 A Helm chart for prometheus mysql exporter with cloudsqlp...
stable/percona 1.1.0 5.7.17 free, fully compatible, enhanced, open source drop-in rep...
stable/percona-xtradb-cluster 1.0.0 5.7.19 free, fully compatible, enhanced, open source drop-in rep
查看安裝包的內容,helm inspect -h, helm inspect values 只查看暴露的自定義參數, 或者直接helm fetch下載此安裝包至當前目錄.
$ helm inspect values stable/mysql
## mysql image version
## ref: https://hub.docker.com/r/library/mysql/tags/
##
image: "mysql"
imageTag: "5.7.14"
busybox:
image: "busybox"
tag: "1.29.3"
testFramework:
image: "dduportal/bats"
tag: "0.4.0"
## Specify password for root user
##
## Default: random 10 character string
# mysqlRootPassword: testing
helm template $chartsName
輸出K8s的資源文件,參數與install一樣.使用--dry-run --debug
來模擬安裝過程并打印配置信息.
cat << EOF > config.yaml
mariadbUser: user0
mariadbDatabase: user0db
EOF
helm install stable/mysql -f configure.yaml --set service.nodePort=31313
# 只查看安裝過程中的文件,不進行實際安裝.
helm install stable/mysql -f configure.yaml --set service.nodePort=31313 --debug --dry-run
# 輸出對應k8s的yaml文件
helm template stable/mysql -f configure.yaml --set service.nodePort=31313
$ helm ls
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
gilded-mule 6 Wed Jul 17 10:31:33 2019 DEPLOYED minio-2.5.0 RELEASE.2019-05-14T23-57-45Z default
hopping-rottweiler 1 Wed Jul 17 10:06:06 2019 FAILED minio-2.5.0 RELEASE.2019-05-14T23-57-45Z default
modest-tuatara 1 Wed Jul 17 10:09:30 2019 FAILED qujun-2.5.0 RELEASE.2019-05-14T23-57-45Z default
查看release當前安裝的資源狀態,helm status $releaseName.
$ helm status gilded-mule
LAST DEPLOYED: Wed Jul 17 10:31:33 2019
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
gilded-mule-minio 1 68m
==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
gilded-mule-minio Pending 68m
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
gilded-mule-minio-84f85fff78-rv6r6 0/1 Pending 0 68m
==> v1/Secret
NAME TYPE DATA AGE
gilded-mule-minio Opaque 2 68m
...........
查看release詳細信息,heml get $releasename, 查看對應k8s的yaml文件, helm get manifest $releaseName.查看安裝時自定義的value.heml get values $releasename
$ helm get gilded-mule
REVISION: 6
RELEASED: Wed Jul 17 10:31:33 2019
CHART: minio-2.5.0
USER-SUPPLIED VALUES:
service:
nodePort: 31312
COMPUTED VALUES:
DeploymentUpdate:
maxSurge: 100%
maxUnavailable: 0
type: RollingUpdate
StatefulSetUpdate:
updateStrategy: RollingUpdate
......
# 查看這個release安裝時自定義的參數.
$ helm get values gilded-mule
service:
nodePort: 31312
helm upgrade --set service.nodePort=31312 gilded-mule stable/minio
helm rollback gilded-mule 1
helm hisotry gilded-mule
helm delete $releaseName
helm list --all
mkdir -p ~/my-repo
nohup helm serve --address 127.0.0.1:8879 --repo-path ~/my-repo &
# 此時會在mys-repo下新建一個index.html文件
helm repo add my-repo http://127.0.0.1:8879
在自己倉庫中添加包,更新index
# 先去github上下載charts
cp -r mysql ~/my-repo
cd ~/my-repo
helm package mysql --save=false
helm repo index --url=http://127.0.0.1:8879 .
helm create my-charts
,修改對應內容helm install . 或 helm install my-charts.tgz
helm inspect chart my-charts
helm inspect values my-charts
helm inspect my-charts
helm template my-charts -f configfile --set a=b
注意: 如果tiller的serviceaccount只有自己namespace的權限,那么charts中的namespaces也需要指定在tiller的namespaces中.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。