第20节 新会议改变basefs
❤️💕💕记录sealos开源项目的学习过程。k8s,docker和云原生的学习。Myblog:http://nsddd.top
[TOC]
开始
- add image spec definition #1915
- New design for basefs #1909
- sealer new doc sealerio/sealer.cool#15
- More detail about How to implement image policy for sealer using Kyverno #1899
- sealer CI e2e-test by using github action #1633
关于basefs 的设计:
关于rootfs的安排
描述
签字人:huaiyou huaiyou.cyz@alibaba-inc.com
为了方便基础镜像制作者的使用,我们需要对 sealer 的 rootfs 定义进行规范。
我主要做了以下设计:
bin
等和plugins
的用途基本相同,只是明确了使用方法。- 阐明 Metadata、README.md 和 imageList 的用途。
- 新增 yamls 和 charts 两个目录,为用户提供更灵活扩展基础镜像的能力。
- 最后明确了scripts下不同脚本的用途。
为了方便基础镜像制作者的使用,我们需要标准化 sealer 的 rootfs 的定义。
我主要做了以下设计:
bin
,etc
,plugins
这几个目录的使用基本不变,只是明确了使用方式。- 明确定
scripts
下的不同脚本的用途。
设计规范
cloud rootfs
cloud rootfs will package all the dependencies refers to the kubernetes cluster requirements
.
├── bin # binaries will be installed at all nodes' /usr/local/bin
│ ├── conntrack
│ ├── containerd-rootless-setuptool.sh
│ ├── containerd-rootless.sh
│ ├── crictl
│ ├── kubeadm
│ ├── kubectl
│ ├── kubelet
│ ├── nerdctl
│ ├── kubelet-pre-start.sh
│ ├── helm
│ └── seautil
├── etc # configs will be put into all nodes' sealer-rootfs
│ ├── 10-kubeadm.conf
│ ├── daemon.json
│ ├── docker.service
│ ├── audit-policy.yml
│ ├── kubeadm-config.yaml
│ ├── kubeadm-config.yaml.tmpl # a.b.c.tmpl will be rendered using envs and rename to a.b.c
│ └── kubelet.service
├── plugins # plugins can run on some hooks, such as pre-init-host, post-install, see more in the plugins documentation
│ └── disk_init_shell_plugin.yaml
├── scripts # scripts can use all ClusterFile's env as Linux env variables
│ ├── init-kube.sh # initialize kube* binaries on target hosts
│ ├── clean-kube.sh # remove kube* binaries from target hosts
│ ├── init-container-runtime.sh # initialize container runtime binaries on target hosts
│ ├── clean-container-runtime.sh # remove container runtime binaries on target hosts
│ └── init-registry.sh # initialize registry on local registry's deploy-hosts
└── applications # applications put here
│ ├── redis
│ └── mysql
Using cloud rootfs to build a base cloudImage:
FROM scratch
COPY . .
sealer build -t kuberntes:v1.18.3 .
Hooks
FROM kubernetes:1.18.3
COPY preHook.sh /scripts/
preHook.sh will execute after init.sh before kubeadm init master0
Registry
registry container name must be 'sealer-registry'
END 链接
✴️版权声明 © :本书所有内容遵循CC-BY-SA 3.0协议(署名-相同方式共享)©