k8s-helm-v3 Installation management

https://helm.sh/blog/helm-3-released/ website helm3

https://hub.helm.sh/ helm Warehouse

One Common commands

1 helm install

https://github.com/helm/helm/releases/tag/v3.1.2 Download address

1 download 3.0 Version of , Then decompress , hold helm Command to move to /usr/local/bin Below directory

2 see helm edition

helm version


2 Configure download source


helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts


helm repo remove 127854-hnf

3 View download source


[[email protected] helm-v3]# helm repo list
NAME   URL                                                   
stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts


4 Query for pod

helm search repo weave # Followed by the name of the software you are looking for

helm search repo weave
NAME               CHART VERSION APP VERSION DESCRIPTION                                       
stable/weave-cloud 0.1.2                     Weave Cloud is a add-on to Kubernetes which pro...
stable/weave-scope 0.9.2         1.6.5       A Helm chart for the Weave Scope cluster visual...


5 Install a mirror ( service )

helm install ui stable/weave-scope # among ui For the name


[[email protected] helm-v3]# helm install ui stable/weave-scope
NAME: ui
LAST DEPLOYED: Fri Apr  3 18:15:36 2020
NAMESPACE: default
STATUS: deployed
You should now be able to access the Scope frontend in your web browser, by
using kubectl port-forward:
kubectl -n default port-forward $(kubectl -n default get endpoints \
ui-weave-scope -o jsonpath='{.subsets[0].addresses[0].targetRef.name}') 8080:4040
then browsing to http://localhost:8080/.
For more details on using Weave Scope, see the Weave Scope documentation:

And then change it svc The type of ,nodeport, Then go to the browser and visit :nodeip+ port


Two Create your own mychart

1 establish mychart


helm create mychart

Then go in mychart/templates/ Under this directory , To create two basic files ,deployment and service


2 helm install tomcat

  • install

Back to follow mychart Execute under the same level directory

[[email protected] helm-v3]# helm install tomcat mychart/
NAME: tomcat
LAST DEPLOYED: Fri Apr  3 18:40:18 2020
NAMESPACE: default
STATUS: deployed


And then check out pod and svc Go to the browser and visit tomcat page

  • Delete

helm delete -f mychart/templtes


  • upgrade ( It's over yaml File and then reapply )

helm upgrade tomcat mychart/


  • Capacity expansion

helm upgrade web1 --set replicas=3 mychart/


3、 ... and Render templates with variables

1 Test whether your template is normal


helm install --dry-run tomcat mychart


2 Template in templates Inside ,


values.yaml As a variable :


[[email protected] helm-v3]# cat mychart/values.yaml 
replicas: 2
image: huningfei/tomcat8
tag: v1
label: tomcat
port: 8080



[[email protected] templates]# cat tomcat.yaml 
apiVersion: apps/v1
kind: Deployment # Controller name
  name: {{ .Release.Name }}-dp
  replicas: {{ .Values.replicas }} # Copy number
      app:  {{ .Values.label }}
        app: {{ .Values.label }}
      - name: tomcat
        image:  {{ .Values.image }}:{{ .Values.tag }} # Mirror image 

svc Templates


[[email protected] templates]# cat service_tomcat.yaml 
apiVersion: v1
kind: Service
  name: {{ .Release.Name }}-svc
  type: NodePort
   - port: 8080
     targetPort: {{ .Values.port}}
    app: {{ .Values.label }}

The variables in both files are from values.yaml From inside

Release.Name representative helm install The name behind it


3 Capacity expansion, capacity reduction, and rollback

helm upgrade web1 --set replicas=3 mychart/


Before rolling back helm list Check out the next version , And then roll back

helm rollback tomcat1 1 # Name plus version


4 Delete

helm delete name

3 Version does not exist, completely deleted , You can't view the deleted