[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

相关推荐
BD_Marathon10 分钟前
SpringBoot程序快速启动
java·spring boot·后端
stillaliveQEJ15 分钟前
【JavaEE】Spring IoC(二)
java·开发语言·spring
寻星探路20 分钟前
【Python 全栈测开之路】Python 基础语法精讲(一):常量、变量与运算符
java·开发语言·c++·python·http·ai·c#
行百里er28 分钟前
代码跑得慢?让Spring的StopWatch告诉你真相!
java·后端·github
又是忙碌的一天33 分钟前
SpringMVC响应
java·服务器·数据库
万物皆字节41 分钟前
Spring Cloud Gateway 启动流程源码分析
java·开发语言·spring boot
W001hhh43 分钟前
260110
java·数据库
stillaliveQEJ1 小时前
【JavaEE】Spring IoC(一)
java·spring·java-ee
a程序小傲1 小时前
得物Java面试被问:方法句柄(MethodHandle)与反射的性能对比和底层区别
java·开发语言·spring boot·后端·python·面试·职场和发展
酒书1 小时前
对接阿里云号码认证实现运营商一键登录
java·阿里云