k8s_basic_storage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
k8s_basic_storage [2020/05/25 12:38] – [Create a Pod with Dynamic Provisioning] andonovjk8s_basic_storage [2020/05/25 12:49] (current) – [Dynamic Provisioning] andonovj
Line 242: Line 242:
  
 =====Dynamic Provisioning===== =====Dynamic Provisioning=====
-Let's configure Dynamic storage.+Let's configure Dynamic storage. The idea here is that, we (as administrators) care only of the PVC, NOT the PV. So we create the PVC and the provisioner creates teh PV himself. 
 Now, for Dynamic provisioning with NFS I had to re-configure the cluster. In a nutshell make sure that teh API IP which you give when you initiate the cluster has the same subnet of the pod network.  Now, for Dynamic provisioning with NFS I had to re-configure the cluster. In a nutshell make sure that teh API IP which you give when you initiate the cluster has the same subnet of the pod network. 
  
Line 586: Line 587:
 nfs-provisioner-7795cf6f4-d7m2l   1/    Running            67m     192.168.247.1   node-2   <none>           <none> nfs-provisioner-7795cf6f4-d7m2l   1/    Running            67m     192.168.247.1   node-2   <none>           <none>
 ubuntu@k8s-master:~/external-storage/nfs/deploy/kubernetes$ ubuntu@k8s-master:~/external-storage/nfs/deploy/kubernetes$
 +</Code>
 +
 +Even an ubuntu pod:
 +<Code:bash|ubuntu pod>
 +ubuntu@k8s-master:~$ cat pod.yml
 +apiVersion: v1
 +kind: Pod
 +metadata:
 +  name: first-pod
 +spec:
 +  volumes:
 +    - name: fast10m
 +      persistentVolumeClaim:
 +        claimName: nfs
 +  containers:
 +    - name: ctr1
 +      image: ubuntu:latest
 +      command:
 +      - /bin/bash
 +      - "-c"
 +      - "sleep 60m"
 +      volumeMounts:
 +      - mountPath: "/data"
 +        name: fast10m
 +ubuntu@k8s-master:~$ kubectl get pods -o wide
 +NAME                              READY   STATUS    RESTARTS   AGE     IP               NODE     NOMINATED NODE   READINESS GATES
 +first-pod                         1/    Running            24s     192.168.84.131   node-1   <none>           <none>
 +nfs-nginx-6b4db6f57-4mczr         1/    Running            4m16s   192.168.247.2    node-2   <none>           <none>
 +nfs-provisioner-7795cf6f4-d7m2l   1/    Running            69m     192.168.247.1    node-2   <none>           <none>
 +ubuntu@k8s-master:~$
 </Code> </Code>
  
 Eurika, finally we are done with both types of privisioning Eurika, finally we are done with both types of privisioning
  • k8s_basic_storage.1590410320.txt.gz
  • Last modified: 2020/05/25 12:38
  • by andonovj