![install kubernetes cluster habr install kubernetes cluster habr](https://web-wekeo-files.vercel.app/creating-a-kubernetes-cluster-02-add.png)
The livenessProbe and readinessProbe sections declare probes that restart failed pods and detect when pods are ready.Įxit the file and save the changes. The volumeMounts section of the file mounts the persistent volume created in the previous step. The deployment file in this example utilizes the jenkins/jenkins:lts Docker image and creates 1 replica that is going to be exposed on port 8080. kubectl apply -f volume-jenkins.yaml Create and Apply Jenkins Deployment FileĬreate a YAML file to store Jenkins deployment information. The example above uses minikube, so the name of the node is minikube. Note: The values item in the nodeAffinity section should provide the name of the node Jenkins will use. Provisioner: kubernetes.io/no-provisioner
![install kubernetes cluster habr install kubernetes cluster habr](https://miro.medium.com/max/1177/0*Vu9u8x8M-dYKjkO0.jpg)
The second section defines the jenkins-pv persistent volume, while the third creates a persistent volume claim jenkins-pvc that will be bound to the jenkins-pv volume. In the first section, the file declares the local-storage storage class. Create a YAML file that will define storage-related components of the deployment: nano volume-jenkins.yaml
![install kubernetes cluster habr install kubernetes cluster habr](https://miro.medium.com/max/512/1*UgLBFNXYHspq3B8Wg6yV9Q.jpeg)
The role of a persistent volume is to store basic Jenkins data and preserve it beyond the lifetime of a pod. kubectl apply -f sa-jenkins.yaml Create Jenkins Persistent Volume and Persistent Volume Claim Apply the configuration with kubectl apply. It also creates a new service account named admin and binds it with the previously defined cluster role. The file defines the cluster role with administrative permissions. Use a text editor to create a YAML file where you will store the service account declarations: nano sa-jenkins.yaml Service accounts provide identities that are used to control pod processes.