Kubernetes: Is it possible to mount volumes to a container running as a CronJob?

A CronJob uses a PodTemplate as everything else based on Pods and can use Volumes. You placed your Volume specification directly in the CronJobSpec instead of the PodSpec, use it like this: apiVersion: batch/v1beta1 kind: CronJob metadata: name: update-db spec: schedule: “*/1 * * * *” jobTemplate: spec: template: spec: containers: – name: update-fingerprints image: … Read more

Kubernetes – pod has unbound immediate PersistentVolumeClaims

PersistentVolumeClaims will remain unbound indefinitely if a matching PersistentVolume does not exist. The PersistentVolume is matched with accessModes and capacity. In this case capacity the PV is 10Gi whereas PVC has capacity of 3Gi. The capacity in the PV needs to same as in the claim i.e 3Gi to fix the unbound immediate PersistentVolumeClaims issue.

Kubernetes NFS Persistent Volumes – multiple claims on same volume? Claim stuck in pending?

Basically you can’t do what you want, as the relationship PVC <–> PV is one-on-one. If NFS is the only storage you have available and would like multiple PV/PVC on one nfs export, use Dynamic Provisioning and a default storage class. It’s not in official K8s yet, but this one is in the incubator and … Read more

Kubernetes Persistent Volume Claim Indefinitely in Pending State

I quickly realized that PersistentVolumeClaim defaults the storageClassName field to standard when not specified. However, when creating a PersistentVolume, storageClassName does not have a default, so the selector doesn’t find a match. The following worked for me: kind: PersistentVolume apiVersion: v1 metadata: name: models-1-0-0 labels: name: models-1-0-0 spec: capacity: storage: 200Gi storageClassName: standard accessModes: – … Read more

Kubernetes: Can’t delete PersistentVolumeClaim (pvc)

This happens when persistent volume is protected. You should be able to cross verify this: Command: kubectl describe pvc PVC_NAME | grep Finalizers Output: Finalizers: [kubernetes.io/pvc-protection] You can fix this by setting finalizers to null using kubectl patch: kubectl patch pvc PVC_NAME -p ‘{“metadata”:{“finalizers”: []}}’ –type=merge Ref; Storage Object in Use Protection

What is the difference between persistent volume (PV) and persistent volume claim (PVC) in simple terms?

From the docs PVs are resources in the cluster. PVCs are requests for those resources and also act as claim checks to the resource. So a persistent volume (PV) is the “physical” volume on the host machine that stores your persistent data. A persistent volume claim (PVC) is a request for the platform to create … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)