Set up docker image location
BUILDER_IMG in Makefile
run
make docker
use pod.yaml to deploy the image builder vm or machine must have kvm enabled
make sure you have replaced
BUILDER_IMG in pod.yaml
run
kubectl apply -f pod.yaml
if you want to publish you images to s3 bucket change to you bucket name ${S3_BUCKET} buildmaasimage.sh line: 80
and you must provide aws-credentials, refer secret.yaml
if you do not want to upload images to s3 remove lines
envFrom:
- secretRef:
name: aws-credentials
from pod.yaml
You must have maas cli installed on your system
If you don't have maas cli installed refer here
The images generated inside pod can be accessed from hostpath vol
- name: outputdir
hostPath:
path: /tmp/mypath
cd /tmp/mypath or the directory you have configured
next step assumes that you have maas-cli installed on currrent machine. If not first copy the image from current machine to somewhere you have maas cli installed and access to MAAS setup
scp /tmp/mypath/<image-filename> <destination-machine>
# ssh to the machine
ssh user@<destination-machine>
use profile which has access to create boot-resources or admin
# maas <= v2.9
maas <profile-name> boot-resources create name=custom/<image-display-name> architecture=amd64/generic content=<image-filename>
# maas >= v3.0
size=$(du <image-filename> | awk '{print $1;}')
sha256checksum=$(sha256sum <image-filename> | awk '{print $1;}')
maas <profile-name> boot-resources create name=custom/<image-display-name> architecture=amd64/generic sha256=$sha256checksum size=$size content@=<image-filename>