Skip to content

Commit

Permalink
Add Azure Linux 3 for Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed May 10, 2024
1 parent 2c25616 commit dded864
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 15 deletions.
6 changes: 6 additions & 0 deletions images/capi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ build-azure-sig-ubuntu-2204: ## Builds Ubuntu 22.04 Azure managed image in Share
build-azure-sig-ubuntu-2404: ## Builds Ubuntu 24.04 Azure managed image in Shared Image Gallery
build-azure-sig-centos-7: ## Builds CentOS 7 Azure managed image in Shared Image Gallery
build-azure-sig-azurelinux-2: ## Builds Azure Linux 2 Azure managed image in Shared Image Gallery
build-azure-sig-azurelinux-3: ## Builds Azure Linux 3 Azure managed image in Shared Image Gallery
build-azure-sig-rhel-8: ## Builds RHEL 8 Azure managed image in Shared Image Gallery
build-azure-sig-windows-2019-containerd: ## Builds Windows Server 2019 with containerd Azure managed image in Shared Image Gallery
build-azure-sig-windows-2022-containerd: ## Builds Windows Server 2022 with containerd Azure managed image in Shared Image Gallery
Expand All @@ -640,12 +641,14 @@ build-azure-vhd-ubuntu-2204: ## Builds Ubuntu 22.04 VHD image for Azure
build-azure-vhd-ubuntu-2404: ## Builds Ubuntu 24.04 VHD image for Azure
build-azure-vhd-centos-7: ## Builds CentOS 7 VHD image for Azure
build-azure-vhd-azurelinux-2: ## Builds Azure Linux 2 VHD image for Azure
build-azure-vhd-azurelinux-3: ## Builds Azure Linux 3 VHD image for Azure
build-azure-vhd-rhel-8: ## Builds RHEL 8 VHD image for Azure
build-azure-vhd-windows-2019-containerd: ## Builds for Windows Server 2019 with containerd
build-azure-vhd-windows-2022-containerd: ## Builds for Windows Server 2022 with containerd
build-azure-sig-windows-annual-containerd: ## Builds for Windows Server Annual Channel with containerd
build-azure-sig-centos-7-gen2: ## Builds CentOS Gen2 managed image in Shared Image Gallery
build-azure-sig-azurelinux-2-gen2: ## Builds Azure Linux 2 Gen2 managed image in Shared Image Gallery
build-azure-sig-azurelinux-3-gen2: ## Builds Azure Linux 3 Gen2 managed image in Shared Image Gallery
build-azure-sig-flatcar: ## Builds Flatcar Azure managed image in Shared Image Gallery
build-azure-sig-flatcar-gen2: ## Builds Flatcar Azure Gen2 managed image in Shared Image Gallery
build-azure-sig-ubuntu-2004-gen2: ## Builds Ubuntu 20.04 Gen2 managed image in Shared Image Gallery
Expand Down Expand Up @@ -830,6 +833,7 @@ validate-ami-all: $(AMI_VALIDATE_TARGETS) ## Validates all AMIs Packer config

validate-azure-sig-centos-7: ## Validates CentOS 7 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-azurelinux-2: ## Validates Azure Linux 2 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-azurelinux-3: ## Validates Azure Linux 3 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-rhel-8: ## Validates RHEL 8 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-ubuntu-2004: ## Validates Ubuntu 20.04 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-ubuntu-2204: ## Validates Ubuntu 22.04 Azure managed image in Shared Image Gallery Packer config
Expand All @@ -839,6 +843,7 @@ validate-azure-sig-windows-2022-containerd: ## Validate Windows Server 2022 with
validate-azure-sig-windows-annual-containerd: ## Validate Windows Server Annual Channel with containerd Azure managed image in Shared Image Gallery Packer config
validate-azure-vhd-centos-7: ## Validates CentOS 7 VHD image Azure Packer config
validate-azure-vhd-azurelinux-2: ## Validates Azure Linux 2 VHD image Azure Packer config
validate-azure-vhd-azurelinux-3: ## Validates Azure Linux 3 VHD image Azure Packer config
validate-azure-vhd-rhel-8: ## Validates RHEL 8 VHD image Azure Packer config
validate-azure-vhd-ubuntu-2004: ## Validates Ubuntu 20.04 VHD image Azure Packer config
validate-azure-vhd-ubuntu-2204: ## Validates Ubuntu 22.04 VHD image Azure Packer config
Expand All @@ -847,6 +852,7 @@ validate-azure-vhd-windows-2019-containerd: ## Validate Windows Server 2019 VHD
validate-azure-vhd-windows-2022-containerd: ## Validate Windows Server 2022 VHD with containerd image Azure Packer config
validate-azure-sig-centos-7-gen2: ## Validates CentOS 7 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-azurelinux-2-gen2: ## Validates Azure Linux 2 Gen2 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-azurelinux-3-gen2: ## Validates Azure Linux 3 Gen2 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-ubuntu-2004-gen2: ## Validates Ubuntu 20.04 Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-ubuntu-2004-cvm: ## Validates Ubuntu 20.04 CVM Azure managed image in Shared Image Gallery Packer config
validate-azure-sig-ubuntu-2204-gen2: ## Validates Ubuntu 22.04 Azure managed image in Shared Image Gallery Packer config
Expand Down
4 changes: 2 additions & 2 deletions images/capi/ansible/roles/containerd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
when: ansible_os_family == "Debian"

