K8S认证|CKS题库+答案| 8. 沙箱运行容器 gVisor

目录

[8. 沙箱运行容器 gVisor](#8. 沙箱运行容器 gVisor)

[免费获取并激活 CKA_v1.31_模拟系统](#免费获取并激活 CKA_v1.31_模拟系统)

题目

开始操作:

1)、切换集群

2)、官网找模板

[3)、创建 RuntimeClass](#3)、创建 RuntimeClass)

[4)、 将命名空间为 server 下的 Pod 引用 RuntimeClass](#4)、 将命名空间为 server 下的 Pod 引用 RuntimeClass)

[5)、编辑 deployment](#5)、编辑 deployment)

6)、检查Pod状态


8. 沙箱运行容器 gVisor

免费获取并激活 CKA_v1.31_模拟系统

题目

您必须在以下Cluster/Node上完成此考题:

Cluster Master node Worker node

CKS00808 master node01

.

设置配置环境:

candidate@node01\]$ kubectl config use-context CKS00808 . **Context** **.** 该 cluster 使用 containerd 作为 CRI 运行时。 containerd 的默认运行时处理程序是 runc 。 containerd 已准备好支持额外的运行时处理程序 runsc (gVisor)。 . **Task** **.** 使用名为 runsc 的现有运行时处理程序,创建一个名为 untrusted 的 RuntimeClass。 更新 namespace server 中的所有 Pod 以在 gVisor 上运行。 您 可以在 /cks/gVisor/rc.yaml 中找到一个模版清单。

1)、切换集群

bash 复制代码
kubectl config use-context CKS00808

2)、官网找模板

官网搜"Runtime Class"

阿大撒

3)、创建 RuntimeClass

bash 复制代码
vim /cks/gVisor/rc.yaml

具体内容

bash 复制代码
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
  name: untrusted
handler: runsc

CKS模拟系统截图

创建Runtime Class

bash 复制代码
kubectl create -f /cks/gVisor/rc.yaml

查看是否创建成功

bash 复制代码
kubectl get RuntimeClass

CKS模拟系统截图

4)、 将命名空间为 server 下的 Pod 引用 RuntimeClass

bash 复制代码
ubectl -n server get deployment

CKS模拟系统截图

5)、编辑 deployment

bash 复制代码
kubectl -n server edit deployments busybox-run
kubectl -n server edit deployments nginx-host
kubectl -n server edit deployments run-test

#执行以上三条编辑命令后操作一样,按照如下操作。
...
#要找第二个spec,也就是下面有 containers 这个字段的
spec。
  runtimeClassName: untrusted          #添加这一行,注意空格对齐,保存会报错,忽略即可。
  containers:
...

CKS模拟系统截图

6)、检查Pod状态

bash 复制代码
kubectl -n server get pod

CKS模拟系统截图


CKA高仿真环境简单演示视频

相关推荐
您的通讯录好友6 分钟前
conda环境导出
linux·windows·conda
ifanatic24 分钟前
[每周一更]-(第159期):Go 工程师视角:容器化技术(Docker/Kubernetes)与CI/CD流程的应用场景
docker·golang·kubernetes
笨小孩@GF 知行合一34 分钟前
OSPF实验:外部路由引入
运维·网络·hcip·数通·ospf
asdfg12589631 小时前
为什么要在出口路由器router配置NAT与默认路由
运维·网络·计算机网络
代码AC不AC1 小时前
【Linux】vim工具篇
linux·vim·工具详解
码农hbk1 小时前
Linux signal 图文详解(三)信号处理
linux·信号处理
bug攻城狮2 小时前
Skopeo 工具介绍与 CentOS 7 安装指南
linux·运维·centos
宇宙第一小趴菜2 小时前
08 修改自己的Centos的软件源
linux·运维·centos
bug攻城狮2 小时前
彻底禁用 CentOS 7.9 中 vi/vim 的滴滴声
linux·运维·服务器·centos·vim
程序猿阿伟2 小时前
《云原生微服务治理进阶:隐性风险根除与全链路能力构建》
微服务·云原生·架构