Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- student@control:~/cka$ history
- 1 free -m
- 2 lscspu
- 3 lscpu
- 4 df -h
- 5 sudo apt install vim git -y
- 6 git clone https://github.com/sandervanvugt/cka
- 7 cd cka
- 8 ls
- 9 ./setup-container.sh
- 10 ./setup-kubetools.sh
- 11 sudo ./setup-kubetools.sh
- 12 history
- 13 sudo kubeadm init
- 14 mkdir -p $HOME/.kube
- 15 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
- 16 sudo chown $(id -u):$(id -g) $HOME/.kube/config
- 17 kubectl get all
- 18 kubectl get pods -n kube-system
- 19 kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
- 20 kubectl get ns
- 21 kubectl get all -n kube-system
- 22 kubectl get nodes
- 23 history
- 24 kubectl get all -n kube-system
- 25 history
- 26 kubectl create deploy testdeploy --image=nginx --replicas=3
- 27 sleep 10; kubectl get pods -o wide
- 28 kubectl run task2pod --image=nginx -n mynamespace -- sleep 3600
- 29 kubectl create ns mynamespace
- 30 kubectl run task2pod --image=nginx -n mynamespace -- sleep 3600
- 31 kubectl delete pod task2pod
- 32 kubectl get pods
- 33 source <(kubectl completion bash)
- 34 kubectl delete pod task2pod -n mynamespace
- 35 kubectl run task2pod --image=alpine -n mynamespace -- sleep 3600
- 36 kubectl get pods -n mynamespace
- 37 kubectl get pods -n mynamespace -o yaml | less
- 38 history
- 39 kubectl run task3pod --image=nginx --image=redis --image=busybox
- 40 kubectl get pods
- 41 kubectl get pods task3pod -o yaml | less
- 42 kubectl describe pod task3pod
- 43 kubectl delete pod task3pod
- 44 history
- 45 kubectl run task3pod --image=busybox --dry-run=client -o yaml -- sleep infinity
- 46 kubectl run task3pod --image=busybox --dry-run=client -o yaml -- sleep infinity > task3.yaml
- 47 vim task3.yaml
- 48 kubectl apply -f task3.yaml
- 49 kubectl get pods
- 50 cat task3.yaml
- 51 history
- 52 cat task3.yaml
- 53 history
- 54 vim task4pod.yaml
- 55 vim md4.yaml
- 56 kubectl apply -f md4.yaml
- 57 kubectl get pods
- 58 vim md4.yaml
- 59 history
- 60 kubectl create quota --help | less
- 61 kubectl create ns limited
- 62 kubectl create quota qtest --hard pods=3,cpu=100m,memory=500Mi --namespace limited
- 63 kubectl get quota
- 64 kubectl get quota -n limited
- 65 kubectl describe ns limited
- 66 kubectl create deploy nginx --image=nginx --replicas=3 -n limited
- 67 kubectl get all -n limited
- 68 kubectl describe rs -n limited nginx-7854ff8877
- 69 kubectl set resources --help | less
- 70 kubectl set resources deploy nginx -n limited --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi
- 71 history
- 72 kubectl get all -n limited
- 73 kubectl describe ns limited
- 74 kubectl edit -n limited quota
- 75 kubectl get all -n limited
- 76 kubectl scale -n limited deployment nginx --replicas=3
- 77 kubectl get all -n limited
- 78 kubectl scale -n limited deployment nginx --replicas=4
- 79 kubectl get all -n limited
- 80 kubectl scale -n limited deployment nginx --replicas=3
- 81 history
- 82 kubectl config view
- 83 history
- 84 less ~/.kube/config
- 85 kubectl config view
- 86 kubectl config --help
- 87 kubectl config current-context
- 88 kubectl config set-context --current --namespace=limited
- 89 kubectl config current-context
- 90 kubectl config view
- 91 kubectl config set-context --current --namespace=default
- 92 kubectl config view
- 93 history
- 94 kubectl create deploy nginxex5 --image=nginx --replicas=2
- 95 kubectl scale deployment nginxex5 --replicas=4
- 96 vim resize_pvc.yaml
- 97 history
- 98 vim nwpolicy-complete-example.yaml
- 99 kubectl apply -f nwpolicy-complete-example.yaml
- 100 kubectl expose pod nginx --port=80
- 101 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 102 kubectl label pod busybox access=true
- 103 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 104 kubectl create ns nwp-namespace
- 105 vim nwp-lab9-1.yaml
- 106 kubectl apply -f nwp-lab9-1.yaml
- 107 kubectl expose pod nwp-nginx --port=80
- 108 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx
- 109 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx
- 110 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx.default.svc.cluster.local
- 111 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 112 vim nwp-lab9-2.yaml
- 113 kubectl apply -f nwp-lab9-2.yaml
- 114 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 115 kubectl create deploy busybox --image=busybox -- sleep 36000
- 116 kubectl exec -it busybox-6b56f788cb-qsgj2 -- wget --spider --timeout=1 nwp-nginx
- 117 kubectl delete -f nwp-lab9-2.yaml
- 118 history
- 119 vim selector-pod.yaml
- 120 kubectl apply -f selector-pod.yaml
- 121 kubectl get pods
- 122 vim selector-pod.yaml
- 123 kubectl apply -f selector-pod.yaml
- 124 kubectl get all
- 125 kubectl describe pod nginxxx
- 126 kubectl label nodes worker2 disktype=ssd
- 127 kubectl get pods
- 128 kubectl edit nodes control
- 129 kubectl get pods -n kube-system -o wide
- 130 kubectl -n kube-system get daemonsets.apps calico-node -o yaml | less
- 131 kubectl taint nodes worker1 example-key=value1:NoSchedule
- 132 kubectl describe nodes worker1 | less
- 133 kubectl create deploy nginx-taint --image=nginx --replicas=3
- 134 kubectl get pods -o wide
- 135 vim taint-toleration.yaml
- 136 kubectl apply -f taint-toleration.yaml
- 137 kubectl get pods
- 138 kubectl get pods -o wide
- 139 kubectl taint nodes worker1 example-key=value1:NoSchedule-
- 140 kubectl get pods -o wide
- 141 kubectl scale deployment nginx-taint --replicas=1
- 142 kubectl scale deployment nginx-taint --replicas=3
- 143 kubectl get pods -o wide
- 144 history
- 145 lsns
- 146 sudo -i
- 147 minikube stop
- 148 echo those who joined late: we're doing lab 6 now, please have a look at the slides and start working :-)
- 149 echo 'those who joined late: we're doing lab 6 now, please have a look at the slides and start working :-)'
- 150 echo 'those who joined late: we are doing lab 6 now, please have a look at the slides and start working :-)'
- 151 nano kd.yaml
- 152 vim kd.yaml
- 153 kubectl aply -f kd.yaml
- 154 kubectl apply -f kd.yaml
- 155 kubectl get all --selector app=nginx-sidecar
- 156 kubectl describe pod task6pod
- 157 kubectl delete -f kd.yaml
- 158 vim kd.yaml
- 159 kubectl apply -f kd.yaml
- 160 vim kd.yaml
- 161 kubectl apply -f kd.yaml
- 162 kubectl get all --selector app=nginx-sidecar
- 163 kubectl get all -o wide --selector app=nginx-sidecar
- 164 curl 192.168.29.23:30000
- 165 curl 192.168.29.22:30000
- 166 curl 192.168.29.21:30000
- 167 history
- 168 cat kd.yaml
- 169 kubectl get all -n kube-system
- 170 kubectl get -n kube-system pod calico-kube-controllers-7ddc4f45bc-w9bcs -o yaml | less
- 171 kubectl get clusterroles
- 172 kubectl get clusterroles | grep calico
- 173 kubectl get clusterroles calico-kube-controllers -o yaml | less
- 174 kubectl get clusterrolebindings
- 175 kubectl get clusterrolebindings | grep calico
- 176 kubectl get clusterrolebindings calico-kube-controllers -o yaml | less
- 177 kubectl create role --help | less
- 178 kubectl create rolebinding --help | less
- 179 kubectl get clusterroles
- 180 kubectl get clusterroles | grep -v system
- 181 kubectl describe clusterroles edit
- 182 history
- 183 kubectl create serviceaccount test
- 184 kubectl get sa
- 185 kubectl get pods
- 186 kubectl get pods task3pod -o yaml
- 187 history\
- 188 history
- 189 kubectl create ns roles
- 190 kubectl create role --help
- 191 kubectl create role viewers --verb=get --verb=list --verb=watch --resource=pods -n roles
- 192 kubectl create sa viewers -n roles
- 193 kubectl create rolebinding --help
- 194 kubectl create rolebinding -n roles viewersbinding --role=viewers --serviceaccount=viewers
- 195 kubectl create rolebinding -n roles viewersbinding --role=viewers --serviceaccount=roles:viewers
- 196 kubectl create pod -n roles viewpod --dry-run=client -o yaml > viewpod.yaml
- 197 kubectl run -n roles viewpod --dry-run=client -o yaml > viewpod.yaml
- 198 kubectl run -n roles viewpod --image=nginx --dry-run=client -o yaml > viewpod.yaml
- 199 vim viewpod.yaml
- 200 kubectl create -f viewpod.yaml
- 201 history
- 202 kubectl create deploy nginxdaemon --image=nginx --dry-run=client -o yaml > nginxdaemon.yaml
- 203 vim nginxdaemon.yaml
- 204 kubectl apply -f nginxdaemon.yaml
- 205 kubectl get all --selector app=nginxdaemon
- 206 history
- 207 cat viewpod.yaml
- 208 kubectl get nodes
- 209 kubectl get pods -o wide
- 210 kubectl drain worker1
- 211 kubectl drain worker1 --force --ignore-daemonsets
- 212 kubectl get pods -o wide
- 213 kubectl get nodes worker1 -o yaml | less
- 214 kubectl uncordon worker1
- 215 kubectl get pods -o wide
- 216 kubectl get nodes
- 217 kubectl top
- 218 kubectl top pod
- 219 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- 220 kubectl -n kube-system get pods
- 221 kubectl -n kube-system describe pods metrics-server-fbb469ccc-95xx8
- 222 kubectl -n kube-system logs metrics-server-fbb469ccc-95xx8
- 223 kubectl -n kube-system edit deploy metrics-server
- 224 kubectl get pods -n kube-system
- 225 kubectl top pods
- 226 kubectl top nodes
- 227 history
- 228 kubectl -n kube-system edit deploy metrics-server
- 229 kubectl top pods --sort-by='cpu' --no-header | head -1 | awk '{ print $1 }'
- 230 kubectl top pods --sort-by='cpu' --no-headers | head -1 | awk '{ print $1 }'
- 231 kubectl top pods --sort-by='cpu' --no-headers | head -1 | awk '{ print $1 }' > /var/cpu-pods.txt
- 232 kubectl top pods
- 233 kubectl top pods | sort -k 2
- 234 sudo -i
- 235 sudo vim /var/lib/kubelet/config.yaml
- 236 kubectl run auto-web --image=nginx --dry-run=client -o yaml
- 237 kubectl get pods
- 238 history
- 239 sudo apt install etcd-client
- 240 sudo etcdctl --help
- 241 sudo ETCDCTL_API=3 etcdctl --help
- 242 ps aux | grep etcd
- 243 sudo ETCDCTL_API=3 etcdctl --endpoints=localhost:2379 --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key get / --prefix --keys-only
- 244 sudo ETCDCTL_API=3 etcdctl --endpoints=localhost:2379 --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key snapshot save /tmp/etcdbackup.db
- 245 sudo ETCDCTL_API=3 etcdctl --write-out=table snapshot status /tmp/etcdbackup.db
- 246 sudo cp /tmp/etcdbackup.db /tmp/etcdbackup.db.2
- 247 history
- 248 kubectl get deploy
- 249 kubectl delete --all deploy
- 250 cd /etc/kubernetes/manifests/
- 251 ls
- 252 sudo mv * ..
- 253 sudo crictl ps
- 254 sudo ETCDCTL_API=3 etcdctl snapshot restore /tmp/etcdbackup.db --data-dir /var/lib/etcd-backup
- 255 sudo ls -l /var/lib/etcd-backup
- 256 sudo ls -l /var/lib/etcd-backup/member
- 257 vim ../etcd.yaml
- 258 sudo vim ../etcd.yaml
- 259 sudo mv ../*.yaml .
- 260 sudo crictl ps
- 261 kubectl get deploy -A
- 262 kubectl get deploy
- 263 history
- 264 cd
- 265 ls
- 266 tar xvf helm-v3.13.1-linux-amd64.tar.gz
- 267 sudo mv linux-amd64/helm /usr/local/bin/
- 268 helm
- 269 helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
- 270 kubectl get pods -n ingress-nginx
- 271 kubectl create deploy nginxsvc --image=nginx --port=80
- 272 kubectl expose deploy nginxsvc
- 273 kubectl get all --selector app=nginxsvc
- 274 kubectl create ing nginxsvc --class=nginx --rule=nginxsvc.info/*=nginxsvc:80
- 275 kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80
- 276 bg
- 277 sudo vim /etc/hosts
- 278 curl nginxsvc.info:8080
- 279 kubectl edit svc nginxsvc
- 280 curl nginxsvc.info:8080
- 281 kubectl describe ing nginxsvc
- 282 kubectl describe svc nginxsvc
- 283 kubectl edit svc nginxsvc
- 284 kubectl describe ing nginxsvc
- 285 kubectl run faildb --image=mariadb
- 286 kubectl logs faildb
- 287 kubectl logs faildb > /tmp/mariadb-error.txt
- 288 cd cka/
- 289 vim pod-with-node-a
- 290 vim pod-with-node-affinity.yaml
- 291 vim pod-with-node-antiaffinity.yaml
- 292 kubectl get nodes --show-labels
- 293*
- 294 vim pod-with-node-antiaffinity.yaml
- 295 kubectl apply -f pod-with-node-antiaffinity.yaml
- 296 kubect get pods -o wide
- 297 kubectl get pods -o wide
- 298 vim pod-with-pod-affinity.yaml
- 299 vim redis-with-pod-affinity.yaml
- 300 kubectl apply -f redis-with-pod-affinity.yaml
- 301 kubectl get pods
- 302 kubectl describe pod redis-cache-8478cbdc86-
- 303 kubectl get pods
- 304 kubectl describe pod redis-cache-8478cbdc86-65ht9
- 305 vim web-with-pod-affinity.yaml
- 306 kubectl apply -f web-with-pod-affinity.yaml
- 307 kubectl get pods
- 308 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement