Building packages with Micro and k3s

How to build packages with Luet in Mocaccino Micro and k3s

In Micro, currently it’s possible to build packages with K3s and Luet

First install k3s:

1
luet install -y container/k3s runit-srv/k3s

And start it:

1
$ runit-start k3s

To enable it permanently on boot, run runit-enable k3s

Wait for k3s to be ready (Until ContainerCreating becomes Ready):

1
$ watch k3s kubectl get pods -A

Now install the luet controller:

1
$ k3s kubectl apply -f https://raw.githubusercontent.com/mudler/luet-k8s/master/hack/kube.yaml

And wait for it to be ready:

1
$ watch k3s kubectl get pods -A

Once all is up, we are ready to build packages, try for example with:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$ cat <<EOF | k3s kubectl apply -f -
apiVersion: luet.k8s.io/v1alpha1
kind: PackageBuild
metadata:
  name: test
spec:
  packageName: container/img
  repository: 
    url: "https://github.com/mocaccinoOS/mocaccino-extra"
  options:
    pull: true
    imageRepository: "quay.io/mocaccinocache/extra-amd64-cache"
EOF

In this case, we can inspect the build logs with:

1
k3s kubectl logs -f test

Example

Last modified December 29, 2020: Update migration repositories (2eea810)