Define your own CloudRootfs
All the files which run a kubernetes cluster needs.
Contains:
- Bin files, like docker, containerd, crictl ,kubeadm, kubectl…
- Config files, like kubelet systemd config, docker systemd config, docker daemon.json…
- Registry docker image.
- Some Metadata, like Kubernetes version.
- Registry files, contains all the docker image, like kubernetes core component docker images…
- Scripts, some shell script using to install docker and kubelet… sealer will call init.sh and clean.sh.
- Other static files
1 | . |
How can I get CloudRootfs
- Pull a BaseImage
sealer pull kubernetes:v1.19.8-alpine
- View the image layer information
sealer inspect kubernetes:v1.19.8-alpine
- Get into the BaseImage Layer
ls /var/lib/sealer/data/overlay2/{layer-id}
You will find the CloudRootfs layer.
Build your own BaseImage
You can edit any files in CloudRootfs you want, for example you want to define your own docker daemon.json, just edit it and build a new CloudImage.
1 | FROM scratch |
1 | sealer build -t user-defined-kubernetes:v1.19.8 . |
Then you can use this image as a BaseImage.
OverWrite CloudRootfs files
Sometimes you don’t want to care about the CloudRootfs context, but need custom some config.
You can use kubernetes:v1.19.8
as BaseImage, and use your own config file to overwrite the default file in CloudRootfs.
For example: daemon.json is your docker engine config, using it to overwrite default config:
1 | FROM kubernetes:v1.19.8 |
1 | sealer build -t user-defined-kubernetes:v1.19.8 . |