mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-09 16:23:34 +00:00
This updates the build of the two image caches to use the `pkg/package.mk` infrastructure, albeit in a slightly (ok, very) atypical way. In order to share the bulk of the build code (including the `Dockerfile` and the `Makefile` machinery to download the images) we arrange for the necessary bits to be copied at build time into distinct subdirectories and for the `pkg/package.mk` to be aware of this possibility. Since pkg/package.mk is only set up to build a single package we use a single `image-cache/Makefile` to drive the whole process and recurse into `Makefile.pkg` to build individual packages. One particular subtlety is that the package hash is based on the `image-cache` directory (which is in `git`) rather than the generated subdirectories (which are not in `git`). Since all the generators (and their inputs) are in the `image-cache` directory this is what we want. This means that the two images are given the same tag, but this is deliberate and desirable. The generated directories are completely temporary to avoid picking up stale versions of images when versions are updated. Images are hardlinked into place. The images are moved to the linuxkitprojects org. Using a dev tag for now, will update once everything is in place. Also use "tag" rather than "build" where appropriate in the Makefile. There is no point in the .dockerignore now, but add a .gitignore. Signed-off-by: Ian Campbell <ijc@docker.com>
Kubernetes and LinuxKit
This project aims to demonstrate how one can create minimal and immutable Kubernetes OS images with LinuxKit.
Make sure to cd projects/kubernetes
first.
Edit kube-master.yml
and add your public SSH key to files
section.
Build OS images:
make build-vm-images
Boot Kubernetes master OS image using hyperkit
on macOS:
./boot.sh
Get IP address of the master:
ip addr show dev eth0
Login to the kubelet container:
./ssh_into_kubelet.sh <master-ip>
Manually initialise master with kubeadm
:
kubeadm-init.sh
Once kubeadm
exits, make sure to copy the kubeadm join
arguments,
and try kubectl get nodes
from within the master.
To boot a node use:
./boot.sh <n> [<join_args> ...]
More specifically, to start 3 nodes use 3 separate shells and run this:
shell1> ./boot.sh 1 --token bb38c6.117e66eabbbce07d 192.168.65.22:6443
shell2> ./boot.sh 2 --token bb38c6.117e66eabbbce07d 192.168.65.22:6443
shell3> ./boot.sh 3 --token bb38c6.117e66eabbbce07d 192.168.65.22:6443