CKS 考试题整理 (05)-Container 安全上下文
阅读原文时间:2023年08月17日阅读:2

Container Security Context 应在特定 namespace 中修改 Deployment。

按照如下要求修改 sec-ns 命名空间里的 Deployment secdep

  1. 用ID为30000 的用户启动容器(设置用户ID为:30000)
  2. 不允许进程获得超出父进程的特权(禁止 allowPrivilegeEscalation)
  3. 以只读方式加载容器的根文件系统(对根文件的只读权限)

https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/security-context/

切换集群

kubectl config use-context KSMV00102

按照题目要求,在线修改

kubectl -n sec-ns edit deployment secdep

切换集群

kubectl config use-context KSMV00102

按照题目要求,在线修改

kubectl -n sec-ns edit deployment secdep

在template 字段下面的spec里面,添加红字内容

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章