0

I would like to setup a Kubernetes cluster as follows: enter image description here

Kubernetes will be installed on top of VMs depicted in pink.

I am going to use statefulsets or replicasets to deploy Jenkins master and Jenkins executors. I would like that the workspace folder on the Jenkins master to be always in sync on all replicas in eventuality of losing any worker VMs or server.

Can be achieved using internal mechanisms of replicasets or statefulsets or is any other way of keeping the workspace in sync?

Thank you,

Albert

Albert
  • 191
  • 1
  • 3
  • 23
  • How did you deploy your cluster? Are you using bare metal or some cloud providor? Have you deployed anything yet? Make sure, that you can't sync pods: https://stackoverflow.com/questions/55114121/how-pod-replicas-sync-with-each-other-kubernetes. Statefulset could help you. You can read about it more [here](https://www.magalix.com/blog/kubernetes-statefulsets-101-state-of-the-pods#:~:text=A%20StatefulSet%20is%20another%20Kubernetes,more%20suited%20for%20stateful%20apps.&text=By%20nature%2C%20a%20StatefulSet%20needs,state%20and%20data%20across%20restarts.) – Mikołaj Głodziak Jun 18 '21 at 11:58
  • @MikołajGłodziak: Thanks for your answer. I am using bare metal servers and I haven't deployed anything yet. I am thinking the solution at the moment. I will checkout the links meanwhile. – Albert Jun 18 '21 at 12:56

1 Answers1

2

You can't just assume that statefulset will do the job for you. You can configure a NFS server and point the PV to it and bind your PVC to this PV and your STS can point to your PVC. So, basically

STS -> PVC -> PV -> NFS Server

So, even if one worker node goes down, it won't impact the others.

Nish
  • 922
  • 13
  • 31