[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

相关推荐
SUPER52662 小时前
本地开发环境_spring-ai项目启动异常
java·人工智能·spring
moxiaoran57532 小时前
Spring AOP开发的使用场景
java·后端·spring
小王师傅667 小时前
【轻松入门SpringBoot】actuator健康检查(上)
java·spring boot·后端
醒过来摸鱼7 小时前
Java classloader
java·开发语言·python
专注于大数据技术栈7 小时前
java学习--StringBuilder
java·学习
loosenivy7 小时前
企业银行账户归属地查询接口如何用Java调用
java·企业银行账户归属地·企业账户查询接口·企业银行账户查询
IT 行者7 小时前
Spring Security 6.x 迁移到 7.0 的完整步骤
java·spring·oauth2
JIngJaneIL7 小时前
基于java+ vue农产投入线上管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
东东的脑洞7 小时前
【面试突击二】JAVA基础知识-volatile、synchronized与ReentrantLock深度对比
java·面试
川贝枇杷膏cbppg8 小时前
Redis 的 AOF
java·数据库·redis