[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

相关推荐
Aision_3 小时前
从工具调用到 MCP、Skill完整学习记录
java·python·gpt·学习·langchain·prompt·agi
zc.z7 小时前
JAVA实现:纯PCM格式音频转换成BASE64
java·音视频·pcm
mask哥8 小时前
力扣算法java实现汇总整理(上)
java·算法·leetcode
Aaswk9 小时前
Java Lambda 表达式与流处理
java·开发语言·python
是宇写的啊9 小时前
Spring AOP
java·spring
苍煜9 小时前
Docker容器网络详解+端口映射原理(系列第二篇:实战核心)
网络·docker·容器
万邦科技Lafite9 小时前
京东item_get接口实战案例:实时商品价格监控全流程解析
java·开发语言·数据库·python·开放api·淘宝开放平台
Mr_pyx10 小时前
Spring AI 入门教程:Java开发者的AI应用捷径
java·人工智能·spring
Zephyr_011 小时前
Leedcode算法题
java·算法
苍煜11 小时前
Java开发IO零基础吃透:BIO、NIO、同步异步、阻塞非阻塞
java·python·nio