1 sudo -i #als sudo# 1 apt-get update -y 2 apt-get update 3 apt-get upgrade 4 apt-get install -y docker.io 5 vim /etc/apt/sources.list.d/kubernetes.list 6 apt-get update 7 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - 8 apt-get update 9 apt-get install -y kubeadm=1.13.1-00 kubelet=1.13.1-00 kubectl=1.13.1-00 10 wget https://tinyurl.com/yb4xturm -O rbac-kdd.yaml 11 wget https://tinyurl.com/y8lvqc9g -O calico.yaml 12 less calico.yaml 13 cat calico.yaml | grep value 14 ip a 15 nano calico.yaml 16 kubeadm init --kubernetes-version 1.13.1 --pod-network-cidr 172.20.0.0/16 | tee kudeadm-init.out 17 exot 18 mkdir -p $HOME/.kube 19 rm -rf .kube/ 2 mkdir /.kube 3 mkdir -p $HOME/.kube 4 sudo cp -i /etc/kubernetes/admin.conf /home/ubuntu/.kube/config 5 less .kube/config 6 sudo shown $(id -u):$(id -g) /home/ubuntu/.kube/config 7 sudo chown $(id -u):$(id -g) /home/ubuntu/.kube/config 8 less .kube/config 9 sudo cp /root/rbac-kdd.yaml . 10 kubectl apply -f rbac-kdd.yaml 11 sudp cp /root/calico.yaml 12 sudp cp /root/calico.yaml . 13 sudo cp /root/calico.yaml . 14 kubectl apply -f calico.yaml 15 source <(kubectl completion bash) 16 echo "source <(kubectl completion bash" >> ~/.bashrc 17 kubectl describe nodes lfs458-node-01 18 kubectl -n kube-system get pod 19 kubectl describe nodes lfs458-node-01 20 kubectl get node 21 wathc kubectl get node 22 watch kubectl get node 23 history 24 sudo -i 25 watch kubectl get node 26 ip a 27 ip addr show ens4 | grep inet 28 ip addr show ens3 | grep inet 29 watch kubectl get node 30 sudo kubeadm token list 31 sudo kubeadm token create 32 openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //' 33 ~wa 34 watch kubectl get node 35 kubectl describe nodes | grepp -i taint 36 kubectl describe nodes | grep -i taint 37 kubectl taint node --all node-role.kubernetes.io/master- 38 kubectl describe nodes | grep -i taint 39 kubectl get pods --all-namespaces 40 ip a 41 kubectl create deployment nginx --image=nginx 42 kubectl get deployments. 43 kubectl de 44 kubectl get deployments nginx -o yaml 45 kubectl get events 46 kubectl get deployments nginx -o yaml > first.yaml 47 vim first.yaml 48 nano first.yaml 49 kubectl delete deployments nginx 50 kubectl get deployments. 51 kubectl create -f first.yaml 52 kubectl get deployments nginx -o yaml > second.yaml 53 diff first.yaml second.yaml 54 kubectl create deployment two --image=nginx --dry-run -o yaml 55 kubectl get deployments. 56 kubectl get deployments nignx --export -o yaml 57 kubectl get deployments nginx --export -o yaml 58 kubectl get deployments nginx --export -o json 59 kubectl expose -h 60 kubectl expose deployment/nginx 61 nano first.yaml 62 kubectl expose deployment/nginx 63 kubectl replace -f first.yaml 64 nano first.yaml 65 kubectl replace -f first.yaml 66 nano first.yaml 67 kubectl replace -f first.yaml 68 nano first.yaml 69 kubectl replace -f first.yaml 70 nano first.yaml 71 kubectl replace -f first.yaml 72 nano first.yaml 73 kubectl replace -f first.yaml 74 nano first.yaml 75 nano second.yaml 76 nano first.yaml 77 kubectl replace -f first.yaml 78 nano first.yaml 79 kubectl replace -f first.yaml 80 nano first.yaml 81 kubectl replace -f first.yaml 82 nano first.yaml 83 kubectl replace -f first.yaml 84 kubectl delete deployments nginx 85 kubectl create -f first.yaml 86 kubectl replace -f first.yaml 87 kubectl get deployments nginx -o yaml > first.yaml 88 nano first.yaml 89 kubectl delete deployments nginx 90 kubectl create -f first.yaml 91 kubectl replace -f first.yaml 92 nano first.yaml 93 kubectl get deploy,pod 94 kubectl expose deployment/nginx 95 kubectl get svc nginx 96 kubectl get ep nginx 97 i[ a 98 ip a 99 sudo tcpdump -i tun10 100 kubectl describe pod nginx-7db75b8b78-2ml97 | grep node 101 kubectl describe pod nginx-7db75b8b78-2ml97 | grep node: 102 kubectl describe pod nginx-7db75b8b78-2ml97 | grep Node: 103 ip a 104 kubectl describe pod nginx-7db75b8b78-2ml97 105 curl 172.20.1.5 106 ip a 107 curl 172.20.1.5 108 ip a 109 curl 192.168.122.244:80 110 kubectl describe pod nginx-7db75b8b78-2ml97 111 kubectl cluster-info 112 curl 192.168.122.244:80 113 kubectl get svc nginx 114 curl 10.100.61.190:80 115 kubectl get deployments nginx 116 kubectl scale deployment nginx --replicas=3 117 kubectl get deployments nginx 118 kubectl get ep nginx 119 curl 172.20.1.6 120 curl 172.20.1.4 121 curl 172.20.0.4 122 kubectl get deployments nginx 123 kubectl describe pod nginx-7db75b8b78-2ml97 | grep Node: 124 kubectl describe pod nginx-7db75b8b78- 125 kubectl describe pod nginx | grep Node: 126 tcpdump -i 127 tcpdump -v 128 sudo tcpdump 129 kubectl get po 130 kubectl exec nginx-7db75b8b78-25v9m --printenv | grep KUBERNETES 131 kubectl exec nginx-7db75b8b78-25v9m -- printenv | grep KUBERNETES 132 kubeadm vies 133 w 134 kubeadm view 135 kubeadm -view 136 kubectl -view 137 sudo kubeadm config view 138 kubectl delete svc nginx 139 kubectl expose deployment nginx --type=LoadBalancer 140 kubectl get svc 141 sudo kubeadm config view 142 kubectl get svc 143 ipa 144 ip a 145 kubectl scale deployment nginx --replicas=0 146 kubectl get svc 147 kubectl get po 148 kubectl scale deployment nginx --replicas=2 149 kubectl get po 150 kubectl get svc 151 kubectl get po 152 kubectl describe pod nginx-7db75b8b78- 153 kubectl describe pod nginx-7db75b8b78-2ml97 | grep Node: 154 kubectl describe pod nginx | grep Node: 155 kubectl scale deployment nginx --replicas=1 156 kubectl describe pod nginx | grep Node: 157 kubectl get po 158 kubectl get svr 159 kubectl get srv 160 kubectl get svc 161 ip a 162 kubectl describe pod nginx | grep Node: 163 kubectl delete deployments nginx 164 kubectl delete ep nginx 165 kubectl delete svc nginx 166 kubectl get svc 167 kubectrl create deployment hog --image vish/stress 168 kubectl create deployment hog --image vish/stress 169 kubectl get deployments. 170 kubectl describe deployments hog 171 kubectl get deployments hog -o yaml 172 kubectl get deployments hog --export -o yaml > hog.yaml 173 vim hog.yaml 174 kubectl replace -f hog.yaml 175 vim hog.yaml 176 rm hog.yaml 177 kubectl get deployments hog --export -o yaml > hog.yaml 178 rm hog.yaml 179 kubectl get deployments hog --export -o yaml > hog.yaml 180 vim hog.yaml 181 kubectl get deployments hog --export -o yaml > hog.yaml 182 vim hog.yaml 183 kubectl replace -f hog.yaml 184 vim hog.yaml 185 kubectl replace -f hog.yaml 186 kubectl get deployments hog -o yaml 187 kubectl get po 188 kubectl logs hog-fbf9cf454-dzwcn 189 ex 190 exit 191 vim hog.yaml 192 kubectl delete deployment hog 193 kubectl create -f hog.yaml 194 kubectl get pod 195 kubectl get po 196 kubectl create namespace low-usage-limet 197 kubectl delete namespace low-usage-limet 198 kubectl delete namespace low-usage-limit 199 kubectl create namespace low-usage-limit 200 kubectl get namespace 201 vim low-recource-range.yaml 202 kubectl --namespace=low-usage-limit create -f low-resource-range.yaml 203 vim low-recource-range.yaml 204 kubectl --namespace=low-usage-limit create -f low-recource-range.yaml 205 kubectl get LimetRange 206 kubectl get LimetRange --all-namespaces 207 vim low-recource-range.yaml 208 fg 209 kubectl get LimetRange --all-namespace 210 kubectl get LimetRange --all-namespaces 211 kubectl get LimitRange --all-namespace 212* kubectl get LimitRange --all-namespace 213 clear 214 kubectl -n low-usage-limit create deployment limited-hog --image vish/stress 215 kubectl get deployments --all-namespaces 216 kubectl -n low-recource-range get pods 217 kubectl -n low-usage-limit get pods 218 kubectl -n low-recource-range get pods 219 kubectl -n low-usage-limit get pods 220 kubectl -n low-usage-limit get pod limited-hog-568fbbf4cf-2w6g7 -o yaml 221 cp hog.yaml hog2.yaml 222 vim hog2 223 vim hog2.yaml 224 kubectl create -f hog2.yaml 225 kubectl get deployments --all-namespaces 226 kubectl get nodes 227 kubectl get deployments --all-namespaces 228 kubectl create -f hog2.yaml 229 kubectl scale deployment hog --replicas=2 230 kubectl scale deployment hog --replicas=4 231 kubectl get nodes 232 kubectl get deployments --all-namespaces 233 kubectl scale deployment hog --replicas=0 234 kubectl scale deployment hog --replicas=1 235 kubectl get deployments --all-namespaces 236 kubectl -n low-usage-limit delete deployment hog 237 kubectl delete deployment hog 238 kubectl get deployments --all-namespaces 239 kubectl get pod 240 kubectl delete pod hog 241 kubectl get pod 242 kubectl get ? 243 kubectl get help 244 kubectl get --help 245 kubectl scale deployment hog --replicas=0 246 kubectl get pod 247 kubectl get --all-namespaces 248 kubectl get deployments --all-namespaces 249 pskill -p 18567 250 pkill -p 18567 251 pkill -ns 18567 252 sudo pkill -ns 18567 253 sudo pkill -ns 19059 254 kubectl get deployments --all-namespaces 255 kubectl delete deployment low-usage-limit 256 kubectl delete deployment * 257 pskill stress 258 pkill stress 259 sudo pkill stress 260* kubectl delete deployment 261 sudo pkill stress 262 kubectl get deployments 263 kubectl get --help 264 kubectl get deployments -allnamespaces 265 kubectl get deployments -all-namespaces 266 kubectl get deployments --all-namespaces 267 kubectl delete low-usage-limit 268 kubectl delete low-usage-limit -all-namespaces 269 kubectl delete low-usage-limit -all 270 kubectl delete low-usage-limit 271 kubectl get deployments --all-namespaces 272 kubectl delete limited-hog 273 bectl get services 274 kubectl get services 275 kubectl get pods --all-namespaces 276 kubectl delete pod low-usage-limit 277 kubectl delete pod limited-hog* 278 kubectl delete pod limited-hog-568fbbf4cf-2w6g7 279 kubectl delete limited-hog-568fbbf4cf-2w6g7 280 kubectl delete deployments limited-hog 281 kubectl delete deployment limited-hog 282 kubectl get deployment 283 kubectl get deployment --all-namespaces 284 kubectl delete deployment low-usage-limit 285 kubectl delete deployment low-usage-limit --al 286 kubectl delete deployment low-usage-limit --all 287 kubectl delete deployment low-usage-limit --all-namesapces 288 kubectl delete deployment low-usage-limit --all-namespaces 289 wget https://tinyurl.com/y8bn2awp -O complete-demo.yaml 290 less complete-demo.yaml 291 kubectl create namespace sock-shop 292 kubectl get namespace 293 grep image complete-demo.yaml 294 kubectl apply -n sock-shop -f complete-demo.yaml 295 kubectl het pods 296 kubectl ghet pods 297 kubectl get pods 298 kubectl -n sock-shop get pods 299 kubectl get svc -n sock-shop 300 kubectl get svc 301 kubectl get svc -n sock-shop 302 sudo docket ps 303 sudo docker ps 304 clear 305 sudo docker ps 306 kubectl get deployment --all-namespaces 307 kubectl 308 kubectl get nodes 309 kubectl drain lfs458-node-02 310 kubectl describe node | grep -i taint 311 kubectl drain lfs458-node-02 --igonore-daemonsets 312 kubectl drain lfs458-node-02 --ignore-daemonsets 313 kubectl drain lfs458-node-02 --ignore-daemonsets --delete-local-data 314 kubectl uncordon lfs458-node-02 315 kubectl describe node | grep -i taint 316 kubectl -n sock-shop get pod 317 kubectl -n sock-shop delete pod 318 kubectl -n sock-shop delete pod --all 319 kubectl -n sock-shop get pod 320 kubectl -n sock-shop get deployment 321 kubectl delete -f complete-demo.yaml 322 kubectl -n sock-shop get deployment 323 kubectl -n sock-shop get pod 324 kubectl resources 325 kubectl -resources 326 kubectl api-resources 327 kubectl config view 328 kubectl explain pod 329 kubectl explain 330* kubectl explain ippool 331 kubectl explain pod.status 332 export client 333 export client=$(grep client-cert ~/.kube/config | cut -d" " -f 6) 334 echo $client 335 export key=$(grep client-key-data ~/.kube/config | cut -d" " -f 6) 336 echo $key 337 export auth=$(grep certificate-authority-data ~/.kube/config | cut -d" " -f 6) 338 echo $auth 339 echo $client | base64 -d - > ./client.pem 340 echo $key | base64 -d - > ./client-key.pem 341 echo $auth | base64 -d - > ./ca.pem 342 cat client 343 cat client.pem 344 cat client-key.pem 345 cat ca.pem 346 kubectl config view | grep server 347 curl --cert ./client.pem --key ./client-key.pem --cacert ./ca.pem https://192.168.122.244:6443/api/v1/pods 348 vim curlpod.json 349 curl --cert ./client.pem --key ./client-key.pem --cacert ./ca.pem https://192.168.122.244:6443/api/v1/namespaces/default/pods -XPOST -H'Content-Type: application/json' -d@curlpod.json 350 kubectl get pods 351 kubectl get endpoints 352 stracekubectl get endpoints 353 strace kubectl get endpoints 354 cd /home/ubuntu/.kube/cache/discovery/ 355 ls 356 cd 192.168.122.244_6443/ 357 ls 358 find . 359 python -m json.tool v1/serverresources.json 360 kubectl get ep 361 python -m json.tool v1/serverresources.json | grep kind 362 python -m json.tool apps/v1beta/serverresources.json | grep kind 363 python -m json.tool apps/v1beta1/serverresources.json | grep kind 364 kubectl delete pod cur 365 kubectl delete pod curlpod 366 cd ./ 367 cd $/ 368 cd $./ 369 cd ~/ 370 curl --cert ./client.pem --key ./client-key.pem --cacert ./ca.pem https://192.168.122.244:6443/api/v2/pods 371 curl --cert ./client.pem --key ./client-key.pem --cacert ./ca.pem https://192.168.122.244:6443/api/v2 372 curl --cert ./client.pem --key ./client-key.pem --cacert ./ca.pem https://192.168.122.244:6443/api/v1/pods 373 kubectl get pods 374 kubectl get pods --all-namespaces 375* kubectl delete 376 kubectl get pods --all-namespaces 377 kubectl get resources --all-namespaces 378 kubectl get deployments --all-namespaces 379 kubectl remove deployments limited-hog 380 kubectl delte deployments limited-hog 381 kubectl delete deployments limited-hog 382 kubectl get deployments --all-namespaces 383 kubectl delete deployments low-usage-limit 384 kubectl get deployments --all-namespaces 385 kubectl delete pod low-usage-limit 386 kubectl get pods --all-namepaces 387 kubectl get pods --all-namespaces 388 kubectl delete pod limited-hog-568fbbf4cf-8vqbf 389 kubectl delete pod limited-hog* 390 kubectl delete pod limited-hog 391 kubectl delete pod limited-hog --all 392 kubectl delete limited-hog --all 393 kubectl delete low-usage-limit --all 394 kubectl get pods --all-namespaces 395 clear 396 kubectl get pods --all-namespaces 397 kubectl get secrets 398 kubectl describe secret default-token-69q2v 399 export token=$(kubectl describe secret default-token-69q2v | grep ^token |cut -f7 -d ' ') 400 curl https://192.168.122.244:6443/apis --header "Authorizzation: Bearer $token" -k 401 curl https://192.168.122.244:6443/api1 --header "Authorizzation: Bearer $token" -k 402 kubectl run -i -t busybox --image=busybox --restart=Never 403 kubectl proxy -h 404 kubectl proxy --api-prefix=/ & 405 curl http://127.0.0.1:8001/api 406 curl http://127.0.0.1:8001/api/v1/namespaces 407 vim jobyaml 408 kubectl create -f jobyaml 409 kubectl get job 410 kubectl describe jobs.batch sleepy 411 kubectl get job.batch sleepy -o yaml 412 mv jobyaml job.yaml 413 kubectl delete jobs.batch sleepy 414 vim job.yaml 415 kubectl create -f job.yaml 416 vim job.yaml 417 kubectl create -f job.yaml 418 vim job.yaml 419 kubectl create -f job.yaml 420 kubectl get job.batch 421 kubectl get pods 422 kubectl create -f job.yaml 423 kubectl get pods 424 kubectl delete jobs.batch sleepy 425 vim job.yaml 426 kubectl create -f job.yaml 427 kubectl get pods 428 vim job.yaml 429 kubectl delete jobs.batch sleepy 430 kubectl create -f job.yaml 431 kubectl get jobs 432 kubectl get pods 433 kubectl get jobs 434 kubectl get pods 435 kubectl get jobs 436 kubectl get pods 437 kubectl get jobs 438 kubectl get pods 439 kubectl get job sleepy -o yaml 440 kubectl get deployments 441 kubectl get deployments --all-namespaces 442* kubectl -n low-usage-limit delete deployments. 443 source <(kubectl completion bash) 444 kubectl delete jobs.batch sleepy 445 cp jobs.yaml cronjob.yaml 446 cp job.yaml cronjob.yaml 447 vim cronjob.yaml 448 rm cronjob.yaml 449 vim cronjob.yaml 450 kubectl create -f cronjob.yaml 451 vim cronjob.yaml 452 kubectl create -f cronjob.yaml 453 vim cronjob.yaml 454 kubectl create -f cronjob.yaml 455 kubectl get cronjobs.batch 456 kubectl create -f cronjob.yaml 457 vim cronjob.yaml 458 kubectl get cronjobs.batch 459 kubectl get jobs.batch 460 kubectl delete cronjobs.batch date 461 history 462 history > commandsdag1.txt