[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

相关推荐
石山代码3 小时前
ArrayList / HashMap / ConcurrentHashMap
java·开发语言
AskHarries4 小时前
系统提示词、开发者指令和用户输入的优先级
java·前端·数据库
gsls2008084 小时前
JVM 堆内存参数 & Docker 容器适配,一次讲清楚
jvm·docker·容器
daidaidaiyu5 小时前
ThingsBoard 规则链系统源码分析和自定义定时器
java
小毛驴8505 小时前
spring-boot-maven-plugin,maven-compiler-plugin 功能对比
java·python·maven
csdn_aspnet5 小时前
Java 霍尔分区算法(Hoare‘s Partition Algorithm)
java·开发语言·算法
霸道流氓气质5 小时前
通义灵码 IDEA 插件完全使用指南
java·ide·intellij-idea
诸葛务农5 小时前
道路行驶条件下电动汽车永磁电机的有效使用寿命及永磁体的失效和回收再利用(下)
java·开发语言·算法
Percep_gan6 小时前
Java8中的stream的测试使用
java
砍材农夫6 小时前
物联网实战:Spring Boot MQTT | MQTT 设备模拟器演示(附源码)
java·spring boot·后端·物联网·spring·netty