[CKS] K8S RuntimeClass SetUp

最近准备花一周的时间准备CKS考试,在准备考试中发现有一个题目关于RuntimeClass创建和挂载的题目。

​ 专栏其他文章:

What's the RuntimeClass

参见官方文档: https://v1-28.docs.kubernetes.io/docs/concepts/containers/runtime-class/

Question 1

Create a RuntimeClass called sandbox that uses the preconfigured runsc runtime for untrusted workloads.

这个题要求我们创建一个叫做sandbox的runtimeclass,他的handler是runsc

Practice

  • 编辑/创建 sandbox.yml,文件内容如下:
  • 创建RuntimeClass
shell 复制代码
kubectl create -f sandbox.yml

Question 2

Configure all Pods in the sunnydale namespace to use gVisor.

这个题要求我们将sunnydale下面所有的pod配置上gVisor,这就是我们刚才创建的runtimeClass

Practice

  • 查看sunnydale下面的所有的pod,kubectl get pod -n sunnydale,通过这个我们可以看到所有的pod是通过deployment创建的

    这时,我们就需要对每个deployment来进行修改使用这个runtimeClass,通过kubectl get deployment -n sunnydale可以看到这个下面的所有的deployment:

  • 编辑所有deployment, kubectl edit deployment -n sunnydale xxx,在deployment中添加如下内容:

yaml 复制代码
spec:
  template:
    spec:
      runtimeClassName: sandbox

配置每个container的runtimeClassNamesandbox

相关推荐
她说..1 分钟前
Apache Commons Lang3 Pair 完整版实战详解
java·spring·java-ee·apache·springboot
砍材农夫9 分钟前
redis|spring-boot redis geo|附近定位功能
java·spring boot·redis
满怀冰雪28 分钟前
第29篇-状态压缩DP-当状态很多时如何降维优化
java·算法·动态规划
weixin_4467291630 分钟前
javaweb--文件上传
java
渡我白衣37 分钟前
打印宏与socket模块设计
java·linux·开发语言·c++·ide·人工智能·eclipse
智码看视界1 小时前
Day18 SpringBoot自动配置原理:从@SpringBootApplication开始
java·spring boot·后端·自动装配
黒亱中旳10 小时前
Java AI 框架三国杀:Solon AI vs Spring AI vs LangChain4j 深度对比
java·人工智能·spring
网络工程小王10 小时前
[智能对话系统架构设计文档]
java·系统架构·langraph
alxraves10 小时前
医用超声远程会诊系统:会诊平台的核心架构与功能解析
java·人工智能·架构
带刺的坐椅10 小时前
用 Solon AI ReActAgent 落地智能客服工单处理
java·ai·llm·agent·solon·react-agent