Slide 1
Excellent Education Program
Innovative Methods of Teaching

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 3
Learning Through Play
Find a Class for your Children

Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis.

previous arrow
next arrow

Kubernetes PersistentVolume, PersistentVolumeClaim, volume using hostPath

Spread the Knowledge

pv.yaml

kind: PersistentVolume
apiVersion: v1
metadata:
  name: hostpath
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/tmp/devopsschool"

$ kubectl create -f pv.yaml
$ kubectl get pv

pvc.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvchostpath
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

$ kubectl create -f pvc.yaml
$ kubectl get pvc

pod.yaml

kind: Pod
apiVersion: v1
metadata:
  name: task-pv-pod
spec:
  containers:
    - name: task-pv-container
      image: scmgalaxy/nginx-devopsschoolv1
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
        - mountPath: "/usr/share/nginx/html"
          name: task-pv-storage
  volumes:
    - name: task-pv-storage
      persistentVolumeClaim:
        claimName: pvchostpath

$ kubectl create -f pod.yaml
$ kubectl get pods -o wide
$ vi /tmp/devopsschool/index.html
$ curl http://ip-add

Rajesh Kumar
Latest posts by Rajesh Kumar (see all)