侧边栏壁纸
博主头像
里奥的博客博主等级

行动起来,活在当下

  • 累计撰写 24 篇文章
  • 累计创建 7 个标签
  • 累计收到 2 条评论

目 录CONTENT

文章目录

CKA 练习题01- PODs

里奥
2024-05-05 / 0 评论 / 0 点赞 / 73 阅读 / 7652 字

视频观看地址:https://open.douyin.com/player/video?vid=7365055258772426025&autoplay=0

问题1

How many pods exist on the system?

In the current(default) namespace.

说明: 使用 kubectl get pods 命令, 所以答案是 0

问题2

Create a new pod with the nginx image.

说明: 使用 kubectl run nginx --image=nginx 命令

问题3

How many pods are created now?

Note: We have created a few more pods. So please check again.

说明: 使用 kubectl get pods 命令 所以答案是 4

问题4

What is the image used to creat the new pods?

You must look at one of the new pods in detail to figure this out.

说明: 使用 kubectl describe pod xxxx 命令, 然后查看Image字段

问题5

Which nodes are these pods placed on?

You must look at all the pods in detail to figure this out.

说明: 使用 kubectl get pods -o wide 命令, 然后查看 NODE

问题6

How many containers are part of the pod webapp?

Note: We just created a new POD. Ignore the state of the POD for now.

说明: 使用 kubectl get pods 命令, 然后查看 READY

问题7

What images are used in the new webapp pod?

You must look at all the pods in detail to figure this out.

说明: 使用 kubectl describe pod XXXX 命令, 然后查看 Image 字段

问题8

What is the state of the container agentx in the pod webapp?

Wait for it to finish the ContainerCreating state

说明: 使用 kubectl describe pod XXXX 命令, 然后查看 State 字段

问题9

Why do you think the container agentx in pod webapp is in error?

Try to figure it out from the events section of the pod.

说明: 使用 kubectl describe pod XXXX 命令, 然后查看 Events 部分

问题10

What does the READY column in the output of the kubectl get pods command indicate?

说明: 使用 kubectl get pods 命令可以查看READY 列,列的意义为意义为: POD中处于Running 状态中的容器数量/POD中容器的总数量(Running Containers in POD/Total Containers in POD

问题11

Delete the webapp Pod.

Once deleted, wait for the pod to fully terminate.

说明: 使用 kubectl delete pod 命令

问题12

Create a new pod with the name redis and the image redis123.

Use a pod-definition YAML file. And yes the image name is wrong!

说明:

首先:使用 kubectl run redis --image=redis123 --dry-run=client -o yaml > redis-definition.yaml 命令生成yaml

然后: 使用 kubectl apply -f redis-definition.yaml 命令创建

最后: 使用 kubectl get pods 命令查看

问题13

Now change the image on this pod to redis.

Once done, the pod should be in a running state.

说明: 使用 kubectl edit pod redis 命令编辑 image 字段

0

评论区