xuyuji9000 / kubernetes-playground

1 stars 0 forks source link

Deploy Jenkins on Aliyun Kubernetes with Persistent Volume #16

Closed xuyuji9000 closed 5 years ago

xuyuji9000 commented 5 years ago

Prepare PVC PVC not needed now, letting helm take over the dynamic assignment

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: jenkins
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: alicloud-disk-efficiency-shanghai-e
  resources:
    requests:
      storage: 20Gi
xuyuji9000 commented 5 years ago

Install Jenkins

# New PV
SET_PARAMETER="persistence.enabled=true,persistence.storageClass=alicloud-disk-efficiency-shanghai-e,persistence.size=20Gi,master.ingress.enabled=true,master.ingress.hostName=jenkins.yogiman.cn,master.serviceType=ClusterIP"

# Existing PVC
SET_PARAMETER="persistence.enabled=true,persistence.existingClaim=jenkins,master.ingress.enabled=true,master.ingress.hostName=jenkins.yogiman.cn,master.serviceType=ClusterIP"

helm install --namespace jenkins  --set ${SET_PARAMETER} \
--name jenkins \
stable/jenkins

P.S.

Startup time: 23min

xuyuji9000 commented 5 years ago

Monitoring initContainer log

kubectl logs -n jenkins -f  jenkins-cfbc94595-sfjgx -c copy-default-config
xuyuji9000 commented 5 years ago

Get Jenkins admin password:

kubectl get secret jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 -D
xuyuji9000 commented 5 years ago

How to persist data across deployment?

xuyuji9000 commented 5 years ago

Aliyun Internet performance

Hosted by China Telecom ZheJiang Branch (Hangzhou) [4.91 km]: 5.995 ms
Testing download speed................................................................................
Download: 112.99 Mbit/s
Testing upload speed......................................................................................................
Upload: 4.18 Mbit/s
xuyuji9000 commented 5 years ago

Deleted the Helm installed Jenkins and reinstall with existingClaim, the data persisted.