diff --git a/Makefile b/Makefile index 35de6853dbb8..eba9f31fb272 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ HELM_OPTS ?= --set serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn=${K # CR for local builds of Karpenter SYSTEM_NAMESPACE ?= karpenter KARPENTER_VERSION ?= $(shell git tag --sort=committerdate | tail -1) -KO_DOCKER_REPO ?= ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/karpenter +KO_DOCKER_REPO ?= ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/dev GETTING_STARTED_SCRIPT_DIR = website/content/en/preview/getting-started/getting-started-with-karpenter/scripts # Common Directories @@ -131,13 +131,13 @@ licenses: download ## Verifies dependency licenses setup: ## Sets up the IAM roles needed prior to deploying the karpenter-controller. This command only needs to be run once CLUSTER_NAME=${CLUSTER_NAME} ./$(GETTING_STARTED_SCRIPT_DIR)/add-roles.sh $(KARPENTER_VERSION) -build: ## Build the Karpenter controller images using ko build - $(eval CONTROLLER_IMG=$(shell $(WITH_GOFLAGS) KO_DOCKER_REPO="$(KO_DOCKER_REPO)" ko build -B github.com/aws/karpenter/cmd/controller)) +image: ## Build the Karpenter controller images using ko build + $(eval CONTROLLER_IMG=$(shell $(WITH_GOFLAGS) KO_DOCKER_REPO="$(KO_DOCKER_REPO)" ko build --bare github.com/aws/karpenter/cmd/controller)) $(eval IMG_REPOSITORY=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 1 | cut -d ":" -f 1)) $(eval IMG_TAG=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 1 | cut -d ":" -f 2 -s)) $(eval IMG_DIGEST=$(shell echo $(CONTROLLER_IMG) | cut -d "@" -f 2)) -apply: build ## Deploy the controller from the current state of your git repository into your ~/.kube/config cluster +apply: image ## Deploy the controller from the current state of your git repository into your ~/.kube/config cluster helm upgrade --install karpenter charts/karpenter --namespace ${SYSTEM_NAMESPACE} \ $(HELM_OPTS) \ --set controller.image.repository=$(IMG_REPOSITORY) \ diff --git a/website/content/en/docs/contributing/development-guide.md b/website/content/en/docs/contributing/development-guide.md index 4f59fabd563f..d936cec581d2 100644 --- a/website/content/en/docs/contributing/development-guide.md +++ b/website/content/en/docs/contributing/development-guide.md @@ -62,7 +62,7 @@ make presubmit # run codegen, lint, and tests If you are only interested in building the Karpenter images and not deploying the updated release to your cluster immediately with Helm, you can run ```bash -make build # build and push the karpenter images +make image # build and push the karpenter images ``` ### Testing @@ -106,15 +106,12 @@ stern -n karpenter -l app.kubernetes.io/name=karpenter ### AWS For local development on Karpenter you will need a Docker repo which can manage your images for Karpenter components. -You can use the following command to provision an ECR repository. +You can use the following command to provision an ECR repository. We recommend using a single "dev" repository for +development across multiple projects, and to use specific image hashes instead of image tags. ```bash aws ecr create-repository \ - --repository-name karpenter/controller \ - --image-scanning-configuration scanOnPush=true \ - --region "${AWS_DEFAULT_REGION}" -aws ecr create-repository \ - --repository-name karpenter/webhook \ + --repository-name dev \ --image-scanning-configuration scanOnPush=true \ --region "${AWS_DEFAULT_REGION}" ``` @@ -122,7 +119,7 @@ aws ecr create-repository \ Once you have your ECR repository provisioned, configure your Docker daemon to authenticate with your newly created repository. ```bash -export KO_DOCKER_REPO="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/karpenter" +export KO_DOCKER_REPO="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/dev" aws ecr get-login-password --region "${AWS_DEFAULT_REGION}" | docker login --username AWS --password-stdin "${KO_DOCKER_REPO}" ``` diff --git a/website/content/en/preview/contributing/development-guide.md b/website/content/en/preview/contributing/development-guide.md index 4f59fabd563f..d936cec581d2 100644 --- a/website/content/en/preview/contributing/development-guide.md +++ b/website/content/en/preview/contributing/development-guide.md @@ -62,7 +62,7 @@ make presubmit # run codegen, lint, and tests If you are only interested in building the Karpenter images and not deploying the updated release to your cluster immediately with Helm, you can run ```bash -make build # build and push the karpenter images +make image # build and push the karpenter images ``` ### Testing @@ -106,15 +106,12 @@ stern -n karpenter -l app.kubernetes.io/name=karpenter ### AWS For local development on Karpenter you will need a Docker repo which can manage your images for Karpenter components. -You can use the following command to provision an ECR repository. +You can use the following command to provision an ECR repository. We recommend using a single "dev" repository for +development across multiple projects, and to use specific image hashes instead of image tags. ```bash aws ecr create-repository \ - --repository-name karpenter/controller \ - --image-scanning-configuration scanOnPush=true \ - --region "${AWS_DEFAULT_REGION}" -aws ecr create-repository \ - --repository-name karpenter/webhook \ + --repository-name dev \ --image-scanning-configuration scanOnPush=true \ --region "${AWS_DEFAULT_REGION}" ``` @@ -122,7 +119,7 @@ aws ecr create-repository \ Once you have your ECR repository provisioned, configure your Docker daemon to authenticate with your newly created repository. ```bash -export KO_DOCKER_REPO="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/karpenter" +export KO_DOCKER_REPO="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/dev" aws ecr get-login-password --region "${AWS_DEFAULT_REGION}" | docker login --username AWS --password-stdin "${KO_DOCKER_REPO}" ``` diff --git a/website/content/en/v0.29/contributing/development-guide.md b/website/content/en/v0.29/contributing/development-guide.md index 4f59fabd563f..21e369ce87b6 100644 --- a/website/content/en/v0.29/contributing/development-guide.md +++ b/website/content/en/v0.29/contributing/development-guide.md @@ -62,7 +62,7 @@ make presubmit # run codegen, lint, and tests If you are only interested in building the Karpenter images and not deploying the updated release to your cluster immediately with Helm, you can run ```bash -make build # build and push the karpenter images +make image # build and push the karpenter images ``` ### Testing