Sunday, 16 February 2025

Learn Docker Kubernates and create volumes.

    1 kubectl apply -f pv.yaml

   2 kubectl apply -f pvc.yaml

   3 kubectl apply -f n_deploy.yaml

   4 kubectl delete pod -l app=spellrich-nginx

   5 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

   6 Get-ChildItem -Path C:\Users\h\Documents\spellrich

   7 kubectl get pv html-pv

   8 kubectl get pvc html-pvc

   9 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  10 kubectl apply -f pv.yaml

  11 kubectl delete pv html-pv

  12 kubectl apply -f pv.yaml

  13 kubectl apply -f pvc.yaml

  14 kubectl get pv html-pv

  15 kubectl get pvc html-pvc

  16 kubectl delete pod -l app=spellrich-nginx

  17 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  18 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  19 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  20 kubectl delete pv html-pv

  21 kubectl apply -f pv.yaml

  22 kubectl delete pod -l app=spellrich-nginx

  23 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  24 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  25 kubectl delete pod -l app=spellrich-nginx

  26 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  27 docker run --rm -v C:\spellrich:/test busybox ls -lah /test

  28 kubectl delete pvc html-pvc

  29 kubectl delete pv html-pv

  30 kubectl apply -f pv.yaml

  31 kubectl apply -f pvc.yaml

  32 kubectl delete pvc html-pvc

  33 kubectl delete pv html-pv

  34 kubectl apply -f pv.yaml

  35 kubectl apply -f pvc.yaml

  36 kubectl delete pod -l app=spellrich-nginx

  37 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  38 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  39 kubectl get pods -l app=spellrich-nginx -o wide

  40 kubectl describe pod -l app=spellrich-nginx

  41 kubectl delete pvc html-pvc

  42 kubectl delete pod -l app=spellrich-nginx

  43 kubectl apply -f pv.yaml

  44 kubectl apply -f pvc.yaml

  45 kubectl get pvc html-pvc

  46 kubectl delete deployment spellrich-nginx

  47 kubectl apply -f n_deploy.yaml

  48 kubectl get pods -l app=spellrich-nginx -o wide

  49 kubectl get pods -l app=spellrich-nginx -o wide

  50 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  51 kubectl describe pod -l app=spellrich-nginx

  52 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  53 kubectl exec -it spellrich-nginx -- ls -lah /usr/share/nginx/html

  54 kubectl get pods -l app=spellrich-nginx

  55 kubectl exec -it spellrich-nginx-66cfcf96f-8dlb8 -- ls -lah /usr/share/nginx/html

  56 echo "<h1>Hello from spellrich!</h1>" > C:\spellrich\index.html

  57 kubectl delete pod -l app=spellrich-nginx

  58 kubectl apply -f n_deploy.yaml

  59 kubectl apply -f n_deploy.yaml

  60 kubectl exec -it $(kubectl get pods -l app=spellrich-nginx -o jsonpath='{.items[0].metadata.name}') --...

  61 kubectl apply -f n_deploy.yaml

  62 kubectl apply -f pv.yaml

  63 kubectl apply -f pvc.yaml

  64 kubectl delete pod -l app=spellrich-nginx

  65 kubectl get pods

  66 kubectl describe pod spellrich-nginx-66cfcf96f-gbb47

  67 kubectl exec -it spellrich-nginx-66cfcf96f-gbb47 -- /bin/sh

  68 kubectl get pv

  69 kubectl describe pv pvc-3910a7f7-8efb-4220-b83a-c26458a54ee9

  70 kubectl patch storageclass hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-de...

  71 kubectl patch storageclass hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-de...

  72 kubectl patch storageclass hostpath --type=merge `...

  73 kubectl patch storageclass hostpath --type=merge `...

  74 kubectl edit storageclass hostpath

  75 kubectl get storageclass

  76 kubectl edit storageclass hostpath

  77 kubectl apply -f pv.yaml

  78 kubectl apply -f pvc.yaml

  79 kubectl apply -f pvc.yaml

  80 kubectl delete pvc html-pvc

  81 kubectl apply -f pvc.yaml

  82 kubectl delete pvc html-pvc

  83 kubectl get pods -l app=spellrich-nginx

  84 kubectl delete pod -l app=spellrich-nginx

  85 kubectl exec -it spellrich-nginx-66cfcf96f-gbb47 -- /bin/sh

  86 kubectl get pods

  87 kubectl get pods

  88 kubectl get nodes

  89 kubectl apply -f pvc.yaml

  90 kubectl apply -f pv.yaml

  91 kubectl apply -f n_deploy.yaml

  92 kubectl apply -f n_deploy.yaml

  93 kubectl delete pod -l app=spellrich-nginx

  94 kubectl get pods

  95 kubectl get pods

  96 kubectl apply -f n_deploy.yaml

  97 kubectl delete pod -l app=spellrich-nginx

  98 kubectl get pods

  99 kubectl apply -f deployment.yaml

 100 kubectl apply -f n_deploy.yaml

 101 kubectl get pods

 102 kubectl apply -f n_deploy.yaml

 103 kubectl get pods

 104 kubectl apply -f n_deploy.yaml

 105 kubectl delete pod -l app=spellrich-nginx

 106 kubectl get pods