Helm (Offline)
Deploying Helm charts in an air-gapped (offline) environment involves a few steps, including:
Let’s go over each step:
Packaging Helm Charts
You’ll need to package the Helm chart on a machine that has internet access. You do this by using the helm package command:
helm package <CHART_PATH>
This will create a .tgz file, which is the packaged chart. You’ll need to move this file to the air-gapped environment.
Transferring Charts and Images
Copy the Helm chart package and all required Docker images onto portable storage. This could be an external hard drive, USB flash drive, etc. How you do this will depend on your specific circumstances.
To save a Docker image to a file, you can use the docker save command:
docker save -o <PATH_TO_SAVE_IMAGE> <IMAGE_NAME>
Then, in your air-gapped environment, you can load the Docker image from the file using the docker load command:
docker load -i <PATH_TO_SAVE_IMAGE>
Setting up a local Helm repository and Docker registry
In the air-gapped environment, you’ll need to setup a local Helm repository to serve the Helm charts. Helm supports multiple ways to do this but a simple way could be using a web server to serve the static .tgz files. Here is an example using Python’s built-in HTTP server:
python -m SimpleHTTPServer 8080
Then you can add this as your local helm repo:
helm repo add local-repo http://localhost:8080
You’ll also need a local Docker registry to host your Docker images:
docker run -d -p 5000:5000 --name registry registry:2
And then you can tag and push your Docker images to this local registry:
docker tag <IMAGE_NAME> localhost:5000/<IMAGE_NAME>
docker push localhost:5000/<IMAGE_NAME>
Make sure to update your Helm chart values to point to this local Docker registry.
Deploying the Helm chart
Now that you have your Helm chart and Docker images in your local repositories, you can deploy your Helm chart as usual:
helm install <RELEASE_NAME> local-repo/<CHART_NAME>
This is a high-level overview of the steps you’d take to deploy Helm charts in an air-gapped environment. The specifics may vary depending on your particular circumstances and setup.