Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 mkdir -p $HOME/.kube
- 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
- 3 ls -l .kube/config
- 4 sudo chown $(id -u):$(id -g) $HOME/.kube/config
- 5 ls -l .kube/config
- 6 kubectl get nodes
- 7 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
- 8 kubectl get pods -o kube-system
- 9 kubectl get pods -n kube-system
- 10 exit
- 11 history | less
- 12 kubectl get nodes
- 13 id
- 14 su -
- 15 git clone https://github.com/sandervanvugt/cka
- 16 cd cka
- 17 kubectl -h
- 18 kubectl completion -h
- 19 source <(kubectl completion bash)
- 20 kubectl create -h | less
- 21 kubectl create ns -h | less
- 22 kubectl create ns mynamespace
- 23 kubectl get get ns
- 24 kubectl get ns
- 25 kubectl run -h | less
- 26 kubectl run mypod --image=alpine --command -- sleep 3600
- 27 kubectl get pods -A
- 28 kubectl run mypod --image=alpine --command -- sleep 3600 -n mynamespace
- 29 kubectl run mypod --image=alpine -n mynamespace --command -- sleep 3600
- 30 kubectl get pods -A
- 31 history
- 32 kubectl get pods -n mynamespace -o yaml
- 33 kubectl create deployment nginx-ex5 --image=nginx --replicas=5
- 34 kubectl get all
- 35 ./counter.sh 15
- 36 vim mo.yaml
- 37 vim mo2.yaml
- 38 kubectl create -f mo2.yaml
- 39 kubectl get pods
- 40 kubectl describe pods init-demo
- 41 kubectl run -h | less
- 42 history
- 43 kubectl run mypod --image=alpine -n mynamespace --command -- sleep 3600 --dry-run
- 44 kubectl run mypodss --image=alpine -n mynamespace --dry-run --command -- sleep 3600
- 45 kubectl run mypodss --image=alpine -n mynamespace --dry-run=client -o yaml --command -- sleep 3600
- 46 kubectl run mypodss --image=alpine -n mynamespace --dry-run=client -o yaml --command -- sleep 3600 > mypodss.yaml
- 47 vim mypodss.yaml
- 48 ./counter.sh 4
- 49 vim wv.yaml
- 50 kubectl create -f wv.yaml
- 51 kubectl get pods
- 52 kubectl describe pods s3
- 53 vim ra.yaml
- 54 kubectl create -f ra.yaml
- 55 kubectl get pods
- 56 ./counter.sh 4
- 57 vim ih.yaml
- 58 kubectl create -f ih.yaml
- 59 kubectl get all --selector app=mydeploy
- 60 kubectl describe pod mydeploy-868547495d-5f7dg
- 61 kubectl create deploy -h
- 62 kubectl create deployment ex6 --image=busybox --replicas=3 --dry-run=client -o=yaml -- sleep 10000 > ex6.yaml
- 63 vim ex6.yaml
- 64 kubectl create -f ex6.yaml
- 65 kubectl get all --selector app=ex6
- 66 kubectl delete -f ex6.yaml
- 67 ./counter.sh 18
- 68 vim jp.yaml
- 69 sudo yum provides */etcdctl
- 70 sudo yum install etcd
- 71 sudo -i
- 72 ./counter.sh 4
- 73 vim jf.yaml
- 74 kubectl create -f jf.yaml
- 75 kubectl get pods
- 76 ./counter.sh 15
- 77 vim mo2.yaml
- 78 vim mo3.yaml
- 79 kubectl run auto-web --image=nginx --dry-run=client -o yaml > static
- 80 scp static root@worker2:/var/lib/kubelet/static/static.yaml
- 81 systemctl get pods
- 82 kubectl get pods -A
- 83 sudo -i
- 84 ./counter.sh 6
- 85 vim md.yaml
- 86 kubectl create ns myvol
- 87 kubectl create -f md.yaml
- 88 kubectl get pv
- 89 kubectl get pvc
- 90 kubectl get pvc -n myvol
- 91 kubectl get pv
- 92 history
- 93 su -
- 94 history
- 95 vim md.yaml
- 96 ip a
- 97 ./counter.sh 3
- 98 kubectl run -n run-once xxazz-pod --image=alpine --restart=Never -- sleep 3600
- 99 kubectl create ns run-once
- 100 kubectl run -n run-once xxazz-pod --image=alpine --restart=Never -- sleep 3600
- 101 kubectl get pods -n run-once -o yaml
- 102 ./counter.sh 5
- 103 cat jf.txt
- 104 vim jf.txt
- 105 kubectl create deploy newnginx --image=nginx:1.14
- 106 kubectl get all --selector app=newnginx
- 107 kubectl describe pod newnginx-b844f5586-s5q97
- 108 kubectl set -h | less
- 109 kubectl set image -h
- 110 kubectl set image deploy my-deploy nginx=nginx:latest --record
- 111 kubectl set image deploy newnginx nginx=nginx:latest --record
- 112 kubectl rollout history
- 113 kubectl rollout history deploy newnginx
- 114 kubectl rollout undo deployment newnginx
- 115 kubectl get pods -o wide
- 116 vim nwpolicy-complete-example.yaml
- 117 kubectl create -f nwpolicy-complete-example.yaml
- 118 kubectl get networkpolicy
- 119 kubectl expose pod nginx --port=80
- 120 kubectl get svc
- 121 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 122 kubectl label pod busybox access=true
- 123 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 124 ./counter.sh 10
- 125 kubectl create ns nwp-namespace
- 126 vim nwp-lab11-1.yaml
- 127 kubectl create -f nwp-lab11-1.yaml
- 128 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx
- 129 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx
- 130 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 131 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default
- 132 kubectl expose pod nwp-nginx
- 133 kubectl expose pod nwp-nginx --port=80
- 134 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 135 vim nwp-lab11-2.yaml
- 136 kubectl create -f nwp-lab11-2.yaml
- 137 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 138 history
- 139 kubectl get pods -o wide
- 140 kubectl get nodes -o wide
- 141 kubectl describe node worker2.example.com
- 142 kubectl logs -h
- 143 kubectl describe node worker2.example.com | less
- 144 kubectl get pod -A -o wide
- 145 ./counter.sh 15
- 146 kubectl top -h
- 147 kubectl top pod
- 148 git clone https://github.com/kubernetes-sigs/metrics-server.git
- 149 kuebctl create -f metrics-server/manifests/base/
- 150 kubectl create -f metrics-server/manifests/base/
- 151 kubectl -n kube-system get pods
- 152 pwd
- 153 ls
- 154 cd metrics-server/
- 155 ls
- 156 cd manifests/
- 157 ls
- 158 cd base/
- 159 ls
- 160 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- 161 kubectl -n kube-system get pods
- 162 kubectl -n kube-system get deploy
- 163 kubectl -n kube-system edit deployment metrics-server
- 164 kubectl -n kube-system logs metrics-server-56c59cf9ff-wdswn
- 165 kubectl -n kube-system get pods
- 166 kubectl top pods
- 167 cd
- 168 git clone https://github.com/kubernetes-sigs/metrics-server
- 169 cd metrics-server/
- 170 ls
- 171 cd
- 172 cd cka
- 173 ./counter.sh 4
- 174 kubectl get pods -h
- 175 kubectl get pods -A --selector=app --sort-by=.medatada.name
- 176 kubectl get pods -A --sort-by=.medatada.name
- 177 kubectl get pods -A --sort-by={.spec.nodeName}
- 178 kubectl get pods -o wide --sort-by='{.spec.nodeName}' --all-namespaces
- 179 kubectl get pods -h
- 180 kubectl get pods nginx -o json | less
- 181 history
- 182 ./counter.sh 3
- 183 kubectl get pods
- 184 kubectl get deploy
- 185 kubectl delete mydeploy
- 186 kubectl delete deploy mydeploy
- 187 kubectl expose -h
- 188 kubectl expose deployment nginx-ex5 --port=80
- 189 kubectl get svc
- 190 kubectl describe svc nginx-ex5
- 191 ./counter.sh 12
- 192 ./counter.sh 19
- 193 vim jf4.yaml
- 194 cd ..
- 195 git clone https://github.com/sandervanvugt/ckad
- 196 cd ckad
- 197 vim variables
- 198 kubectl create cm variables --from-env-file=variables
- 199 kubectl describe cm variables
- 200 vim cm-test-pod.yaml
- 201 kubectl create -f cm-test-pod.yaml
- 202 kubectl logs test1
- 203 kubectl create cm morevars --from-literal=VAR3=planets --from-literal=VAR4=moon
- 204 kubectl get cm morevars
- 205 kubectl get cm morevars -o yaml
- 206 vim cm-test-pod.yaml
- 207 kubectl apply -f cm-test-pod.yaml
- 208 kubectl replace -f cm-test-pod.yaml
- 209 kubectl delete -f morevolumes.yaml
- 210 kubectl delete -f cm-test-pod.yaml
- 211 kubectl create -f cm-test-pod.yaml
- 212 kubectl logs test1
- 213 vim nginx-custom-config.conf
- 214 kubectl create cm nginx-cm --from-file nginx-custom-config.conf
- 215 kubectl describe cm nginx-cm
- 216 vim nginx-cm.yml
- 217 kubectl create -f nginx-cm.yml
- 218 kubectl exec -it nginx-cm /bin/bash
- 219 ./countdown 5
- 220 kubectl create -h | less
- 221 cd ../cka
- 222 vim ra4.yaml
- 223 kubectl explain daemonset.spec | less
- 224 vim ra4.yaml
- 225 kubectl create -f ra4.yaml
- 226 kubectl get ds --show-labels
- 227 kubectl get all --selector app=nginx=ds
- 228 kubectl get all --selector app=nginx-ds
- 229 kubectl get pods -o wide --selector app=nginx-ds
- 230 ./counter.sh 4
- 231 kubectl cordon -h
- 232 kubectl drain -h
- 233 kubectl drain worker2 --ignore-daemonsets --force
- 234 kubectl drain worker2.example.com --ignore-daemonsets --force
- 235 kubectl get pods -o wide -A | less
- 236 kubectl uncordon worker2.example.com
- 237 kubectl get nodes
- 238 vim breaklab.txt
- 239 kubectl edit node control.example.com
- 240 kubectl taint -h | less
- 241 sudo useradd anna
- 242 sudo cd /home/anna
- 243 pwd
- 244 su -
- 245 cd /home/student/
- 246 cd /home/anna
- 247 kubectl config set-credentials anna --client-certificate=/home/anna/.certs/anna.crt --client-key=/home/anna/.certs/anna.key
- 248 kubectl config set-context anna-context --cluster=kubernetes --user=anna
- 249 mkdir .kube
- 250 cp /etc/kubernetes/admin.conf /home/anna/.kube/config
- 251 sudo cp /etc/kubernetes/admin.conf /home/anna/.kube/config
- 252 vim .kube/config
- 253 sudo chown student:student .kube/config
- 254 vim .kube/config
- 255 pwd
- 256 cd
- 257 cd -
- 258 sudo chown -R anna:anna /home/anna/
- 259 exit
- 260 cd cka
- 261 vim podacessrole.yaml
- 262 kubectl create -f podacessrole.yaml
- 263 kubectl get roles
- 264 vim rolebinding.yaml
- 265 kubectl create -f rolebinding.yaml
- 266 kubectl run rolepod --image=nginx
- 267 kubectl get pods
- 268 su - anna
- 269 sudo passwd anna
- 270 su - anna
- 271 kubectl create sa whatever
- 272 kubectl create ns trouble
- 273 kubectl run nginx --image=nginx --namespace=trouble
- 274 kubectl delete ns trouble
- 275 kubectl get ns
- 276 kubectl get ns trouble -o json > trouble.json
- 277 kubectl get ns
- 278 kubectl get ns run-once -o json > trouble.json
- 279 vim trouble.json
- 280 kubectl replace --raw "/api/v1/namespaces/trouble/finalize" -f trouble.json
- 281 kubectl replace --raw "/api/v1/namespaces/run-once/finalize" -f trouble.json
- 282 kubectl get ns
- 283 ls
- 284 cd
- 285 rm .kube/config
- 286 kubectl get all
- 287 kubectl get-credential
- 288 cp /etc/kubernetes/admin.conf .kube/
- 289 sudo cp /etc/kubernetes/admin.conf .kube/
- 290 sudo cp /etc/kubernetes/admin.conf .kube/config
- 291 kubectl get all
- 292 sudo chown student:student .kube/config
- 293 kubectl get all
- 294 history
Add Comment
Please, Sign In to add comment