Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ROOT COMMANDS
- [root@control etcd]# history
- 1 cd cka
- 2 ./counter.sh 14
- 3 vim exercise3.yaml
- 4 kubectl create -f exercise3.yaml
- 5 exit
- 6 tail -n 1 /etc/passwd
- 7 cd /home/anna
- 8 openssl genrsa -out anna.key 2048
- 9 ls
- 10 openssl req -new -key anna.key -out anna.csr -subj "/CN=anna"
- 11 openssl x509 -req -in anna.csr -CA /etc/kubernetes/pki/ca.crt -CAkey /etc/kubernetes/pki/ca.key -CAcreateserial -out anna.crt -days 600
- 12 ls
- 13 mkdir .certs
- 14 mv anna.crt anna.key .certs/
- 15 ls .certs/
- 16 exit
- 17 cd /home/anna/
- 18 mkdir .kube
- 19 pwd
- 20 cp /etc/kubernetes/admin.conf /home/anna/.kube/config
- 21 vim .kube/config
- 22 chown -R anna /home/anna
- 23 ls -a
- 24 ls -al
- 25 chown -R anna:anna /home/anna
- 26 cd .certs
- 27 ls -l
- 28 chmod 400 anna.key
- 29 exit
- 30 vim /etc/hosts
- 31 history
- 32 ip a
- 33 vim /etc/hosts
- 34 yum install vim git bash-completion
- 35 git clone https://github.com/sandervanvugt/cka
- 36 cd cka
- 37 ls
- 38 vim setup-docker.sh
- 39 ./setup-docker.sh
- 40 vim setup-kubetools.sh
- 41 ./setup-kubetools.sh
- 42 ls
- 43 ./counter.sh 14
- 44 kubeadm init
- 45 vim /etc/hosts
- 46 kubeadm reset
- 47 kubeadm init
- 48 vim /tmp/todo.txt
- 49 su - student
- 50 history
- 51 su - student
- 52 su - anna
- 53 exit
- 54 etcdctl --help | less
- 55 ETCDCTL_API=3 etcdctl --help | less
- 56 ps aux | grep etcd
- 57 ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 snapshot save snapshotdb
- 58 ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key snapshot save snapshotdb
- 59 ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key get /
- 60 ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1: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
- 61 cd /etc/kubernetes/pki/etcd/
- 62 ls
- 63 history
- USER COMMANDS
- OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"curl\": executable file not found in $PATH": unknown
- command terminated with exit code 126
- [student@control ckad]$ history
- 1 mkdir .kube
- 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
- 3 sudo chown $(id -u):$(id -g) $HOME/.kube/config
- 4 vim .kube/config
- 5 kubectl get all
- 6 kubectl get all --all-namespaces
- 7 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
- 8 kubectl get all --all-namespaces
- 9 kubectl get pods --all-namespaces
- 10 vim /tmp/todo.txt
- 11 ssh root@worker1
- 12 ssh root@worker2
- 13 kubectl get nodes
- 14 history
- 15 exit
- 16 history
- 17 vim exercise2.yaml
- 18 kubectl -h
- 19 kubectl completion -h
- 20 source <(kubectl completion bash)
- 21 kubectl create namespace -h
- 22 kubectl create namespace mynamespace
- 23 vim exercise2.yaml
- 24 kubectl create -f exercise2.yaml
- 25 kubectl run alpine2 --image=alpine --command sleep 3600 -n mynamespace --dry-run=client -o yaml > rtex2.yaml
- 26 vim rtex2.yaml
- 27 kubectl explain pods.spec
- 28 vim rtex2.yaml
- 29 kubectl get pods --namespace=mynamespace
- 30 kubectl describe pods alpine --namespace=mynamespace
- 31 kubectl get pods alpine --namespace=mynamespace -o yaml | less
- 32 cd cka
- 33 su -
- 34 vim exercise3.yaml
- 35 kubectl create -f exercise3.yaml
- 36 kubectl explain pods
- 37 vim exercise3.yaml
- 38 kubectl create -f exercise3.yaml
- 39 kubectl run --image=nginx mynginx --dry-run=client -o yaml | less
- 40 vim exercise3.yaml
- 41 kubectl create -f exercise3.yaml
- 42 kubectl get pods
- 43 watch -n1 kubectl get pods
- 44 kubectl describe pods multi-containers
- 45 kubectl delete pods multi-containers
- 46 vim exercise3.yaml
- 47 kubectl apply -f exercise3.yaml
- 48 kubectl get pods
- 49 kubectl delete --grace-period=0 --force pods multi-containers
- 50 kubectl get nodes
- 51 vim exercise4b.txt
- 52 kubectl taint nodes master key:NoSchedule-
- 53 kubectl taint node master key:NoSchedule-
- 54 kubectl get nodes
- 55 kubectl taint node control.example.com key:NoSchedule-
- 56 kubectl taint nodes --all node-role.kubernetes.io/master-
- 57 git clone https://github.com/sandervanvugt/cka
- 58 cd cka
- 59 kubectl label nodes worker2.example.com disktype=ssd
- 60 kubectl get nodes --show-labels
- 61 vim selector-pod.yaml
- 62 kubectl apply -f selector-pod.yaml
- 63 kubectl get pods -o wide
- 64 kubectl run nginx1 --image=nginx
- 65 kubectl run nginx2 --image=nginx
- 66 kubectl run nginx3 --image=nginx
- 67 kubectl get pods -o wide
- 68 kubectl get nodes -o wide
- 69 kubectl describe nodes control.example.com
- 70 kubectl tain nodes worker1.example.com example-key=value1:NoSchedule
- 71 kubectl taint nodes worker1.example.com example-key=value1:NoSchedule
- 72 kubectl run nginx4 --image=nginx
- 73 kubectl run nginx5 --image=nginx
- 74 kubectl run nginx6 --image=nginx
- 75 kubectl get pods -o wide
- 76 kubectl describe nodes worker1.example.com | less
- 77 kubectl create deployment nginx-taint --image=nginx
- 78 kubectl scale deployment nginx-taint --replicas=3
- 79 kubectl get pods -o yaml
- 80 kubectl get pods -o wide
- 81 vim taint-toleration.yaml
- 82 kubectl create -f taint-toleration.yaml
- 83 kubectl get pods -o wide
- 84 vim taint-toleration.yaml
- 85 history | grep git
- 86 kubectl get daemonsets.apps --namespace kube-system
- 87 kubectl get daemonsets.apps --namespace kube-system --show-labels
- 88 kubectl get all --namespace=kube-system --selector name=weave-net
- 89 kubectl get all --namespace=kube-system --selector name=weave-net -o wide
- 90 ./counter.sh 13
- 91 vim ex251.yaml
- 92 kubectl explain --recursive pods
- 93 history
- 94 kubectl create deployment nginx-ex5 --image=nginx --replicas=5
- 95 kubectl get all --selector app=nginx-ex5
- 96 kubectl get all
- 97 kubectl get all --selector app=nginx-ex5
- 98 ./counter.sh 5
- 99 vim ws4.yaml
- 100 kubectl create -f ws4.yaml ; watch -n1 kubectl get pods
- 101 kubectl describe pods myapp-pod
- 102 ./counter.sh 4
- 103 vim ex15.yaml
- 104 kubectl apply -f ex15.yaml
- 105 vim ex15.yaml
- 106 kubectl get all --selector name=nginx-ds
- 107 kubectl get daemonsets
- 108 kubectl get all --selector name=nginx-ds -o wide
- 109 remove noschedule
- 110 kubectl taint node worker1.example.com
- 111 kubectl describe nodes worker1.example.com | less
- 112 kubectl taint node worker1.example.com example-key=value1:NoSchedule-
- 113 kubectl explain pods.spec.containers.spec
- 114 kubectl explain pods.spec.containers
- 115 kubectl explain pods.spec.containers | less
- 116 kubectl explain pods.spec.containers --recursive | less
- 117 history
- 118 ip a
- 119 ./counter.sh 4
- 120 kubectl create deployment mynginx --image=nginx:1.14
- 121 kubectl get all --selector app=mynginx
- 122 kubectl scale deployment mynginx --replicas=5
- 123 kubectl get all --selector app=mynginx
- 124 kubectl edit deployments.apps mynginx
- 125 kubectl get all --selector app=mynginx
- 126 kubectl get deployments.apps mynginx -o yaml | less
- 127 kubectl explain deployment.spec.strategy
- 128 kubectl edit -h
- 129 kubectl edit --record=true deployments.apps mynginx
- 130 kubectl rollout history deployment mynginx
- 131 kubectl create deployment -h | less
- 132 sudo useradd anna && sudo cd /home/anna
- 133 pwd
- 134 sudo -i
- 135 kubectl config set-credentials anna --client-certificate=/home/anna/.certs/anna.crt --client-key=/home/anna/.certs/anna.key
- 136 kubectl config set-context anna-context --cluster=kubernetes --user=anna
- 137 pwd
- 138 su -
- 139 vim podacessrole.yaml
- 140 kubectl create -f podacessrole.yaml
- 141 vim rolebinding.yaml
- 142 kubectl create -f rolebinding.yaml
- 143 kubectl run rolepod --image=nginx
- 144 su - anna
- 145 exit
- 146 cd cka
- 147 vim rolebinding.yaml
- 148 kubectl config view
- 149 sudo su - anna
- 150 kubectl cordon worker1
- 151 kubectl cordon worker1.example.com
- 152 kubectl completion -h
- 153 source <(kubectl completion bash)
- 154 history
- 155 kubectl auth can-i get pods --as anna
- 156 ./counter.sh 15
- 157 kubectl top -h
- 158 kubectl top pod
- 159 git clone https://github.com/kubernetes-sigs/metrics-server
- 160 ls
- 161 cd metrics-server/
- 162 ls
- 163 cd manifests/
- 164 ls
- 165 cd ../..
- 166 kubectl create -f metrics-server/manifests/base/
- 167 vim metrics-server/manifests/base/kustomization.yaml
- 168 kubectl api-versions | less
- 169 kubectl get pods
- 170 kubectl get pods -o kube-system
- 171 kubectl get pods --name-space kube-system
- 172 kubectl get pods --namespace kube-system
- 173 kubectl apply -k metrics-server/manifests/base/
- 174 vim metrics-server/manifests/base/kustomization.yaml
- 175 kubectl apply -k metrics-server/manifests/base/
- 176 kubectl delete -f metrics-server/manifests/base/
- 177 kubectl apply -k metrics-server/manifests/base/
- 178 vim metrics-server/manifests/base/kustomization.yaml
- 179 kubectl kubectl get deployments --namespace kube-system
- 180 kubectl get deployments --namespace kube-system
- 181 kubectl get pods --namespace kube-system
- 182 kubectl -n kube-system edit deployments.apps metrics-server
- 183 kubectl -n kube-system logs metrics-server-755b999b8-swzqk
- 184 history
- 185 kubectl get pods --namespace kube-system
- 186 kubectl top
- 187 kubectl top pod
- 188 kubectl top pod -h
- 189 kubectl top pod --sort-by=cpu
- 190 ./counter.sh 5
- 191 vim ww.yaml
- 192 cat ww.yaml
- 193 kubectl run busybox22 --image=busybox:1.28 -- sleep 3600
- 194 kubectl get pods busybox22 -o yaml | less
- 195 cat ww.yaml
- 196 kubectl expose pod busybox22 --port 80 --name=mysvc --type=ClusterIP
- 197 kubectl exec -it busybox22 -- nslookup mysvc
- 198 kubectl exec -it busybox22 -- nslookup busybox22
- 199 kubectl get pods
- 200 kubectl get pods -n kube-system
- 201 kubectl get svc -n kube-system
- 202 kubectl exec -it busybox22 -- cat /etc/resolv.conf
- 203 kubectl -n kube-system describe pods coredns-f9fd979d6-qhdt7
- 204 kubectl logs -n kube-system coredns-f9fd979d6-qhdt7
- 205 kubectl get ep
- 206 kubectl get svc -n kube-system kube-dns -o yaml | less
- 207 kubectl describe svc -n kube-system kube-dns
- 208 kubectl get pods -o wide
- 209 sudo iptables -L
- 210 ssh root@worker1
- 211 ./counter.sh 14
- 212 ssh root@worker2
- 213 kubectl get pods
- 214 ssh root@worker2
- 215 kubectl get pods
- 216 ssh root@worker2
- 217 ls
- 218 vim setup-lb.sh
- 219 ./counter.sh
- 220 ./counter.sh 15
- 221 etcdctl --help
- 222 sudo yum search etcdctl
- 223 sudo yum provides */etcdctl
- 224 ping nu.nl
- 225 sudo yum install etcd
- 226 sudo -i
- 227 kubectl create deployment nginxsvc --image=nginx
- 228 kubectl scale deployment nginxsvc --replicas=3
- 229 kubectl expose deployment nginxsvc --port=80
- 230 kubectl get svc
- 231 kubectl get endpoints
- 232 curl http://10.106.68.11
- 233 kubectl edit svc nginxsvc
- 234 kubectl get svc
- 235 curl http://192.168.4.81:32000
- 236 curl http://192.168.4.82:32000
- 237 curl http://192.168.4.80:32000
- 238 cd ..
- 239 ls
- 240 git clone https://github.com/sandervanvugt/ckad
- 241 cd ckad
- 242 vim nginxsvc-ingress.yaml
- 243 kubectl create -f nginxsvc-ingress.yaml
- 244 kubectl exec -it busybox22 -- curl nginxsvc.info
- 245 history
Add Comment
Please, Sign In to add comment