Advertisement
sandervanvugt

kubernetes in 4 hours sept. 22

Sep 2nd, 2022
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. 1 minikube start --vm-driver=docker --cni=calico
  2. 2 kubectl get all
  3. 3 ./countdown 15
  4. 4 kubectl get all
  5. 5 minikube status
  6. 6 minikube -h | less
  7. 7 minikube dashboard
  8. 8 bg
  9. 9 kubectl get all
  10. 10 kubectl -h | less
  11. 11 kubectl completion -h | less
  12. 12 source <(kubectl completion bash)
  13. 13 kubectl create deployment -h | less
  14. 14 kubectl create deploy newnginx --image=nginx --replicas=3
  15. 15 kubectl get all
  16. 16 kubectl delete pod newnginx-5498966bb6-8ctvm
  17. 17 kubectl get all
  18. 18 kubectl delete replicasets.apps newnginx-5498966bb6
  19. 19 kubectl get all
  20. 20 kubectl get pods
  21. 21 history
  22. 22 kubectl run -h | less
  23. 23 kubectl run nginx --image=nginx
  24. 24 kubectl get all
  25. 25 kubectl delete pod nginx
  26. 26 kubectl get all
  27. 27 kubectl get pods
  28. 28 kubectl get pods newnginx-5498966bb6-7q6vm -o yaml | less
  29. 29 kubectl explain pod
  30. 30 kubectl explain pod.spec | less
  31. 31 kubectl explain deploy.spec | less
  32. 32 kubectl get all
  33. 33 kubectl get all -A
  34. 34 kubectl get pods -A
  35. 35 kubectl get all --show-labels
  36. 36 kubectl get all --selector app=newnginx
  37. 37 ./countdown 12
  38. 38 kubectl run nginx --image=nginx --dry-run=client -o yaml
  39. 39 kubectl run nginx --image=nginx --dry-run=client -o yaml > nginxpod.yaml
  40. 40 vim nginxpod.yaml
  41. 41 kubectl explain pod.spec
  42. 42 vim nginxpod.yaml
  43. 43 kubectl create -f nginxpod.yaml
  44. 44 kubectl get pods
  45. 45 kubectl delete -f nginxpod.yaml
  46. 46 ls -l
  47. 47 vim statefulset.yaml
  48. 48 history
  49. 49 kubectl get deployments.apps newnginx -o json | less
  50. 50 kubectl create deploy --image=busybox --dry-run=client -o json
  51. 51 kubectl create deploy newbusy --image=busybox --dry-run=client -o json
  52. 52 kubectl create ns secret
  53. 53 kubectl get ns
  54. 54 kubectl create deploy secretginx --image=nginx -n secret
  55. 55 kubectl get deploy
  56. 56 kubectl get deploy -A
  57. 57 kubectl get pods -A -o wide
  58. 58 kubectl get pods -o wide -n default,secret
  59. 59 kubectl get pods -o wide -n default
  60. 60 kubectl get pods -o wide -n secret
  61. 61 history
  62. 62 kubectl create deploy mydb --image=mariadb --replicas=3
  63. 63 kubectl get all --selector app=mydb
  64. 64 kubectl describe pod mydb-6785d644c6-88b7x | less
  65. 65 kubectl get pods
  66. 66 kubectl logs mydb-6785d644c6-88b7x
  67. 67 history
  68. 68 kubectl get pods
  69. 69 kubectl exec -it newnginx-5498966bb6-7q6vm -- sh
  70. 70 kubectl logs mydb-6785d644c6-88b7x
  71. 71 kubectl set env -h | less
  72. 72 kubectl set env deploy/mydb MARIADB_ROOT_PASSWORD=secret; kubectl get all --selector app=mydb
  73. 73 kubectl get all --selector app=mydb
  74. 74 kubectl -h | less
  75. 75 kubectl port-forward -h | less
  76. 76 history
  77. 77 ./countdown 12
  78. 78 kubectl create deploy nginxsvc --image=nginx
  79. 79 kubectl get all --selector app=nginxsvc
  80. 80 kubectl scale deployment nginxsvc --replicas=3
  81. 81 kubectl get all --selector app=nginxsvc
  82. 82 kubectl get pods --selector app=nginxsvc -o wide
  83. 83 kubectl expose deployment nginxsvc --port=80
  84. 84 kubectl get all --selector app=nginxsvc
  85. 85 kubect get endpoints
  86. 86 kubectl get endpoints
  87. 87 curl 10.100.1.227
  88. 88 history
  89. 89 kubectl get all --selector app=nginxsvc
  90. 90 minikube ssh
  91. 91 kubectl edit svc nginxsvc
  92. 92 kubectl get all --selector app=nginxsvc
  93. 93 minikube ip
  94. 94 curl 192.168.49.2:32338
  95. 95 history
  96. 96 kubectl explain pod.spec.volumes | less
  97. 97 vim morevolumes.yaml
  98. 98 kubectl create -f morevolumes.yaml
  99. 99 kubectl get pods morevol2
  100. 100 kubectl describe pods morevol2 | less
  101. 101 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  102. 102 kubectl exec -it morevol2 -c centos2 -- ls /centos2
  103. 103 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  104. 104 history
  105. 105 kubectl create cm myhosts --from-file=/etc/hosts
  106. 106 kubectl describe cm myhosts
  107. 107 kubectl create cm myetc --from-file=/etc/*
  108. 108 kubectl create cm myetc --from-file=/etc
  109. 109 kubectl get cm
  110. 110 kubectl create deploy mynewdb --image=mariadb --replicas=3
  111. 111 kubectl get all --selector app=mynewdb
  112. 112 kubectl logs mynewdb-7ddd998494-4vm54
  113. 113 kubectl create cm mynewdbvars --from-literal=MYSQL_ROOT_PASSWORD=password
  114. 114 kubectl get cm mynewdbvars
  115. 115 kubectl get cm mynewdbvars -o yaml
  116. 116 kubectl set env --from=configmap/mynewdbvars deploy/mynewdb
  117. 117 kubectl get all --selector app=mynewdb
  118. 118 kubectl get pods mynewdb-84bbcd979f-k6vr7 -o yaml | less
  119. 119 history
  120. 120 kubectl create -f https://operatorhub.io/install/beta/rook-ceph.yaml
  121. 121 helm repo add k8s-dashboard https://kubernetes.github.io/dashboard
  122. 122 history
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement