From dbb7058573d48e9e80e8cb79e115c1fd894a3fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Sun, 15 Oct 2023 19:29:52 -0700 Subject: [PATCH] Fix the offline installation instructions for podman and k3s --- containers/doc/server-kubernetes/README.md | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/containers/doc/server-kubernetes/README.md b/containers/doc/server-kubernetes/README.md index 4ab5c5cd1c6f..ac62588dfe2a 100644 --- a/containers/doc/server-kubernetes/README.md +++ b/containers/doc/server-kubernetes/README.md @@ -61,6 +61,21 @@ done skopeo copy docker://registry.opensuse.org/systemsmanagement/uyuni/master/containers/uyuni/server:latest docker-archive:server.tar:registry.opensuse.org/systemsmanagement/uyuni/master/containers/uyuni/server:latest ``` +If using K3S's default local-path-provider, also pull the helper pod image for offline use: + +``` +helper_pod_image=$(grep helper-pod -A1 /var/lib/rancher/k3s/server/manifests/local-storage.yaml | grep image | sed 's/^ \+image: //') +podman pull $helper_pod_image +podman save --output helper_pod.tar $helper_pod_image +``` + +or + +``` +helper_pod_image=$(grep helper-pod -A1 /var/lib/rancher/k3s/server/manifests/local-storage.yaml | grep image | sed 's/^ \+image: //') +skopeo copy docker://$(helper_pod_image) docker-archive:helper-pod.tar:$(helper_pod_image) +``` + Copy the `cert-manager` and `uyuni/server` helm charts locally: ``` @@ -79,18 +94,7 @@ done In order to tell K3s to not pull the images, set the image pull policy needs to be set to `Never`. This needs to be done for both Uyuni and cert-manager helm charts. -For the Uyuni helm chart, set the `pullPolicy` chart value to `Never` by passing a `--helm-uyuni-values=uyuni-values.yaml` parameter to `uyuniadm install` with the following `uyuni-values.yaml` file content: - -``` -pullPolicy: Never -``` - -For the cert-manager helm chart, create a `cert-values.yaml` file with the following content and pass `--helm-certmanager-values=values.yaml` parameter to `uyuniadm install`: - -``` -image: - pullPolicy: Never -``` +To prevent Helm from pulling the images pass the `--image=pullPolicy=never` parameter to `uyuniadm install` or `uyuniadm migrate`. To use the downloaded helm charts instead of the default ones, pass `--helm-uyuni-chart=server-2023.9.0.tgz` and `--helm-certmanager-chart=cert-manager-v1.13.1.tgz` or add the following to the `uyuniadm` configuration file. Of course the versions in the file name need to be adjusted to what you downloaded: @@ -98,13 +102,11 @@ To use the downloaded helm charts instead of the default ones, pass `--helm-uyun helm: uyuni: chart: server-2023.9.0.tgz - values: uyuni-values.yaml certmanager: chart: cert-manager-v1.13.1.tgz - values: cert-values.yaml ``` -Set the helper-pod `imagePullPolicy` to `Never` in `/var/lib/rancher/k3s/server/manifests/local-storage.yaml` using the following command: +If using K3S's default local-path-provisioner, set the helper-pod `imagePullPolicy` to `Never` in `/var/lib/rancher/k3s/server/manifests/local-storage.yaml` using the following command: ``` sed 's/imagePullPolicy: IfNotPresent/imagePullPolicy: Never/' -i /var/lib/rancher/k3s/server/manifests/local-storage.yaml @@ -153,6 +155,8 @@ Transfer the resulting `server-image.tar` to the server and load it using the fo podman load -i server-image.tar ``` +To prevent pulling the images pass the `--image=pullPolicy=never` parameter to `uyuniadm install` or `uyuniadm migrate`. + # Migrating from a regular server In order to migrate a regular Uyuni server to containers, a new machine is required: it is not possible to perform an in-place migration.