Skip to content

Commit

Permalink
Merge pull request #834 from kinvolk/jepio/flatcar-gen2
Browse files Browse the repository at this point in the history
flatcar Azure gen2 images
  • Loading branch information
k8s-ci-robot authored May 19, 2022
2 parents ddd0f29 + ec4ee7d commit e7b0e8b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
7 changes: 4 additions & 3 deletions images/capi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SHELL := /usr/bin/env bash

# This option is for running docker manifest command
export DOCKER_CLI_EXPERIMENTAL := enabled
export PATH := $(PATH):$(PWD)/.local/bin
export PATH := $(PATH):$(CURDIR)/.local/bin

export IB_VERSION ?= $(shell git describe --dirty)

Expand Down Expand Up @@ -229,9 +229,9 @@ WINDOWS_VERSIONS := windows-2019 windows-2004 windows-2022

# Set Flatcar Container Linux channel and version if not supplied
FLATCAR_CHANNEL ?= stable
FLATCAR_VERSION ?= 2905.2.3
FLATCAR_VERSION ?= 3033.2.4
ifeq ($(FLATCAR_VERSION),current)
FLATCAR_VERSION := $(shell hack/image-grok-latest-flatcar-version.sh $(FLATCAR_CHANNEL))
override FLATCAR_VERSION := $(shell hack/image-grok-latest-flatcar-version.sh $(FLATCAR_CHANNEL))
endif

export FLATCAR_CHANNEL FLATCAR_VERSION
Expand Down Expand Up @@ -469,6 +469,7 @@ build-azure-vhd-windows-2022-containerd: ## Builds for Windows Server 2022 with
build-azure-vhd-windows-2004: ## Builds for Windows Server 2004 SAC
build-azure-sig-centos-7-gen2: ## Builds CentOS 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-1804-gen2: ## Builds Ubuntu 18.04 Gen2 managed image in Shared Image Gallery
build-azure-sig-ubuntu-2004-gen2: ## Builds Ubuntu 20.04 Gen2 managed image in Shared Image Gallery
build-azure-vhds: $(AZURE_BUILD_VHD_TARGETS) ## Builds all Azure VHDs
Expand Down
2 changes: 1 addition & 1 deletion images/capi/azure_targets.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VHD_TARGETS="ubuntu-1804 ubuntu-2004 centos-7 windows-2019 windows-2019-containerd windows-2022-containerd"
SIG_TARGETS="ubuntu-1804 ubuntu-2004 centos-7 windows-2019 windows-2019-containerd windows-2022-containerd flatcar"
SIG_GEN2_TARGETS="ubuntu-1804 ubuntu-2004 centos-7"
SIG_GEN2_TARGETS="ubuntu-1804 ubuntu-2004 centos-7 flatcar"
23 changes: 23 additions & 0 deletions images/capi/packer/azure/flatcar-gen2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ansible_extra_vars": "ansible_python_interpreter=/opt/pypy/bin/pypy",
"build_name": "flatcar-gen2",
"crictl_source_type": "http",
"distribution": "flatcar",
"distribution_release": "{{env `FLATCAR_CHANNEL`}}",
"distribution_version": "{{env `FLATCAR_CHANNEL`}}-{{env `FLATCAR_VERSION`}}",
"image_offer": "flatcar-container-linux-free",
"image_publisher": "kinvolk",
"image_sku": "{{env `FLATCAR_CHANNEL`}}-gen2",
"image_version": "{{env `FLATCAR_VERSION` }}",
"kubernetes_cni_source_type": "http",
"kubernetes_source_type": "http",
"plan_image_offer": "{{user `image_offer`}}",
"plan_image_publisher": "{{user `image_publisher`}}",
"plan_image_sku": "{{user `image_sku`}}",
"python_path": "/opt/pypy/site-packages",
"root_device_name": "/dev/sda",
"ssh_username": "core",
"systemd_prefix": "/etc/systemd",
"sysusr_prefix": "/opt",
"sysusrlocal_prefix": "/opt"
}
2 changes: 1 addition & 1 deletion images/capi/packer/azure/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"BUILD_NAME={{user `build_name`}}"
],
"inline": [
"if [ $BUILD_NAME != \"flatcar\" ]; then exit 0; fi",
"if [[ $BUILD_NAME != \"flatcar\"* ]]; then exit 0; fi",
"sudo bash -c \"/usr/share/oem/python/bin/python /usr/share/oem/bin/waagent -force -deprovision+user && sync\""
],
"inline_shebang": "/bin/bash -x",
Expand Down
4 changes: 4 additions & 0 deletions images/capi/packer/azure/scripts/init-sig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ case ${SIG_TARGET} in
centos-7-gen2)
create_image_definition "centos-7.7-gen2" "centos-7.7-gen2" "V2" "Linux"
;;
flatcar-gen2)
SKU="flatcar-${FLATCAR_CHANNEL}-${FLATCAR_VERSION}-gen2"
create_image_definition "${SKU}" "${SKU}" "V2" "Linux"
;;
*)
>&2 echo "Unsupported SIG target: '${SIG_TARGET}'"
exit 1
Expand Down

0 comments on commit e7b0e8b

Please sign in to comment.