- ansible.builtin.import_tasks: redhat.yml
when: ansible_os_family in ["Common Base Linux Mariner", "RedHat"]
when: ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux", "RedHat"]

- ansible.builtin.import_tasks: photon.yml
when: ansible_os_family == "VMware Photon OS"
Expand Down Expand Up @@ -137,7 +137,7 @@
dest: /etc/systemd/system/containerd.service.d/limit-nofile.conf
src: etc/systemd/system/containerd.service.d/limit-nofile.conf
mode: "0644"
when: ansible_os_family == "Common Base Linux Mariner"
when: ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux"]

- name: Create containerd http proxy conf file if needed
ansible.builtin.template:
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/kubernetes/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
when: kubernetes_source_type == "pkg" and ansible_os_family == "Debian"

- ansible.builtin.import_tasks: azurelinux.yml
when: kubernetes_source_type == "pkg" and ansible_os_family == "Common Base Linux Mariner"
when: kubernetes_source_type == "pkg" and ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux"]

- ansible.builtin.import_tasks: redhat.yml
when: kubernetes_source_type == "pkg" and ansible_os_family == "RedHat"
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ common_raw_photon_rpms: []
# photon and flatcar do not have backward compatibility for legacy distro behavior for sysctl.conf by default
# as it uses systemd-sysctl. set this var so we can use for sysctl conf file value.
sysctl_conf_file: >-
{{ '/etc/sysctl.d/99-sysctl.conf' if ansible_os_family in ['Common Base Linux Mariner', 'Flatcar', 'VMware Photon OS']
{{ '/etc/sysctl.d/99-sysctl.conf' if ansible_os_family in ['Common Base Linux Mariner', 'Flatcar', 'Microsoft Azure Linux', 'VMware Photon OS']
else '/etc/sysctl.conf' }}
pause_image: registry.k8s.io/pause:3.9
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/node/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ dependencies:
- role: setup
vars:
rpms: "{{ common_rpms + azurelinux_rpms + lookup('vars', 'common_' + build_target + '_rpms') }}"
when: ansible_distribution == "Common Base Linux Mariner"
when: ansible_distribution in ["Common Base Linux Mariner", "Microsoft Azure Linux"]
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
name: conntrackd
state: stopped
enabled: false
when: ansible_os_family not in ["Common Base Linux Mariner", "Debian", "Flatcar"]
when: ansible_os_family not in ["Common Base Linux Mariner", "Debian", "Flatcar", "Microsoft Azure Linux"]

- name: Ensure auditd is running and comes on at reboot
ansible.builtin.service:
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/providers/tasks/azurecli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
state: present

- name: Install Azure CLI
when: ansible_os_family == "Common Base Linux Mariner"
when: ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux"]
ansible.builtin.package:
name: azure-cli
state: present
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/setup/tasks/azurelinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
state: latest
lock_timeout: 60

- name: Install baseline dependencies on Mariner
- name: Install baseline dependencies on Azure Linux
ansible.builtin.yum:
name: "{{ rpms }}"
state: present
Expand Down
2 changes: 1 addition & 1 deletion images/capi/ansible/roles/setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]

- ansible.builtin.import_tasks: azurelinux.yml
when: ansible_os_family == "Common Base Linux Mariner"
when: ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux"]

- ansible.builtin.import_tasks: redhat.yml
when: ansible_os_family == "RedHat"
Expand Down
6 changes: 3 additions & 3 deletions images/capi/ansible/roles/sysprep/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
when: ansible_os_family == "RedHat"

- ansible.builtin.import_tasks: azurelinux.yml
when: ansible_os_family == "Common Base Linux Mariner"
when: ansible_os_family in ["Common Base Linux Mariner", "Microsoft Azure Linux"]

- ansible.builtin.import_tasks: photon.yml
when: ansible_os_family == "VMware Photon OS"
Expand All @@ -49,7 +49,7 @@
loop:
- { path: /etc/machine-id, state: absent, mode: "{{ machine_id_mode }}" }
- { path: /etc/machine-id, state: touch, mode: "{{ machine_id_mode }}" }
when: ansible_os_family not in ["Common Base Linux Mariner", "Flatcar"]
when: ansible_os_family not in ["Common Base Linux Mariner", "Flatcar", "Microsoft Azure Linuz"]

- name: Truncate hostname file
ansible.builtin.file:
Expand All @@ -65,7 +65,7 @@
- name: Set hostname
ansible.builtin.hostname:
name: localhost.local
when: ansible_os_family not in ["Common Base Linux Mariner", "Flatcar", "VMware Photon OS"] and packer_build_name != "nutanix"
when: ansible_os_family not in ["Common Base Linux Mariner", "Flatcar", "Microsoft Azure Linux", "VMware Photon OS"] and packer_build_name != "nutanix"

- name: Reset hosts file
ansible.builtin.copy:
Expand Down
6 changes: 3 additions & 3 deletions images/capi/azure_targets.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VHD_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 rhel-8 windows-2019-containerd windows-2022-containerd"
VHD_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 azurelinux-3 rhel-8 windows-2019-containerd windows-2022-containerd"
VHD_CI_TARGETS="ubuntu-2204 ubuntu-2404 azurelinux-2 windows-2019-containerd windows-2022-containerd"
SIG_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 rhel-8 windows-2019-containerd windows-2022-containerd flatcar"
SIG_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 azurelinux-3 rhel-8 windows-2019-containerd windows-2022-containerd flatcar"
SIG_CI_TARGETS="ubuntu-2204 ubuntu-2404 azurelinux-2 windows-2019-containerd windows-2022-containerd flatcar"
SIG_GEN2_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 flatcar"
SIG_GEN2_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 azurelinux-2 azurelinux-3 flatcar"
SIG_GEN2_CI_TARGETS="ubuntu-2204 ubuntu-2404 azurelinux-2 flatcar"
SIG_CVM_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 windows-2019-containerd windows-2022-containerd"
SIG_CVM_CI_TARGETS="ubuntu-2204 ubuntu-2404 windows-2022-containerd"
9 changes: 9 additions & 0 deletions images/capi/packer/azure/azurelinux-3-gen2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"build_name": "azurelinux-3-gen2",
"distribution": "azurelinux",
"distribution_release": "azure-linux-gen2",
"distribution_version": "3",
"image_offer": "azure-linux",
"image_publisher": "MicrosoftCBLMariner",
"image_sku": "azure-linux-gen2"
}
9 changes: 9 additions & 0 deletions images/capi/packer/azure/azurelinux-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"build_name": "azurelinux-3",
"distribution": "azurelinux",
"distribution_release": "azure-linux-3",
"distribution_version": "3",
"image_offer": "azure-linux",
"image_publisher": "MicrosoftCBLMariner",
"image_sku": "azure-linux-3"
}
6 changes: 6 additions & 0 deletions images/capi/packer/azure/scripts/init-sig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ case ${SIG_TARGET} in
azurelinux-2)
create_image_definition ${SIG_TARGET} "azurelinux-2" "V1" "Linux"
;;
azurelinux-3)
create_image_definition ${SIG_TARGET} "azurelinux-3" "V1" "Linux"
;;
rhel-8)
create_image_definition "rhel-8" "rhel-8" "V1" "Linux"
;;
Expand Down Expand Up @@ -115,6 +118,9 @@ case ${SIG_TARGET} in
azurelinux-2-gen2)
create_image_definition ${SIG_TARGET} "azurelinux-2-gen2" "V2" "Linux"
;;
azurelinux-3-gen2)
create_image_definition ${SIG_TARGET} "azurelinux-3-gen2" "V2" "Linux"
;;
flatcar-gen2)
SKU="flatcar-${FLATCAR_CHANNEL}-${FLATCAR_VERSION}-gen2"
create_image_definition "${SKU}" "${SKU}" "V2" "Linux"
Expand Down

0 comments on commit dded864

Please sign in to comment.