The PersistentVolumeClaim "Pvc-volume" is invalid: metadata.name: Invalid value: "Pvc-volume": a DNS-1123 subdomain must consist of lower case alphanumeric characters,

0 votes

Hi Guys,

I am trying to create one persistent volume claim in kubernetes. But it shows me the below error.

$ kubectl apply -f pvc.yml
The PersistentVolumeClaim "Pvc-volume" is invalid: metadata.name: Invalid value: "Pvc-volume": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Here I have created one yml file as given below.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: Pvc-volume
  labels:
    name: Pvc-volume
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi
May 22 in Kubernetes by akhtar
• 11,250 points
35 views

1 answer to this question.

0 votes

Hi@akhtar,

when you write yml code in kubernetes, you can't use capital letters in name and labels keyword. In above code, you have written Pod-volume in name and label section. So you have to change this value.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-volume
  labels:
    name: pvc-volume
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi
answered May 22 by MD
• 24,500 points

Related Questions In Kubernetes

0 votes
1 answer

How to determine what is the status of a deployment ?

You could use kubectl get deployment <deployment>.  If ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 53,110 points
74 views
0 votes
1 answer

Increasing the shm size of a kubernetes container

You cannot achieve this in kubernetes pod. ...READ MORE

answered Sep 12, 2018 in Kubernetes by ajs3033
• 7,280 points
2,540 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
6,640 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,850 points

reshown Apr 12, 2019 by Kalgi 1,972 views