@@ -15,9 +15,19 @@ K8S_VERSION_MINOR := $(word 1,${K8S_VERSION_PARTS}).$(word 2,${K8S_VERSION_PARTS
1515AMI_VARIANT ?= amazon-eks
1616AMI_VERSION ?= v$(shell date '+% Y% m% d')
1717aws_region ?= us-west-2
18- os_distro ?= al2
1918arch ?= x86_64
2019
20+ BUILD_TARGETS := build k8s validate
21+
22+ ifneq ($(filter $(BUILD_TARGETS ) ,$(MAKECMDGOALS ) ) ,)
23+ ifndef os_distro
24+ $(error os_distro is required (e.g., os_distro=al2023))
25+ endif
26+ ifndef k8s
27+ $(error k8s is required (e.g., k8s=1.35))
28+ endif
29+ endif
30+
2131ifeq ($(os_distro ) , al2023)
2232 AMI_VARIANT := $(AMI_VARIANT)-al2023
2333endif
3343
3444ifdef enable_accelerator
3545 AMI_VARIANT := $(AMI_VARIANT)-$(enable_accelerator)
36-
37- ifeq ($(os_distro), al2)
38- enable_efa ?= true
39- launch_block_device_mappings_volume_size ?= 10
40- endif
4146endif
4247
4348ami_name ?= $(AMI_VARIANT ) -node-$(K8S_VERSION_MINOR ) -$(AMI_VERSION )
@@ -48,11 +53,8 @@ else ifneq ($(filter $(aws_region),us-gov-west-1 us-gov-east-1),)
4853 source_ami_owners ?= 045324592363
4954endif
5055
51- # default to the latest supported Kubernetes version
52- k8s =1.28
53-
5456.PHONY : build
55- build : # # Build EKS Optimized AMI, default using AL2, use os_distro=al2023 for AL2023 AMI
57+ build : # # Build EKS Optimized AMI (requires os_distro=al2023)
5658 $(MAKE ) k8s $(shell hack/latest-binaries.sh $(k8s ) $(aws_region ) )
5759
5860.PHONY : fmt
@@ -69,10 +71,6 @@ lint-code: ## Check the source files for syntax and format issues
6971 hack/shellcheck --format gcc --severity warning
7072 hack/lint-space-errors.sh
7173
72- .PHONY : test
73- test : # # run the test-harness
74- templates/test/test-harness.sh
75-
7674PACKER_BINARY ?= packer
7775PACKER_TEMPLATE_DIR ?= templates/$(os_distro )
7876PACKER_TEMPLATE_FILE ?= $(PACKER_TEMPLATE_DIR ) /template.json
@@ -107,33 +105,6 @@ k8s: validate ## Build default K8s version of EKS Optimized AMI
107105 @echo " Building AMI [os_distro=$( os_distro) kubernetes_version=$( kubernetes_version) arch=$( arch) $( if $( enable_accelerator) ,enable_accelerator=$( enable_accelerator) ) ]"
108106 $(PACKER_BINARY ) build -timestamp-ui -color=false $(PACKER_ARGS ) $(PACKER_TEMPLATE_FILE )
109107
110- # DEPRECATION NOTICE: `make` targets for each Kubernetes minor version will not be added after 1.28
111- # Use the `k8s` variable to specify a minor version instead
112-
113- .PHONY : 1.23
114- 1.23 : # # Build EKS Optimized AMI - K8s 1.23 - DEPRECATED: use the `k8s` variable instead
115- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.23 $(aws_region ) )
116-
117- .PHONY : 1.24
118- 1.24 : # # Build EKS Optimized AMI - K8s 1.24 - DEPRECATED: use the `k8s` variable instead
119- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.24 $(aws_region ) )
120-
121- .PHONY : 1.25
122- 1.25 : # # Build EKS Optimized AMI - K8s 1.25 - DEPRECATED: use the `k8s` variable instead
123- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.25 $(aws_region ) )
124-
125- .PHONY : 1.26
126- 1.26 : # # Build EKS Optimized AMI - K8s 1.26 - DEPRECATED: use the `k8s` variable instead
127- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.26 $(aws_region ) )
128-
129- .PHONY : 1.27
130- 1.27 : # # Build EKS Optimized AMI - K8s 1.27 - DEPRECATED: use the `k8s` variable instead
131- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.27 $(aws_region ) )
132-
133- .PHONY : 1.28
134- 1.28 : # # Build EKS Optimized AMI - K8s 1.28 - DEPRECATED: use the `k8s` variable instead
135- $(MAKE ) k8s $(shell hack/latest-binaries.sh 1.28 $(aws_region ) )
136-
137108.PHONY : lint-docs
138109lint-docs : # # Lint the docs
139110 hack/lint-docs.sh
0 commit comments