1.1. Helm部署
1.1.1. 安装Helm
1.部署Helm客户端
[root@linux-node1 ~]# cd /usr/local/src
[root@linux-node1 src]# wget https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz
[root@linux-node1 src]# tar zxf helm-v3.2.4-linux-amd64.tar.gz
[root@linux-node1 src]# mv linux-amd64/helm /usr/local/bin/
2.验证安装是否成功
[root@linux-node1 ~]# helm version
version.BuildInfo{Version:"v3.2.4", GitCommit:"b29d20baf09943e134c2fa5e1e1cab3bf93315fa", GitTreeState:"clean", GoVersion:"go1.13.7"}
1.1.2. 使用Helm部署第一个应用
3.添加仓库
[root@linux-node1 ~]# helm repo list
[root@linux-node1 ~]# helm repo add stable http://mirror.azure.cn/kubernetes/charts/
[root@linux-node1 ~]# helm repo update
4.搜索Helm应用
[root@linux-node1 helm-nginx]# helm search repo jenkins
NAME CHART VERSION APP VERSION DESCRIPTION
ali-stable/jenkins 0.13.5 2.73 Open source continuous integration server. It s...
5.安装第一个应用
[root@linux-node1 ~]# helm install ali-stable/jenkins
NAME: viable-seal
LAST DEPLOYED: Thu Jul 26 19:21:07 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
viable-seal-jenkins 3 1s
viable-seal-jenkins-tests 1 1s
==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
viable-seal-jenkins Pending 1s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
viable-seal-jenkins-agent ClusterIP 10.1.154.54 <none> 50000/TCP 1s
viable-seal-jenkins LoadBalancer 10.1.63.24 <pending> 8080:20031/TCP 0s
==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
viable-seal-jenkins 1 1 1 0 0s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
viable-seal-jenkins-7f5c7bd8d4-gc5hv 0/1 Pending 0 0s
==> v1/Secret
NAME TYPE DATA AGE
viable-seal-jenkins Opaque 2 1s
NOTES:
1. Get your 'admin' user password by running:
printf $(kubectl get secret --namespace default viable-seal-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
2. Get the Jenkins URL to visit by running these commands in the same shell:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace default -w viable-seal-jenkins'
export SERVICE_IP=$(kubectl get svc --namespace default viable-seal-jenkins --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
echo http://$SERVICE_IP:8080/login
3. Login with the password from step 1 and the username: admin
For more information on running Jenkins on Kubernetes, visit:
https://cloud.google.com/solutions/jenkins-on-container-engine