From 9c67536bf9b31c2b408e46a3e2733805032b5159 Mon Sep 17 00:00:00 2001 From: M00nF1sh Date: Tue, 30 Jul 2019 17:41:45 -0700 Subject: [PATCH] change the amiName pattern to use minor version --- Makefile | 9 ++++++--- eks-worker-al2.json | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 404ded510..38a0e299b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ PACKER_BINARY ?= packer -PACKER_VARIABLES := binary_bucket_name kubernetes_version kubernetes_build_date docker_version cni_version cni_plugin_version source_ami_id arch instance_type +PACKER_VARIABLES := ami_name binary_bucket_name kubernetes_version kubernetes_build_date docker_version cni_version cni_plugin_version source_ami_id arch instance_type +AWS_DEFAULT_REGION ?= us-west-2 + +K8S_VERSION_PARTS := $(subst ., ,$(kubernetes_version)) +K8S_VERSION_MINOR := $(word 1,${K8S_VERSION_PARTS}).$(word 2,${K8S_VERSION_PARTS}) +ami_name ?= amazon-eks-node-$(K8S_VERSION_MINOR)-v$(shell date +'%Y%m%d') arch ?= x86_64 ifeq ($(arch), arm64) instance_type ?= a1.large @@ -8,8 +13,6 @@ else instance_type ?= m4.large endif -AWS_DEFAULT_REGION ?= us-west-2 - T_RED := \e[0;31m T_GREEN := \e[0;32m T_YELLOW := \e[0;33m diff --git a/eks-worker-al2.json b/eks-worker-al2.json index ce1c2c673..e233ed6e0 100644 --- a/eks-worker-al2.json +++ b/eks-worker-al2.json @@ -1,7 +1,7 @@ { "variables": { "aws_region": "us-west-2", - "ami_name": "amazon-eks-node-{{user `kubernetes_version`}}-v{{isotime `20060102`}}", + "ami_name": null, "creator": "{{env `USER`}}", "encrypted": "false", "kms_key_id": "",