File tree 8 files changed +95
-0
lines changed
8 files changed +95
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Practice questions
2
+
3
+ Create a pod from the image nginx
4
+
5
+ ``` sh
6
+
7
+ kubectl run nginx --image=nginx
8
+
9
+ ```
10
+
11
+ Create a pod from the image nginx with the yaml spec and do not apply it (hint : use dry-run)
12
+
13
+ ``` sh
14
+
15
+ kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml
16
+
17
+ ```
18
+
19
+ Deploy a pod named pod-test using the image nginx:1.2-alpine
20
+
21
+ ``` sh
22
+
23
+ kubectl run pod-test --image=nginx:1.2-alpine
24
+
25
+ ```
26
+
Original file line number Diff line number Diff line change
1
+ # Practice questions
2
+
3
+ A pod named memcached has already been created.
4
+
5
+ Create a service called "service1" to expose the pod through a service at the cluster level on port 6379.
6
+
7
+ ``` sh
8
+
9
+ kubectl expose po memcached --name=service1 --port=6379 --target-port=6379
10
+
11
+ ```
Original file line number Diff line number Diff line change
1
+ ##
2
+
3
+ ``` sh
4
+
5
+
6
+
7
+ ```
Original file line number Diff line number Diff line change
1
+ # Practice questions
2
+
3
+ A pod named memcached has already been created.
4
+
5
+ Create a service called "service1" to expose the pod through a service at the cluster level on port 6379.
6
+
7
+ ``` sh
8
+
9
+ kubectl expose po memcached --name=service1 --port=6379 --target-port=6379
10
+
11
+ ```
Original file line number Diff line number Diff line change
1
+ ## Question
2
+
3
+
4
+ ``` sh
5
+
6
+
7
+
8
+ ```
Original file line number Diff line number Diff line change
1
+ ## Question 1 - Perform an ETCD backup
2
+
3
+
4
+ ``` sh
5
+
6
+ ETCDCTL_API=3 etcdctl \
7
+ --cacert=/etc/kubernetes/pki/etcd/ca.crt \
8
+ --cert=/etc/kubernetes/pki/apiserver-etcd-client.crt \
9
+ --key=/etc/kubernetes/pki/apiserver-etcd-client.key snapshot save < destination>
10
+
11
+ ```
12
+
Original file line number Diff line number Diff line change
1
+ ## Question 1 - Scaling deployment
2
+
3
+ There's a running deployment called "test" that has only 1 pod running. Scale the deployment to 5 replicas.
4
+
5
+ ``` sh
6
+
7
+ kubectl scale deployment test --replicas=5
8
+
9
+ ```
10
+
11
+ Verify that its running now
12
+
13
+
14
+ ``` sh
15
+
16
+ kubectl get deploy test
17
+
18
+ kubectl get po
19
+
20
+ ```
You can’t perform that action at this time.
0 commit comments