19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 ■ Using Volumes

Figure 6-22. Obtaining the commit revision number

Using a gitRepo Volume

Create a pod specification file pod.yaml in which to use the gitRepo volume:

sudo vi pod.yaml

Copy the following listing into pod.yaml. The repository and revision strings are kept empty in the

following listing, and values obtained from a user repository should be substituted.

---

apiVersion: v1

kind: Pod

metadata:

name: server

spec:

containers:

-

image: nginx

name: nginx

volumeMounts:

-

mountPath: /git-repo

name: git-volume

149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!