Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Created January 21, 2020 21:59
Show Gist options
  • Save pritidesai/d4622511daa479814fad10714541db93 to your computer and use it in GitHub Desktop.
Save pritidesai/d4622511daa479814fad10714541db93 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
resources:
requests:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: custom-volume-taskrun
spec:
workspaces:
- name: custom
persistentVolumeClaim:
claimName: my-pvc
subPath: my-subdir
tasks:
- name: my-workspace-task
taskSpec:
steps:
- name: write
image: ubuntu
script: echo $(workspaces.custom.volume) > $(workspaces.custom.path)/foo
- name: read
image: ubuntu
script: cat $(workspaces.custom.path)/foo | grep $(workspaces.custom.volume)
workspaces:
- name: custom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment