-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package container images with the self-extracting installer for The C…
…ombine (#3240) * Add container images to install package - add container images for helm charts to the install package - cert-manager - NGINX ingress controller - The Combine - add a `--net-install` to create installer without the images * Update Python dependencies * Update installer README.md * Restore installation of helm in non-airgap installations * Remove cert-manager from standard charts cert-manager is not needed for NUCs or the offline development and it is installed by LTOps for the QA and Production environments. It is only used for development clusters, e.g. on Rancher Desktop or Docker Desktop
- Loading branch information
Showing
38 changed files
with
961 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
############################################################## | ||
# Playbook: playbook_k3s_airgapped_files.yml | ||
# | ||
# playbook_k3s_airgapped_files.yml downloads and packages the | ||
# files necessary to install k3s on an airgapped system. This | ||
# includes: | ||
# - the k3s airgap images | ||
# - k3s executable | ||
# - k3s installation script | ||
# - kubectl | ||
# - helm | ||
# | ||
############################################################## | ||
|
||
- name: Build package for k3s airgap installation | ||
hosts: localhost | ||
gather_facts: yes | ||
become: no | ||
|
||
vars_files: | ||
- "vars/k3s_versions.yml" | ||
|
||
tasks: | ||
- name: Create package directory if necessary | ||
file: | ||
path: "{{ package_dir }}" | ||
state: directory | ||
|
||
- name: Download k3s assets | ||
get_url: | ||
dest: "{{ package_dir }}/{{ item }}" | ||
url: "https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/{{ item }}" | ||
loop: | ||
- k3s-airgap-images-amd64.tar.zst | ||
- k3s | ||
- sha256sum-amd64.txt | ||
|
||
- name: Verify k3s downloads | ||
shell: | ||
cmd: sha256sum --check --ignore-missing sha256sum-amd64.txt | ||
chdir: "{{ package_dir }}" | ||
changed_when: false | ||
|
||
- name: Download k3s install script | ||
get_url: | ||
dest: "{{ package_dir }}/install.sh" | ||
url: https://get.k3s.io/ | ||
|
||
- name: Download kubectl | ||
get_url: | ||
dest: "{{ package_dir }}/kubectl" | ||
url: "https://dl.k8s.io/release/{{ kubectl_version }}/bin/linux/amd64/kubectl" | ||
|
||
- name: Download helm | ||
get_url: | ||
dest: "{{ package_dir }}/helm.tar.gz" | ||
url: "https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
vars_files: | ||
- "vars/config_common.yml" | ||
- "vars/k3s_versions.yml" | ||
|
||
tasks: | ||
- name: Update packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
container_packages: | ||
- containerd.io | ||
|
||
keyring_location: /etc/apt/keyrings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# Default values for setting up the container images for | ||
# installing pre-downloaded images | ||
|
||
source_image_dir: ../airgap-images | ||
airgap_image_dir: /var/lib/rancher/k3s/agent/images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
# Setup airgap images in {{ airgap_image_dir }} to be | ||
# available when k3s and subsequent helm charts are installed. | ||
|
||
- name: Create airgap image directory | ||
file: | ||
path: "{{ airgap_image_dir }}" | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Copy image files | ||
copy: | ||
src: "{{ source_image_dir }}/{{ item }}" | ||
dest: "{{ airgap_image_dir }}/{{ item }}" | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
loop: | ||
- k3s-airgap-images-amd64.tar.zst | ||
- middleware-airgap-images-amd64.tar.zst | ||
- combine-airgap-images-amd64.tar.zst | ||
|
||
# Add k3s, kubectl and the k3s installation script to | ||
# /usr/local/bin | ||
- name: Copy k3s & utility programes | ||
copy: | ||
src: "{{ source_image_dir }}/{{ item }}" | ||
dest: /usr/local/bin/{{ item }} | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
loop: | ||
- k3s | ||
- kubectl | ||
- install.sh | ||
|
||
# Install helm | ||
- name: Create directory for helm installation | ||
file: | ||
path: /opt/helm/{{ helm_version }} | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Unpack helm | ||
shell: | ||
cmd: tar xzvf "{{ source_image_dir }}/helm.tar.gz" -C /opt/helm/{{ helm_version }} | ||
|
||
- name: Create link to helm binary | ||
file: | ||
src: /opt/helm/{{ helm_version }}/linux-amd64/helm | ||
dest: /usr/local/bin/helm | ||
state: link | ||
owner: root | ||
group: root | ||
mode: 0755 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
helm_version: v3.13.2 | ||
helm_version: v3.15.2 | ||
helm_arch: linux-amd64 | ||
|
||
helm_download_dir: /opt/helm-{{ helm_version }}-{{ helm_arch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.