Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [student@control1 cka]$ 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 kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
- 5 kubectl delete -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
- 6 kubectl apply -f https://docs.projectcalicao.org/v3.14/manifests/calico.yaml
- 7 kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml
- 8 kubectl get ns -a
- 9 kubectl get ns -A
- 10 kubectl get pods kube-system
- 11 kubectl get pods -n kube-system
- 12 exit
- 13 kubectl get nodes
- 14 exit
- 15 kubectl get nodes
- 16 exit
- 17 kubectl get all
- 18 git clone https://github.com/sandervanvugt/ckad
- 19 cd ckad/
- 20 cd ..
- 21 git clone https://github.com/sandervanvugt/cka
- 22 cd cka
- 23 vim pv-pvc-pod.yaml
- 24 kubectl create -f pv-pvc-pod.yaml
- 25 kubectl create ns myvol
- 26 kubectl create -f pv-pvc-pod.yaml
- 27 kubectl get pv
- 28 kubectl get pvc
- 29 kubectl get pvc -n myvol
- 30 kubectl describe pod -n myvol
- 31 vim pv-pvc-pod.yaml
- 32 kubectl explain pv.spec | less
- 33 ./counter.sh 6
- 34 kubectl completion -h
- 35 source <(kubectl completion bash)
- 36 kubectl get all
- 37 kubectl create deployment mydeploy --image=nginx:1.14
- 38 kubectl set image deployment/mydeploy nginx=nginx:1.16.1 --record
- 39 kubectl get all
- 40 kubectl rollout history
- 41 kubectl rollout history deployment mydeploy
- 42 kubectl get deployments.apps mydeploy -o yaml
- 43 kubectl rollout undo deployment mydeploy
- 44 kubectl rollout history deployment
- 45 kubectl cordon -h
- 46 kubectl drain -h
- 47 kubectl drain worker2.example.com --ignore-daemonsets
- 48 kubectl get nodes
- 49 kubectl uncordon -h
- 50 kubectl uncordon worker2.example.com
- 51 kubectl get nodes
- 52 ./counter.sh 16
- 53 sudo etcdctl
- 54 sudo yum provides */etcdctl
- 55 sudo yum install etcd
- 56 sudo etcdctl --help
- 57 sudo ETCDCTL_API=3 etcdctl
- 58 sudo ETCDCTL_API=3 etcdctl snapshot save -h
- 59 sudo ETCDCTL_API=3 etcdctl snapshot save myetcd
- 60 sudo ETCDCTL_API=3 etcdctl snapshot --endpoints=localhost:2379
- 61 sudo ls /etc/kubernetes/pki/etcd/
- 62 sudo ETCDCTL_API=3 etcdctl snapshot --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
- 63 sudo ETCDCTL_API=3 etcdctl snapshot --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 / --keys-only
- 64 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
- 65 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 snapshot.db
- 66 ps aux | grep api-server
- 67 ps aux | grep api
- 68 ps aux | grep api | grep etcd
- 69 ps aux | grep etcd
- 70 sudo -i
- 71 vim ~/.kube/config
- 72 sudo -i
- 73 kubectl config set-credentials anna --client-certificate=/home/anna/.certs/anna.crt --client-key=/home/anna/.certs/anna.key
- 74 kubectl config view
- 75 mkdir /home/anna/.kube
- 76 cp ~/.kube/config /home/anna/.kube/
- 77 exit
- 78 kubectl get all
- 79 cd cka
- 80 vim podacessrole.yaml
- 81 kubectl create -f podacessrole.yaml
- 82 vim rolebinding.yaml
- 83 kubectl create -f rolebinding.yaml
- 84 kubectl get pods
- 85 kubectl run rolepod --image=nginx
- 86 kubectl get pods
- 87 su - anna
- 88 exit
- 89 kubectl get pods --as anna
- 90 kubectl auth can-i get pods --as anna
- 91 cd cka
- 92 ./counter.sh 18
- 93 ./counter.sh 3
- 94 kubectl create deploy mydep --image=busybox --dry-run=client -o yaml --replicas=3 -- sleep 1000 >dep.yaml
- 95 vim dep.yaml
- 96 kubectl create -f dep.yaml
- 97 kubectl delete -f dep.yaml
- 98 kubectl get nodes
- 99 ./counter.sh 6
- 100 kubectl create ns restricted
- 101 kubectl create quota -h
- 102 kubectl create quota qa --hard=memory=1G,pods=3 --namespace restricted
- 103 kubectl get quota
- 104 kubectl get quota -n restricted
- 105 kubectl kubectl completion -h
- 106 kubectl completion -h
- 107 source <(kubectl completion bash)
- 108 kubectl describe ns restricted
- 109 kubectl create deploy nginx --image=nginx --replicas=3 -n restricted
- 110 kubect get all -n restricted
- 111 kubectl get all -n restricted
- 112 kubectl describe -n restricted rs nginx-6799fc88d8
- 113 kubectl set -h
- 114 kubectl set resources -h
- 115 #kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi
- 116 kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi
- 117 kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi -n restricted
- 118 kubectl get all -n restricted
- 119 history
- 120 kubectl get nodes
- 121 kubectl get all -n restricted
- 122 kubectl get nodes
- 123 vim newexo.txt
- 124 kubectl explain pod.spec
- 125 vim ab3.yaml
- 126 kubectl create -f ab3.yaml
- 127 kubectl get pods
- 128 kubectl describe pod pod
- 129 kubectl get nodes
- 130 vim ab3.yaml
- 131 kubectl describe node worker1.example.com
- 132 kubectl get events
- 133 ssh root@worker1.example.com
- 134 kubectl get pods
- 135 history
- 136 kubectl get pods
- 137 kubectl create -f ab3.yaml
- 138 kubectl get pods
- 139 kubectl get pods -o wide
- 140 vim igfds.yaml
- 141 kubectl create -h
- 142 vim igfds.yaml
- 143 kubectl explain daemonset.spec
- 144 kubectl create -f igfds.yaml
- 145 kubectl get ds
- 146 kubectl get pods -o wide
- 147 vim igfds.yaml
- 148 ./counter.sh 12
- 149 kubectl get all -n restricted
- 150 kubectl describe replicaset.apps/nginx-6b5f657dd8 -n restricted
- 151 kubectl set resources -h | less
- 152 kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
- 153 kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi -n restricted
- 154 kubectl get all -n restricted
- 155 kubectl get pods nginx-6689944d78-lqzfj -n restricted
- 156 kubectl get pods nginx-6689944d78-lqzfj -n restricted -o yaml
- 157 kubectl explain pods.spec.containers.resources
- 158 vim nwpolicy-complete-example.yaml
- 159 kubectl get deploy
- 160 kubectl delete deploy mydeploy
- 161 kubectl get pods
- 162 kubectl delete ds nginx
- 163 kubectl delete ds nginx-ds
- 164 kubectl get all -A --selector app=nginx
- 165 kubectl create -f nwpolicy-complete-example.yaml
- 166 kubectl expose pod nginx --port=80
- 167 kubectl get svc
- 168 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 169 kubectl get pods --show-labels
- 170 kubectl label pod busybox access=true
- 171 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
- 172 kubectl create ns nwp-namespace
- 173 vim nwp-lab11-1.yaml
- 174 kubectl create -f nwp-lab11-1.yaml
- 175 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx
- 176 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx
- 177 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 178 kubectl expose pod nwp-nginx --port=80
- 179 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 180 kubectl get pods -A -o wide
- 181 kubectl get pods -n default
- 182 kubectl get pods -n nwp-namespace
- 183 kubectl get nwp
- 184 kubectl get networkpolicy
- 185 kubectl get pods -n default --show-labels
- 186 kubectl label pod nwp-nginx app-
- 187 kubectl get pods -n default --show-labels
- 188 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 189 kubectl get svc --show-labels
- 190 kubectl label svc nwp-nginx app-
- 191 kubectl get svc --show-labels
- 192 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 193 kubectl get networkpolicy
- 194 kubectl delete networkpolicy access-nginx
- 195 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 196 vim nwp-lab11-2.yaml
- 197 kubectl create -f nwp-lab11-2.yaml
- 198 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
- 199 history
- [student@control1 cka]$
- [student@control1 cka]$ su -
- Password:
- Last login: Fri Mar 19 09:30:49 EDT 2021 from gateway on pts/0
- [root@control1 ~]# history
- 1 ssh 192.168.29.64
- 2 vim /etc/hosts
- 3 vi /etc/hosts
- 4 yum install -y vim git bash-completion
- 5 git clone https://github.com/sandervanvugt/cka
- 6 cd cka
- 7 ./setup-docker.sh
- 8 ./setup-kubetools.sh
- 9 history
- 10 cat /etc/hosts
- 11 for i in 62 63 64 65; do scp /etc/hosts 192.168.29.$i:/etc/; done
- 12 scp /etc/hosts 192.168.29.200:/etc/
- 13 vim setup-lb.sh
- 14 ip a
- 15 vim keepalived.conf
- 16 vim setup-lb.sh
- 17 vim check_apiserver.sh
- 18 vim setup-lb.sh
- 19 chmod +x setup-lb.sh
- 20 vim /etc/hosts
- 21 vim setup-lb.sh
- 22 ./setup-lb.sh
- 23 ip a
- 24 vim setup-lb.sh
- 25 vim keepalived.conf
- 26 ls *server*
- 27 vim check_apiserver.sh
- 28 kubeadm init --control-plane-endpoint "192.168.29.100:8443" --upload-certs
- 29 vim /tmp/hasetup.txt
- 30 su - student
- 31 cat /tmp/hasetup.txt
- 32 ssh control2
- 33 ssh control3
- 34 su - student
- 35 ssh control2
- 36 cat /tmp/hasetup.txt
- 37 ssh worker1
- 38 ssh worker2
- 39 su - student
- 40 history
- 41 ip a
- 42 history
- 43 ./counter.sh 5
- 44 vim /tmp/hasetup.txt
- 45 history
- 46 vim /tmp/hasetup.txt
- 47 exit
- 48 cd /etc/kubernetes/manifests/
- 49 ls
- 50 vim etcd.yaml
- 51 exit
- 52 useradd anna
- 53 cd /home/anna
- 54 openssl genrsa -out anna.key 2048
- 55 ls
- 56 openssl req -new -key anna.key -out anna.csr -subj "/CN=anna"
- 57 openssl x509 -req -in anna.csr -CA /etc/kubernetes/pki/ca.crt -CAkey /etc/kubernetes/pki/ca.key -CAcreateserial -out anna.crt -days 600
- 58 mkdir .certs
- 59 ls
- 60 mv ann* .certs/
- 61 cd ..
- 62 chmod -R 777 anna
- 63 ls -l anna
- 64 ls -l
- 65 exit
- 66 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement