Skip to content

Commit

Permalink
Update patches for kubernetes-sigs/image-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna committed Mar 15, 2024
1 parent a6fa453 commit e46d4d1
Show file tree
Hide file tree
Showing 11 changed files with 1,972 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 769673a5f47de94093308675d846f4462577317a Mon Sep 17 00:00:00 2001
From 32c73c933a73702bff841b15fcb9a991050e67fb Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Tue, 11 Jan 2022 21:05:13 -0800
Subject: [PATCH 01/10] OVA improvements
Subject: [PATCH 01/11] OVA improvements

- Create /etc/pki/tls/certs dir as part of image-builds
- Tweak Product info in OVF
Expand All @@ -15,11 +15,11 @@ Signed-off-by: Vignesh Goutham Ganesh <[email protected]>
3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/images/capi/ansible/roles/sysprep/tasks/main.yml b/images/capi/ansible/roles/sysprep/tasks/main.yml
index a9fa954d5..a526528ea 100644
index c1293deb9..d4249d974 100644
--- a/images/capi/ansible/roles/sysprep/tasks/main.yml
+++ b/images/capi/ansible/roles/sysprep/tasks/main.yml
@@ -27,6 +27,15 @@
- import_tasks: photon.yml
- ansible.builtin.import_tasks: photon.yml
when: ansible_os_family == "VMware Photon OS"

+- name: Get stats of the /etc/pki folder
Expand All @@ -32,7 +32,7 @@ index a9fa954d5..a526528ea 100644
+ when: pki.stat.isdir is defined and pki.stat.isdir
+
- name: Remove containerd http proxy conf file if needed
file:
ansible.builtin.file:
path: /etc/systemd/system/containerd.service.d/http-proxy.conf
diff --git a/images/capi/hack/ovf_template.xml b/images/capi/hack/ovf_template.xml
index 316427ec3..ca23db5f9 100644
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 48ff6678b232a40aaff06c8551dcac607351b481 Mon Sep 17 00:00:00 2001
From 720f425b85d5e4d2d37b13e9360783c050b5f3fd Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Tue, 11 Jan 2022 18:36:56 -0800
Subject: [PATCH 02/10] EKS-D support and changes
Subject: [PATCH 02/11] EKS-D support and changes

- Add goss validations for EKS-D artifacts
- Add etcdadm and etcd.tar.gz to image for unstacked etcd support
Expand All @@ -27,36 +27,36 @@ Signed-off-by: Vignesh Goutham Ganesh <[email protected]>
12 files changed, 102 insertions(+), 23 deletions(-)

diff --git a/images/capi/ansible/roles/kubernetes/tasks/crictl-url.yml b/images/capi/ansible/roles/kubernetes/tasks/crictl-url.yml
index 4330798da..1ca1d756e 100644
index 615a441e6..33101f6f1 100644
--- a/images/capi/ansible/roles/kubernetes/tasks/crictl-url.yml
+++ b/images/capi/ansible/roles/kubernetes/tasks/crictl-url.yml
@@ -12,23 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
-- name: Download crictl checksum
- get_url:
- ansible.builtin.get_url:
- url: "{{ crictl_sha256 }}"
- dest: /tmp/crictl.tar.gz.sha256
- mode: "0600"
-
-- name: Register checksum value for crictl
- slurp:
- ansible.builtin.slurp:
- src: /tmp/crictl.tar.gz.sha256
- register: csum
-
- name: Download crictl
- vars:
- sha256: "{{ csum['content'] | b64decode | trim }}"
get_url:
ansible.builtin.get_url:
url: "{{ crictl_url }}"
- checksum: sha256:{{ sha256 }}
+ checksum: "sha256:{{ crictl_sha256 }}"
dest: /tmp/crictl.tar.gz
mode: "0600"

diff --git a/images/capi/ansible/roles/kubernetes/tasks/url.yml b/images/capi/ansible/roles/kubernetes/tasks/url.yml
index 22c64b892..c09139060 100644
index d18e79b4f..b191df4b9 100644
--- a/images/capi/ansible/roles/kubernetes/tasks/url.yml
+++ b/images/capi/ansible/roles/kubernetes/tasks/url.yml
@@ -12,6 +12,41 @@
Expand Down Expand Up @@ -99,12 +99,12 @@ index 22c64b892..c09139060 100644
+ group: root
+
- name: Create CNI directory
file:
ansible.builtin.file:
state: directory
@@ -22,7 +57,7 @@

- name: Download CNI tarball
get_url:
ansible.builtin.get_url:
- url: "{{ kubernetes_cni_http_source }}/{{ kubernetes_cni_semver }}/cni-plugins-linux-{{ kubernetes_goarch }}-{{ kubernetes_cni_semver }}.tgz"
+ url: "{{ kubernetes_cni_http_source }}/{{ kubernetes_cni_semver }}/cni-plugins-linux-{{ kubernetes_goarch }}-{{ kubernetes_cni_semver }}.tar.gz"
checksum: "{{ kubernetes_cni_http_checksum }}"
Expand Down Expand Up @@ -229,10 +229,10 @@ index 278f403fa..eb92570cc 100644
{{ $name }}:
exists: {{ $vers.exists }}
diff --git a/images/capi/packer/goss/goss-vars.yaml b/images/capi/packer/goss/goss-vars.yaml
index a7878bfa2..8dd593110 100644
index da180514a..aeeeb0ea2 100644
--- a/images/capi/packer/goss/goss-vars.yaml
+++ b/images/capi/packer/goss/goss-vars.yaml
@@ -105,6 +105,12 @@ kubernetes_cni_rpm_version: ""
@@ -110,6 +110,12 @@ kubernetes_cni_rpm_version: ""
# When k8s and k8s cni source is http
kubernetes_load_additional_imgs: false

Expand Down Expand Up @@ -264,7 +264,7 @@ index 959005df8..2d88c2fb6 100644
"version": "{{user `goss_version`}}"
}
diff --git a/images/capi/packer/ova/packer-node.json b/images/capi/packer/ova/packer-node.json
index 1b7b2d13d..a55c78038 100644
index 7b5ef1369..5132b5e21 100644
--- a/images/capi/packer/ova/packer-node.json
+++ b/images/capi/packer/ova/packer-node.json
@@ -451,7 +451,12 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c878d0011c9ffb7720ba7f462689b54a2056961a Mon Sep 17 00:00:00 2001
From 522920438549d1f3be45f2b50a3cc2840d2b5a3f Mon Sep 17 00:00:00 2001
From: Abhay Krishna Arunachalam <[email protected]>
Date: Thu, 2 Feb 2023 01:39:15 -0800
Subject: [PATCH 03/10] Snow AMI support
Subject: [PATCH 03/11] Snow AMI support

- Add instance metadata options to Packer config
- Rename Snow node image to reflect appropriate CAPI provider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
From 91e25d9f32abe319fdef1aeea07c40f2750cbacd Mon Sep 17 00:00:00 2001
From 4e071c55082c7bbd23a72a0cd9c87bb71611999d Mon Sep 17 00:00:00 2001
From: Jackson West <[email protected]>
Date: Fri, 23 Jun 2023 10:50:08 -0500
Subject: [PATCH 04/10] Ubuntu 22 support and improvements
Subject: [PATCH 04/11] Ubuntu 22 support and improvements

- uses latest ubuntu 22.04 iso
- adds support for raw ubuntu 22.04 builds
- Ubuntu switch to offline-install when mirrors are unavailable
- sets OS_VERSION for goss validation on raw image builds
---
images/capi/Makefile | 6 +-
images/capi/packer/ova/ubuntu-2204-efi.json | 4 +-
images/capi/packer/ova/ubuntu-2204.json | 4 +-
.../raw/linux/ubuntu/http/22.04.efi/meta-data | 0
.../raw/linux/ubuntu/http/22.04.efi/user-data | 115 ++++++++++++++++++
.../raw/linux/ubuntu/http/22.04/meta-data | 0
Expand All @@ -20,7 +18,7 @@ Subject: [PATCH 04/10] Ubuntu 22 support and improvements
images/capi/packer/raw/raw-ubuntu-2004.json | 1 +
.../capi/packer/raw/raw-ubuntu-2204-efi.json | 14 +++
images/capi/packer/raw/raw-ubuntu-2204.json | 13 ++
12 files changed, 248 insertions(+), 5 deletions(-)
10 files changed, 244 insertions(+), 1 deletion(-)
create mode 100644 images/capi/packer/raw/linux/ubuntu/http/22.04.efi/meta-data
create mode 100644 images/capi/packer/raw/linux/ubuntu/http/22.04.efi/user-data
create mode 100644 images/capi/packer/raw/linux/ubuntu/http/22.04/meta-data
Expand All @@ -29,7 +27,7 @@ Subject: [PATCH 04/10] Ubuntu 22 support and improvements
create mode 100644 images/capi/packer/raw/raw-ubuntu-2204.json

diff --git a/images/capi/Makefile b/images/capi/Makefile
index 7f94fea88..09945c609 100644
index d602b2860..d555c304f 100644
--- a/images/capi/Makefile
+++ b/images/capi/Makefile
@@ -372,7 +372,7 @@ QEMU_BUILD_NAMES ?= qemu-ubuntu-2004 qemu-ubuntu-2204 qemu-ubuntu-2304 qemu-ub
Expand All @@ -41,7 +39,7 @@ index 7f94fea88..09945c609 100644
VBOX_BUILD_NAMES ?= vbox-windows-2019

POWERVS_BUILD_NAMES ?= powervs-centos-8
@@ -775,6 +775,8 @@ build-qemu-all: $(QEMU_BUILD_TARGETS) ## Builds all Qemu images
@@ -783,6 +783,8 @@ build-qemu-all: $(QEMU_BUILD_TARGETS) ## Builds all Qemu images
build-raw-flatcar: ## Builds Flatcar RAW image
build-raw-ubuntu-2004: ## Builds Ubuntu 20.04 RAW image
build-raw-ubuntu-2004-efi: ## Builds Ubuntu 20.04 RAW image that EFI boots
Expand All @@ -50,7 +48,7 @@ index 7f94fea88..09945c609 100644
build-raw-rhel-8: ## Builds RHEL 8 RAW image
build-raw-all: $(RAW_BUILD_TARGETS) ## Builds all RAW images

@@ -913,6 +915,8 @@ validate-qemu-all: $(QEMU_VALIDATE_TARGETS) ## Validates all Qemu Packer config
@@ -924,6 +926,8 @@ validate-qemu-all: $(QEMU_VALIDATE_TARGETS) ## Validates all Qemu Packer config
validate-raw-flatcar: ## Validates Flatcar RAW image packer config
validate-raw-ubuntu-2004: ## Validates Ubuntu 20.04 RAW image packer config
validate-raw-ubuntu-2004-efi: ## Validates Ubuntu 20.04 RAW EFI image packer config
Expand All @@ -59,38 +57,6 @@ index 7f94fea88..09945c609 100644
validate-raw-rhel-8: ## Validates RHEL 8 RAW image packer config
validate-raw-all: $(RAW_VALIDATE_TARGETS) ## Validates all RAW Packer config

diff --git a/images/capi/packer/ova/ubuntu-2204-efi.json b/images/capi/packer/ova/ubuntu-2204-efi.json
index 0bc473353..5d199b8b0 100644
--- a/images/capi/packer/ova/ubuntu-2204-efi.json
+++ b/images/capi/packer/ova/ubuntu-2204-efi.json
@@ -9,9 +9,9 @@
"firmware": "efi",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"guest_os_type": "ubuntu-64",
- "iso_checksum": "10f19c5b2b8d6db711582e0e27f5116296c34fe4b313ba45f9b201a5007056cb",
+ "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931",
"iso_checksum_type": "sha256",
- "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.1-live-server-amd64.iso",
+ "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.2-live-server-amd64.iso",
"os_display_name": "Ubuntu 22.04",
"shutdown_command": "shutdown -P now",
"vsphere_guest_os_type": "ubuntu64Guest"
diff --git a/images/capi/packer/ova/ubuntu-2204.json b/images/capi/packer/ova/ubuntu-2204.json
index badbf1045..38efb01c8 100644
--- a/images/capi/packer/ova/ubuntu-2204.json
+++ b/images/capi/packer/ova/ubuntu-2204.json
@@ -8,9 +8,9 @@
"distro_version": "22.04",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"guest_os_type": "ubuntu-64",
- "iso_checksum": "10f19c5b2b8d6db711582e0e27f5116296c34fe4b313ba45f9b201a5007056cb",
+ "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931",
"iso_checksum_type": "sha256",
- "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.1-live-server-amd64.iso",
+ "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.2-live-server-amd64.iso",
"os_display_name": "Ubuntu 22.04",
"shutdown_command": "shutdown -P now",
"vsphere_guest_os_type": "ubuntu64Guest"
diff --git a/images/capi/packer/raw/linux/ubuntu/http/22.04.efi/meta-data b/images/capi/packer/raw/linux/ubuntu/http/22.04.efi/meta-data
new file mode 100644
index 000000000..e69de29bb
Expand Down Expand Up @@ -331,7 +297,7 @@ index a04be4e8f..83aa6b4fb 100644
"containerd_version": "{{user `containerd_version`}}",
"kubernetes_cni_deb_version": "{{ user `kubernetes_cni_deb_version` }}",
diff --git a/images/capi/packer/raw/raw-ubuntu-2004-efi.json b/images/capi/packer/raw/raw-ubuntu-2004-efi.json
index 7ed3ac8a3..421fe6976 100644
index e8ad83891..efd64aacb 100644
--- a/images/capi/packer/raw/raw-ubuntu-2004-efi.json
+++ b/images/capi/packer/raw/raw-ubuntu-2004-efi.json
@@ -4,6 +4,7 @@
Expand All @@ -341,9 +307,9 @@ index 7ed3ac8a3..421fe6976 100644
+ "distro_version": "20.04",
"firmware": "OVMF.fd",
"guest_os_type": "ubuntu-64",
"iso_checksum": "f11bda2f2caed8f420802b59f382c25160b114ccc665dbac9c5046e7fceaced2",
"iso_checksum": "5035be37a7e9abbdc09f0d257f3e33416c1a0fb322ba860d42d74aa75c3468d4",
diff --git a/images/capi/packer/raw/raw-ubuntu-2004.json b/images/capi/packer/raw/raw-ubuntu-2004.json
index 9e78e6384..cbcfbc6f3 100644
index 9ab9bd993..cd0ca68f3 100644
--- a/images/capi/packer/raw/raw-ubuntu-2004.json
+++ b/images/capi/packer/raw/raw-ubuntu-2004.json
@@ -4,6 +4,7 @@
Expand All @@ -352,11 +318,11 @@ index 9e78e6384..cbcfbc6f3 100644
"distro_name": "ubuntu",
+ "distro_version": "20.04",
"guest_os_type": "ubuntu-64",
"iso_checksum": "f11bda2f2caed8f420802b59f382c25160b114ccc665dbac9c5046e7fceaced2",
"iso_checksum": "5035be37a7e9abbdc09f0d257f3e33416c1a0fb322ba860d42d74aa75c3468d4",
"iso_checksum_type": "sha256",
diff --git a/images/capi/packer/raw/raw-ubuntu-2204-efi.json b/images/capi/packer/raw/raw-ubuntu-2204-efi.json
new file mode 100644
index 000000000..6839cc2d0
index 000000000..2ce81b3f6
--- /dev/null
+++ b/images/capi/packer/raw/raw-ubuntu-2204-efi.json
@@ -0,0 +1,14 @@
Expand All @@ -368,15 +334,15 @@ index 000000000..6839cc2d0
+ "distro_version": "22.04",
+ "firmware": "OVMF.fd",
+ "guest_os_type": "ubuntu-64",
+ "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931",
+ "iso_checksum": "a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd",
+ "iso_checksum_type": "sha256",
+ "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.2-live-server-amd64.iso",
+ "iso_url": "https://old-releases.ubuntu.com/releases/22.04/ubuntu-22.04.3-live-server-amd64.iso",
+ "os_display_name": "Ubuntu 22.04",
+ "shutdown_command": "shutdown -P now"
+ }
+}
diff --git a/images/capi/packer/raw/raw-ubuntu-2204.json b/images/capi/packer/raw/raw-ubuntu-2204.json
new file mode 100644
index 000000000..c9cfe7381
index 000000000..ab977d254
--- /dev/null
+++ b/images/capi/packer/raw/raw-ubuntu-2204.json
@@ -0,0 +1,13 @@
Expand All @@ -387,12 +353,12 @@ index 000000000..c9cfe7381
+ "distro_name": "ubuntu",
+ "distro_version": "22.04",
+ "guest_os_type": "ubuntu-64",
+ "iso_checksum": "5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931",
+ "iso_checksum": "a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd",
+ "iso_checksum_type": "sha256",
+ "iso_url": "https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04.2-live-server-amd64.iso",
+ "iso_url": "https://old-releases.ubuntu.com/releases/22.04/ubuntu-22.04.3-live-server-amd64.iso",
+ "os_display_name": "Ubuntu 22.04",
+ "shutdown_command": "shutdown -P now"
+ }
+}
--
2.39.3 (Apple Git-146)

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From fc9896eda26f6d36b15bd294b3031c815aeb9f64 Mon Sep 17 00:00:00 2001
From 288345a439a92ee785f1cb5cc4f5f30f44fab1c2 Mon Sep 17 00:00:00 2001
From: Vignesh Goutham Ganesh <[email protected]>
Date: Tue, 6 Dec 2022 15:42:02 -0600
Subject: [PATCH 05/10] RHEL support and improvements
Subject: [PATCH 05/11] RHEL support and improvements

- Exclude kernel and cloud-init from yum updates
- Patch cloud-init systemd unit to wait for network manager online
Expand All @@ -25,19 +25,19 @@ Signed-off-by: Vignesh Goutham Ganesh <[email protected]>
create mode 100644 images/capi/ansible/roles/providers/files/etc/systemd/system/cloud-init.service.d/boot-order.conf

diff --git a/images/capi/ansible/roles/node/tasks/main.yml b/images/capi/ansible/roles/node/tasks/main.yml
index e0513f565..f2094927f 100644
index 484556b17..78da9fc30 100644
--- a/images/capi/ansible/roles/node/tasks/main.yml
+++ b/images/capi/ansible/roles/node/tasks/main.yml
@@ -18,6 +18,9 @@
- import_tasks: amazonLinux2.yml
- ansible.builtin.import_tasks: amazonLinux2.yml
when: ansible_distribution == "Amazon"

+- import_tasks: redhat.yml
+ when: ansible_distribution == "RedHat"
+
# This is required until https://github.com/ansible/ansible/issues/77537 is fixed and used.
- name: Override Flatcar's OS family
set_fact:
ansible.builtin.set_fact:
diff --git a/images/capi/ansible/roles/node/tasks/redhat.yml b/images/capi/ansible/roles/node/tasks/redhat.yml
new file mode 100644
index 000000000..b2133b6f1
Expand Down Expand Up @@ -87,10 +87,10 @@ index 000000000..e1059e3eb
+After=NetworkManager-wait-online.service
\ No newline at end of file
diff --git a/images/capi/ansible/roles/providers/tasks/main.yml b/images/capi/ansible/roles/providers/tasks/main.yml
index b55b78099..a58f0e7c0 100644
index 88f572908..27f075c6e 100644
--- a/images/capi/ansible/roles/providers/tasks/main.yml
+++ b/images/capi/ansible/roles/providers/tasks/main.yml
@@ -81,6 +81,21 @@
@@ -80,6 +80,21 @@
mode: "0644"
when: ansible_os_family != "Flatcar"

Expand All @@ -113,7 +113,7 @@ index b55b78099..a58f0e7c0 100644
# Enable all cloud-init services on boot.
- name: Make sure all cloud init services are enabled
diff --git a/images/capi/ansible/roles/setup/tasks/redhat.yml b/images/capi/ansible/roles/setup/tasks/redhat.yml
index 74329afd4..e20e3da6c 100644
index 5716fff78..5ab43bed9 100644
--- a/images/capi/ansible/roles/setup/tasks/redhat.yml
+++ b/images/capi/ansible/roles/setup/tasks/redhat.yml
@@ -22,6 +22,74 @@
Expand Down Expand Up @@ -190,9 +190,9 @@ index 74329afd4..e20e3da6c 100644
+ - rhsm_server_proxy_hostname != ""

- name: Perform dnf clean
command: /usr/bin/yum -y clean all
ansible.builtin.command: /usr/bin/yum -y clean all
@@ -45,6 +113,7 @@
yum:
ansible.builtin.yum:
name: "*"
state: latest
+ exclude: cloud-init*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 88728dfcd01eb686f7323d02d6f2aa698607aa4e Mon Sep 17 00:00:00 2001
From 81f9b50da1e80e93d3728203d1ca87b9fcbb05e9 Mon Sep 17 00:00:00 2001
From: Ilya Alekseyev <[email protected]>
Date: Wed, 11 Oct 2023 22:07:22 -0400
Subject: [PATCH 06/10] Nutanix RHEL support for AWS image-builder
Subject: [PATCH 06/11] Nutanix RHEL support for AWS image-builder

---
images/capi/packer/nutanix/packer.json | 1 +
Expand Down
Loading

0 comments on commit e46d4d1

Please sign in to comment.