0

I need to copy files from a git repo to a persistent disk on google cloud, as part of the automated deployment process with "google cloud build".

How can I use persistent volume claims or mount nfs shares in cloud build yaml ?

I already achieved copying files from /workspace to the pod running the nfs server by using "kubectl cp", but kubectl's cp is limited, it doesn't support directory exclusion and doesn't have sync capabilities like rsync does.

In summary, how can I mount an nfs share with google cloud build ?

1 Answers1

0

If you just want to maintain files from the git repo, you could store your artifacts in Cloud Storage. This is an example of how to store multiple artifacts in Cloud Storage:

steps:    
- name: 'gcr.io/cloud-builders/javac'
  args: ['HelloWorld.java']
artifacts:
 objects:
 location: 'gs://[STORAGE_LOCATION]/'
 paths: ['HelloWorld.java', 'HelloWorld.class', 'cloudbuild.yaml']

Besides you can use wildcards while sending the files to Cloud Storage. This will help you with the directory exclusion requirement. Later on you could pull the files using one of the client libraries from the Kubernetes service.

Glorfindel
  • 1,213
  • 4
  • 15
  • 22