Helm 安装 Chart 到 Kubernetes

Helm Kubernetes About 1,847 words

创建 Chart

helm create chart-demo

输出

PS D:\> helm create chart-demo
Creating chart-demo

安装 Chart

直接安装

helm install chart-demo .\chart-demo\

输出

PS D:\> helm install chart-demo .\chart-demo\
NAME: chart-demo
LAST DEPLOYED: Fri Sep  9 15:44:28 2022
NAMESPACE: dev
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace dev -l "app.kubernetes.io/name=chart-demo,app.kubernetes.io/instance=chart-demo" -o jsonpath="{.items[0].metadata.name}")
  export CONTAINER_PORT=$(kubectl get pod --namespace dev $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl --namespace dev port-forward $POD_NAME 8080:$CONTAINER_PORT

打包安装

打包

helm package .\chart-demo\

输出

PS D:\> helm package .\chart-demo\
Successfully packaged chart and saved it to: D:\helm\chart-demo-0.1.0.tgz

安装

helm install chart-demo .\chart-demo-0.1.0.tgz

输出

PS D:\> helm install chart-demo .\chart-demo-0.1.0.tgz
NAME: chart-demo
LAST DEPLOYED: Fri Sep  9 16:13:23 2022
NAMESPACE: dev
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace dev -l "app.kubernetes.io/name=chart-demo,app.kubernetes.io/instance=chart-demo" -o jsonpath="{.items[0].metadata.name}")
  export CONTAINER_PORT=$(kubectl get pod --namespace dev $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl --namespace dev port-forward $POD_NAME 8080:$CONTAINER_PORT

升级或安装

helm upgrade --install <release name> --values <values file> <chart directory>

卸载

helm uninstall chart-demo

输出

PS D:\helm> helm uninstall chart-demo
release "chart-demo" uninstalled
Views: 1,357 · Posted: 2022-11-24

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh