[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的runtimeClassName为sandbox

相关推荐
余槐i3 小时前
将AI Agent嵌入现有Java系统时,Spring Boot 3.2的异步冲突与内存泄漏排查
人工智能·spring boot·性能优化·kubernetes·ai agent
一条破秋裤4 小时前
Linux 线程分离与主动取消:pthread_detach、pthread_cancel
java·linux·jvm
茉莉玫瑰花茶4 小时前
OpenGL [ 基础概念 ]
java·前端·数据库
周杰偷奶茶4 小时前
【Java】运算符指南
java·开发语言
随性而行3604 小时前
企业微信二次开发如何接入大模型工具?API接口实现智能任务调用的技术思路
java·前端·人工智能·python·微信·机器人·企业微信
Json____4 小时前
基于 Spring Boot + Vue3 的在线考试管理系统实战
java·spring boot·后端·it学习·wwwoop.com
weixin_537590454 小时前
《Spring快速入门到精通》- 实例1.1
java·spring·intellij-idea
jason成都5 小时前
RTKLIB Java版:从C到Java的精密定位引擎,SPP/RTK/PPP/PPP-AR/PPP-RTK全栈实现
java·gnss·rtklib
Data_Journal5 小时前
如何在 Java 中使用 Selenium 绕过 CAPTCHA
java