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,260 points
1,677 views

1 answer to this question.

0 votes

Hi@akhtar,

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
metadata:
  name: lwpvc1
spec:
  resources:
    requests:
      storage: 20Gi
  accessModes:
    - 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,460 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,350 points
829 views
+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
15,558 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,350 points
1,422 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,460 points

edited Oct 6, 2021 by Sarfaraz 4,210 views
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,460 points
1,226 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP