How to create one PVC in Kubernetes Cluster

0 votes

Hi Guys,

I am new to Kubernetes. I have launched one Pod and deploy HTTPd webserver. But when I updated my Pod all the previous data erased automatically. So I want to implement persistent volume concept. Can anyone tell me how can I do that?

Jul 6, 2020 in Kubernetes by akhtar
• 38,210 points

1 answer to this question.

0 votes


In Kubernetes, no command is available to create PVC directly. You need to create one YML file and create one script for PVC. I have attached one example below for your reference.

apiVersion: v1
kind: PersistentVolumeClaim
  name: lwpvc1
      storage: 20Gi
    - ReadWriteOnce

Copy this code in a YML file and run the below-given command.

$ kubectl create -f file_name

It will automatically create one PVC for you.

answered Jul 6, 2020 by MD
• 95,300 points

Related Questions In Kubernetes

0 votes
2 answers
0 votes
1 answer

Trying to create Kubernetes cluster inside existing vpc in aws

You can add this ENV variable  export VPC_ID=vpc-YOURID READ MORE

answered Oct 17, 2018 in Kubernetes by Kalgi
• 52,370 points
+1 vote
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
+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
• 52,370 points

reshown Apr 12, 2019 by Kalgi 3,465 views
0 votes
1 answer

How to create token for worker node in Kubernetes Cluster?

Hi@akhtar, You will get your token when you ...READ MORE

answered Sep 16, 2020 in Kubernetes by MD
• 95,300 points
0 votes
1 answer

How to create deployment build in kubernetes?

Hi@akhtar, To create any resources in kubernetes you ...READ MORE

answered May 18, 2020 in Kubernetes by MD
• 95,300 points