K8S deployment helm

Environmental Science

Reference: https://docs.helm.sh/using/installing-helm

Mirror image required


Rename a tag

docker pull xsllqs/kubernetes-helm:v2.7.0
docker tag xsllqs/kubernetes-helm:v2.7.0 gcr.io/kubernetes-helm/tiller:v2.7.0

Upload to private warehouse

docker tag xsllqs/kubernetes-helm:v2.7.0
docker push

Each node downloads and renames the node

docker pull
docker tag gcr.io/kubernetes-helm/tiller:v2.7.0

I. install helm client and tiller

Modify environment variables

vim /etc/bashrc
export PATH="$PATH:/usr/local/bin"
vim /etc/profile
export PATH="$PATH:/usr/local/bin"
source /etc/profile

RBAC authorization

kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'


cd /opt/helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
helm init --tiller-namespace=kube-system

Check whether tiller is installed successfully

kubectl get pods --namespace kube-system

Test whether the Client and Server are connected properly

helm version


kubectl delete deployment tiller-deploy --namespace kube-system

Web UI installation (I have not deployed)

helm install stable/nginx-ingress
helm install stable/nginx-ingress --set controller.hostNetwork=true
helm repo add monocular https://kubernetes-helm.github.io/monocular
helm install monocular/monocular

Add domestic available warehouse

helm repo add opsgoodness http://charts.opsgoodness.com

II. Application installation and deletion

Install redis application

helm install stable/redis-ha --version 0.2.3

If the above can't be executed, directly execute the following contents

helm install https://kubernetes-charts.storage.googleapis.com/redis-ha-0.2.3.tgz

Visit redis

redis-cli -h torrid-tuatara-redis-ha.default.svc.cluster.local

Install kafka application

helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com
helm install incubator/kafka --version 0.2.1


helm install https://kubernetes-charts-incubator.storage.googleapis.com/kafka-0.2.1.tgz

Delete deployed apps

helm ls
helm delete {name}

Tags: Linux Kubernetes Docker Redis kafka

Posted on Fri, 29 Nov 2019 07:37:45 -0800 by shatteredroses