From cf7b411e0403e6dd0fb75654b70ec816686fc303 Mon Sep 17 00:00:00 2001 From: huaiyou Date: Wed, 7 Dec 2022 14:57:41 +0800 Subject: [PATCH 1/3] New design for basefs. Signed-off-by: huaiyou --- docs/api/cloudrootfs.md | 56 +++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/docs/api/cloudrootfs.md b/docs/api/cloudrootfs.md index 82247c77265..10c91cc9a44 100644 --- a/docs/api/cloudrootfs.md +++ b/docs/api/cloudrootfs.md @@ -4,7 +4,10 @@ cloud rootfs will package all the dependencies refers to the kubernetes cluster ```shell script . -├── bin +├── Metadata # Metadata will be see in the `sealer inspect` +├── README.md # Metadata will be see in the `sealer help` +├── imageList # image list in it will be saved into the ClusterImage +├── bin # binaries will be installed at all nodes' /usr/local/bin │ ├── conntrack │ ├── containerd-rootless-setuptool.sh │ ├── containerd-rootless.sh @@ -13,44 +16,31 @@ cloud rootfs will package all the dependencies refers to the kubernetes cluster │ ├── kubectl │ ├── kubelet │ ├── nerdctl +│ ├── kubelet-pre-start.sh +│ ├── helm │ └── seautil -├── cri -│ ├── containerd -│ ├── containerd-shim -│ ├── containerd-shim-runc-v2 -│ ├── ctr -│ ├── docker -│ ├── dockerd -│ ├── docker-init -│ ├── docker-proxy -│ ├── rootlesskit -│ ├── rootlesskit-docker-proxy -│ ├── runc -│ └── vpnkit -├── etc +├── etc # configs will be put into all nodes' sealer-rootfs │ ├── 10-kubeadm.conf -│ ├── Clusterfile # image default Clusterfile │ ├── 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 -├── images -│ └── registry.tar # registry docker image, will load this image and run a local registry in cluster -├── Kubefile -├── Metadata -├── README.md -├── registry # will mount this dir to local registry -│ └── docker -│ └── registry -├── scripts -│ ├── clean.sh -│ ├── docker.sh -│ ├── init-kube.sh -│ ├── init-registry.sh -│ ├── init.sh -│ └── kubelet-pre-start.sh -└── statics # yaml files, sealer will render values in those files - └── audit-policy.yml +├── yamls # yamls will be created lexicographically by kubectl after the cluster is created (skip when scale cluster) +│ ├── addon-a.yaml +│ └── addon-b.yaml.tmpl # addon-b.yaml.tmpl will be sealer rendered using ClusterFile's envs and rename to addon-b.yaml +├── charts # charts will be installed at kube-system lexicographically by helm(v3) after the yamls be created (skip when scale cluster) +│ ├── addon-c # ClusterFile's env A can be used at {{ .Values.global.A }} +│ └── addon-d +├── 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 ``` Using cloud rootfs to build a base cloudImage: From 951d5b6c3ef78031b3ab444d66a04afc5d721dce Mon Sep 17 00:00:00 2001 From: huaiyou Date: Wed, 14 Dec 2022 20:42:24 +0800 Subject: [PATCH 2/3] Update. Signed-off-by: huaiyou --- docs/api/cloudrootfs.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/api/cloudrootfs.md b/docs/api/cloudrootfs.md index 10c91cc9a44..b38e7e04026 100644 --- a/docs/api/cloudrootfs.md +++ b/docs/api/cloudrootfs.md @@ -4,9 +4,7 @@ cloud rootfs will package all the dependencies refers to the kubernetes cluster ```shell script . -├── Metadata # Metadata will be see in the `sealer inspect` ├── README.md # Metadata will be see in the `sealer help` -├── imageList # image list in it will be saved into the ClusterImage ├── bin # binaries will be installed at all nodes' /usr/local/bin │ ├── conntrack │ ├── containerd-rootless-setuptool.sh @@ -27,20 +25,17 @@ cloud rootfs will package all the dependencies refers to the kubernetes cluster │ ├── kubeadm-config.yaml │ ├── kubeadm-config.yaml.tmpl # a.b.c.tmpl will be rendered using envs and rename to a.b.c │ └── kubelet.service -├── yamls # yamls will be created lexicographically by kubectl after the cluster is created (skip when scale cluster) -│ ├── addon-a.yaml -│ └── addon-b.yaml.tmpl # addon-b.yaml.tmpl will be sealer rendered using ClusterFile's envs and rename to addon-b.yaml -├── charts # charts will be installed at kube-system lexicographically by helm(v3) after the yamls be created (skip when scale cluster) -│ ├── addon-c # ClusterFile's env A can be used at {{ .Values.global.A }} -│ └── addon-d ├── 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 +├── 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 ec9d2b561eaa20ff59bea28303669b3da0d7c4dd Mon Sep 17 00:00:00 2001 From: huaiyou Date: Wed, 14 Dec 2022 20:47:41 +0800 Subject: [PATCH 3/3] Update. Signed-off-by: huaiyou --- docs/api/cloudrootfs.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/api/cloudrootfs.md b/docs/api/cloudrootfs.md index b38e7e04026..80c7be1bca7 100644 --- a/docs/api/cloudrootfs.md +++ b/docs/api/cloudrootfs.md @@ -4,7 +4,6 @@ cloud rootfs will package all the dependencies refers to the kubernetes cluster ```shell script . -├── README.md # Metadata will be see in the `sealer help` ├── bin # binaries will be installed at all nodes' /usr/local/bin │ ├── conntrack │ ├── containerd-rootless-setuptool.sh @@ -49,15 +48,6 @@ COPY . . sealer build -t kuberntes:v1.18.3 . ``` -## Metadata - -```shell script -{ - "version": "v1.18.3", - "arch": "amd64" -} -``` - ## Hooks ```shell script