Airgap
Make Component Airgap-Ready
images.txt: For every modules, put the image
repository:tagin aimages.txtfile in one of the following pathmodules/charts/*/images.txt: for images managed by chartmodules/*/images.txt: for image managed by manifests or other
chart: If the component is managed by a remote chart, remember to pack the chart in the release builder.
Edit the `Embed required charts` task inIn the helmfile, provide two versions of chart path, one is original, another one is airgapped version. For example,
releases: - name: elasticsearch ## general chart: stable/elasticsearch ## air-gapped #chart: ../../charts/elasticsearch
Release
build the release:
cd installer/ make releasebuild image tarball: note, this step may fail if you have not login to some private repositories, e.g. registry.gitlab.com. Please login by your email/password in gitlab
make release-imagesand
primehub-images-xxx.tgzandprimehub-images-xxx.txtwill be recreated
Deployment
Extract the release tarball
tar xvfz /tmp/primehub-rke-airgapped-xxx.tar.gz ln -s primehub-rke-airgapped-xxx primehub cd primehubmove the images-xxx.txt and images-xxx.tgz
mv primehub-images-xxx-* primehubEnter the primehub folder
cd primehubReplace all the images
./modules/airgap/image-replace.sh ./primehub-images-xxx.txtLoad the images and push to private registry
./modules/airgap/image-load-and-push.sh ./primehub-images-xxx.txt ./primehub-images-xxx.tgzInstall as normal installation
make component-diff-<app> make component-install-<app>Check the running image is using airgapped image
kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}' | sort -u
Environment Simulation
Use dev-gce environment.
/etc/hosts: check if there is this line in each node
10.40.0.11 k8s01 primehub.airgap/etc/docker/daemon.json: The
insecure-registriesis set{ "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ], "default-runtime": "runc", "insecure-registries": [ "primehub.airgap:5000" ] }Private Registry: In the first node
k8s01. run the docker registry. in the release primehub folder. Run this taskmake start-local-docker-registry