2

I've installed Jenkins on GKE using Bitnami Chart and it is online.

When I want to adjust it using helm upgrade, Kubernetes brings up a new instance while leaving the other running (as expected), but the new instance fails to come up with

   Warning  FailedAttachVolume  18m                attachdetach-controller  Multi-Attach error for volume "pvc-b3d609b3-ec10-4966-8713-595702220c40" Volume is already used by pod(s) jenkins-9ddcc795c-vflvm                                                         
   Warning  FailedMount         11m                kubelet                  Unable to attach or mount volumes: unmounted volumes=[jenkins-data[], unattached volumes=[default-token-2qsvk jenkins-data]: timed out waiting for the condition 

This error makes sense - two instances can't share storage.

If I take down the first instance, then it comes right back. If I helm uninstall, both instances are deleted including the storage.

What is the proper process to upgrade versions/update chart settings?

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
jws
  • 2,171
  • 19
  • 30
  • Is `kubectl delete deployments.apps jenkins` - which takes down Jenkins - the way? (Take down Jenkins then `helm upgrade`) – jws Aug 03 '21 at 18:22

1 Answers1

1

You can delete the deployment of Jenkin first if you will delete the deployment other components will be there along with the storage disk which can reattached to the new deployment

kubectl delete deployments.apps jenkins

https://artifacthub.io/packages/helm/bitnami/jenkins#upgrading

and run command to upgrade the helm chart by updating the value file and using --set.

helm upgrade jenkins bitnami/jenkins --set jenkinsPassword=$JENKINS_PASSWORD --set jenkinsHome=/bitnami/jenkins/jenkins_home
Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • I had hoped for an update method that wasn't so impactful to the service. I was wondering if changing the storage to NFS-type, which would allow multiple nodes concurrent access, would be safe. (And... how exactly to do it) – jws Aug 03 '21 at 18:49
  • that's also good idea but i have not tested it. NFS will support the `read-write many` in that case you might need to do changes into the helm chart also. ideally it should have to work conceptually – Harsh Manvar Aug 03 '21 at 18:52
  • yes, can use the NFS also : https://www.jenkins.io/doc/book/installing/kubernetes/#create-a-persistent-volume – Harsh Manvar Aug 03 '21 at 18:55