From 8d57fbd4303c6deeb68585859c49167ae7b8e475 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Fri, 22 Mar 2019 00:05:28 +0000 Subject: [PATCH 1/3] Change klipper-helm to PullIfNotPresent PullAlways ImagePullPolicy causes issues with offline/airgap support, so only pull if image is not already present. --- pkg/helm/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/helm/controller.go b/pkg/helm/controller.go index b8e29ba01d..969de0cfc0 100644 --- a/pkg/helm/controller.go +++ b/pkg/helm/controller.go @@ -158,7 +158,7 @@ func job(chart *k3s.HelmChart) (*batch.Job, *core.ConfigMap) { { Name: "helm", Image: image, - ImagePullPolicy: core.PullAlways, + ImagePullPolicy: core.PullIfNotPresent, Args: args(chart), Env: []core.EnvVar{ { From 9645048a571ee00b385605c20a691e466860b1dc Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Fri, 22 Mar 2019 00:09:14 +0000 Subject: [PATCH 2/3] Update klipper-helm version --- pkg/helm/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/helm/controller.go b/pkg/helm/controller.go index 969de0cfc0..80c763def7 100644 --- a/pkg/helm/controller.go +++ b/pkg/helm/controller.go @@ -24,7 +24,7 @@ import ( const ( namespace = "kube-system" - image = "rancher/klipper-helm:v0.1.4" + image = "rancher/klipper-helm:v0.1.5" label = "helm.k3s.cattle.io/chart" ) From 40172dc508a7ad060b98c398c5c9cba24a3ce751 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Fri, 22 Mar 2019 00:11:42 +0000 Subject: [PATCH 3/3] Package airgap image files Generate airgap artifacts from an images list for each architecture. --- scripts/airgap/generate-list.sh | 8 ++++++++ scripts/airgap/image-list.txt | 5 +++++ scripts/package | 1 + scripts/package-airgap | 10 ++++++++++ 4 files changed, 24 insertions(+) create mode 100755 scripts/airgap/generate-list.sh create mode 100644 scripts/airgap/image-list.txt create mode 100755 scripts/package-airgap diff --git a/scripts/airgap/generate-list.sh b/scripts/airgap/generate-list.sh new file mode 100755 index 0000000000..813513aca3 --- /dev/null +++ b/scripts/airgap/generate-list.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e -x + +cd $(dirname $0) + +k3s crictl images -o json \ + | jq -r '.images[].repoTags[0] | select(. != null)' \ + | tee image-list.txt diff --git a/scripts/airgap/image-list.txt b/scripts/airgap/image-list.txt new file mode 100644 index 0000000000..b2d7fcbf5a --- /dev/null +++ b/scripts/airgap/image-list.txt @@ -0,0 +1,5 @@ +docker.io/coredns/coredns:1.3.0 +docker.io/library/traefik:1.7.9 +docker.io/rancher/klipper-helm:v0.1.5 +docker.io/rancher/klipper-lb:v0.1.1 +k8s.gcr.io/pause:3.1 diff --git a/scripts/package b/scripts/package index 2e953e40f6..e7b6dd2d02 100755 --- a/scripts/package +++ b/scripts/package @@ -9,3 +9,4 @@ fi ./package-cli ./package-image +./package-airgap diff --git a/scripts/package-airgap b/scripts/package-airgap new file mode 100755 index 0000000000..adc242fa2e --- /dev/null +++ b/scripts/package-airgap @@ -0,0 +1,10 @@ +#!/bin/bash +set -e -x + +source $(dirname $0)/version.sh + +cd $(dirname $0)/.. + +images=$(cat scripts/airgap/image-list.txt) +xargs -n1 docker pull <<< "${images}" +docker save ${images} -o dist/artifacts/k3s-airgap-images-${ARCH}.tar