1、We have deployed a number of PODs. They are labelled with tier, env and bu. How many PODs exist in the dev environment (env)?
2、We have deployed a number of PODs. They are labelled with tier, env and bu. How many PODs exist in the dev environment (env)?
3、How many objects are in the prod environment including PODs, ReplicaSets and any other objects?
4、Identify the POD which is part of the prod environment, the finance BU and of frontend tier?
5、Create a taint on node01 with key of spray, value of mortein and effect of NoSchedule
6、Create a new pod with the nginx image and pod name as mosquito.
7、Create another pod named bee with the nginx image, which has a toleration set to the taint mortein.
8、Remove the taint on controlplane, which currently has the taint effect of NoSchedule.
9、Apply a label color=blue to node node01
10、Create a new deployment named blue with the nginx image and 3 replicas.
11、Set Node Affinity to the deployment to place the pods on node01 only.
Name: blue
Replicas: 3
Image: nginx
NodeAffinity: requiredDuringSchedulingIgnoredDuringExecution
Key: color
value: blue
12、Create a new deployment named red with the nginx image and 2 replicas, and ensure it gets placed on the controlplane node only.
Use the label key - node-role.kubernetes.io/master - which is already set on the controlplane node.
13、resource-limit and request(资源的要求和限制)
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
14、将pod删除重建
kubectl replace --force -f XXX.yaml
15、Deploy a DaemonSet for FluentD Logging.
Use the given specifications.
Name: elasticsearch
Namespace: kube-system
Image: k8s.gcr.io/fluentd-elasticsearch:1.20
注:因命令集中没有创建daemonset的指令,故而像创建一个deployment,之后再修改deployment的yaml文件中的kind即可
16、How many static pods exist in this cluster in all namespaces?
注:static pod的默认路径在/etc/kubernetes/mainfests/下 或查看pod名称,static pod 命名一般会在末尾加上node的名称。
17、Create a static pod named static-busybox that uses the busybox image and the command sleep 1000
18、We just created a new static pod named static-greenbox. Find it and delete it.
This question is a bit tricky. But if you use the knowledge you gained in the previous questions in this lab, you should be able to find the answer to it.
注:简单的delete命令是无法删除static pod的,他会在你删除后再次自动创建,故而我们需要找到创建的static pod的yaml文件将其清除
首先查看/etc/kubernetes/mainfests下是否存在static-greenbox的yaml文件
没有,查看此pod在哪个node上
登录node01节点机器
查看static pod的路径在哪里
到指定文件夹下删除green.yaml文件即可
回到控制节点查看是否已删除,如下图可见已删除
19、Let’s create a configmap that the new scheduler will employ using the concept of ConfigMap as a volume.
Create a configmap with name my-scheduler-config using the content of file /root/my-scheduler-config.yaml
20、Deploy an additional scheduler to the cluster following the given specification.
Use the manifest file provided at /root/my-scheduler.yaml. Use the same image as used by the default kubernetes scheduler.
首先查看the default kubernetes scheduler.使用的镜像
修改my-scheduler.yaml文件