openshift / pipelines-tutorial

A step-by-step tutorial showing OpenShift Pipelines
Apache License 2.0
298 stars 623 forks source link

Pipeline run fails with PVC issue #42

Closed wernertod closed 4 years ago

wernertod commented 4 years ago

I set up the tutorial pipeline on OCP 4.2 using the provided instructions. Afterwards, the pipeline looks as expected, with all checks returning the expected results. When I run the pipline though, the run fails, because a PVC cannot be bound to a PV:

kind: PersistentVolumeClaim apiVersion: v1 metadata: name: petclinic-deploy-pipeline-run-nl62q-pvc namespace: pipelines-tutorial selfLink: >- /api/v1/namespaces/pipelines-tutorial/persistentvolumeclaims/petclinic-deploy-pipeline-run-nl62q-pvc uid: 41bae36f-104a-11ea-8e86-00000a10063b resourceVersion: '5774327' creationTimestamp: '2019-11-26T12:42:50Z' ownerReferences:

Error event: PVCpetclinic-deploy-pipeline-run-nl62q-pvc NamespaceNSpipelines-tutorial Nov 26, 1:47 pm Generated from persistentvolume-controller 19 times in the last 4 minutes no persistent volumes available for this claim and no storage class is set

I created a PV beforehand to service the PVC bind (no storageClass, volume mode Filesystem), but it doesn't get used:

kind: PersistentVolume apiVersion: v1 metadata: name: pipeline-storage selfLink: /api/v1/persistentvolumes/pipeline-storage uid: 02156811-102a-11ea-b7cb-00000a10063a resourceVersion: '5772668' creationTimestamp: '2019-11-26T08:51:59Z' finalizers:

How can I get this resolved?

raffamendes commented 4 years ago

Hi, can you please change the spec of you PV to the following to see if it works? Just make sure you change the path

spec:
  capacity:
    storage: 100Gi
  hostPath:
    path: /mnt/pv-data/pv0002
    type: ''
  accessModes:
    - ReadWriteOnce
    - ReadWriteMany
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Recycle
  volumeMode: Filesystem
wernertod commented 4 years ago

Interesting! With hostPath it worked: [deploy : oc] deploymentconfig.apps.openshift.io/spring-petclinic rolled out

Now the big question is: why did the NFS exported storage on the inf node not work. I copied the configuration from the registry-storage PV. Is this maybe related to the accessModes? My PV has ReadWriteMany and the PVC from the tutorial has ReadWriteOnce.

wernertod commented 4 years ago

Turns out it was the accessModes. Once I set all three in the PV (I'm guessing that the ReadWriteOnce was the crucial one), the PVC bind also worked for the nfs PV. Thanks @raffamendes !

raffamendes commented 4 years ago

Happy to help!!, just to clarify, the accessModes works on 4.2 as labels to actually match the PVC as per the docs I'll close this issue since the problem was solved.

/close

openshift-ci-robot commented 4 years ago

@raffamendes: You can't close an active issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/pipelines-tutorial/issues/42#issuecomment-558703900): >Happy to help!!, just to clarify, the ```accessModes``` works on 4.2 as labels to actually match the PVC as per the [docs](https://docs.openshift.com/container-platform/4.2/storage/persistent-storage/persistent-storage-nfs.html#persistent-storage-nfs-provisioning_persistent-storage-nfs) >I'll close this issue since the problem was solved. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
raffamendes commented 4 years ago

ops, for a moment I forgot this not the tekton github :sweat_smile:

wernertod commented 4 years ago

No problem, I close it. Thanks again! :-)