Creating Deployment for Attaching Claimed Volumes to Pods
Learn to create a Jenkins deployment for attaching claimed volumes to Pods and look into the sequence of associated events.
We'll cover the following...
In the previous lesson, we looked into claiming the persistent volumes. The next step is to attach these claimed volumes to pods.
Looking into the definition
Let’s look into a Jenkins
definition:
Press + to interact
cat pv/jenkins-pv.yml
The relevant parts of the output as as follows:
Press + to interact
...apiVersion: apps/v1kind: Deploymentmetadata:name: jenkinsnamespace: jenkinsspec:...template:...spec:containers:- name: jenkins...volumeMounts:- name: jenkins-homemountPath: /var/jenkins_home...volumes:- name: jenkins-homepersistentVolumeClaim:claimName: jenkins...
You’ll notice that this time, we add a new volume jenkins-home
, which references the PersistentVolumeClaim called jenkins
. From the container’s perspective, the claim is a ...