May 2018
Intermediate to advanced
554 pages
13h 51m
English
gitRepo is a convenient volume type that clones your existing Git repository into a container:
// an example of how to use gitRepo volume type# cat 2-6-6_gitRepo.yamlapiVersion: v1kind: Podmetadata: name: gitrepospec: containers: - image: ubuntu name: ubuntu command: - sleep - "3600" volumeMounts: - mountPath: /app name: app-git volumes: - name: app-git gitRepo: repository: "https://github.com/kubernetes-cookbook/second-edition.git" revision: "9d8e845e2f55a5c65da01ac4235da6d88ef6bcd0"# kubectl create -f 2-6-6_gitRepo.yamlpod "gitrepo" created
In the preceding example, the volume plugin mounts an empty directory and runs the git clone <gitRepo.repolist> to clone the repository into it. Then the Ubuntu container will be able to access ...