继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

备战CKA每日一题——第2天 | Daemonset、对接存储CSI知识点

码农实战
关注TA
已关注
手记 100
粉丝 5
获赞 22

本活动在微信公众号【我的小碗汤】上举行,有送书活动!这里参与答题不能参与到送书活动哦!

昨日考题

以下 Daemonset yaml 中,哪些是正确的?(多选)

A. apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: default labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: containers: - name: fluentd-elasticsearch image: gcr.io/fluentd-elasticsearch/fluentd:v2.5.1 restartPolicy: Never
B. apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: default labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: containers: - name: fluentd-elasticsearch image: gcr.io/fluentd-elasticsearch/fluentd:v2.5.1 restartPolicy: Onfailure
C. apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: default labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: containers: - name: fluentd-elasticsearch image: gcr.io/fluentd-elasticsearch/fluentd:v2.5.1 restartPolicy: Always
D. apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentd-elasticsearch namespace: default labels: k8s-app: fluentd-logging spec: selector: matchLabels: name: fluentd-elasticsearch template: metadata: labels: name: fluentd-elasticsearch spec: containers: - name: fluentd-elasticsearch image: gcr.io/fluentd-elasticsearch/fluentd:v2.5.1

昨日答案

CD

昨日解析

在考试时,只能用谷歌浏览器,并打开两个标签页,一个是考题的标签页,另一个是kubernetes官网标签页。https://kubernetes.io/
查询daemonset的说明文档,见以下链接:
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
在这里插入图片描述

A Pod Template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Always.
Daemonset里的pod Template下必须有RestartPolicy,如果没指定,会默认为Always

restartPolicy 字段,可选值为 Always、OnFailure 和 Never。默认为 Always。 一个Pod中可以有多个容器,restartPolicy适用于Pod 中的所有容器。restartPolicy作用是,让kubelet重启失败的容器。

另外Deployment、Statefulset的restartPolicy也必须为Always,保证pod异常退出,或者健康检查livenessProbe失败后由kubelet重启容器。
https://kubernetes.io/zh/docs/concepts/workloads/controllers/deployment/

Job和CronJob是运行一次的pod,restartPolicy只能为OnFailure或Never,确保容器执行完成后不再重启。
https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/

今日考题

在Kubernetes PVC+PV体系下通过CSI实现的volume plugins动态创建pv到pv可被pod使用有哪些组件需要参与?

A. PersistentVolumeController + CSI-Provisoner + CSI controller plugin
B. AttachDetachController + CSI-Attacher + CSI controller plugin
C. Kubelet + CSI node plugin
打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP