Welcome to the Linux Foundation Forum!

PV / PVC mapping issue in lab 3.2

bryonbaker
bryonbaker Posts: 28
edited January 2019 in LFD259 Class Forum

I experienced an annoying issue in lab 3.2 where the allocation of persistent volumes to persistent volume claims was the opposite to what the labs intend. Functionally it has no impact, but the result in step 18 is back-to-front.

NAME                                    STATUS   VOLUME           CAPACITY   ACCESS MODES   STORAGECLASS   AGE
persistentvolumeclaim/nginx-claim0      Bound    task-pv-volume   200Mi      RWO                           13m
persistentvolumeclaim/registry-claim0   Bound    registryvm       200Mi      RWO                           13m

There is a solution to this though. The PersistentVolumeClaim API has a volumeName field that lets you define which persistent volume a claim should use. This would be a useful addition to the labs.
The YAML for one of them follows:

    - apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: registry-claim0
        name: registry-claim0
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 100Mi
        volumeName: task-pv-volume
      status: {} 

Categories

Upcoming Training