Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Graduate EKS out of experimental #2648

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 6 additions & 121 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ CORE_MANIFEST_FILE := infrastructure-components
CORE_CONFIG_DIR := config/default
CORE_NAMESPACE := capa-system

# bootstrap
EKS_BOOTSTRAP_IMAGE_NAME ?= eks-bootstrap-controller
EKS_BOOTSTRAP_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_BOOTSTRAP_IMAGE_NAME)
EKS_BOOTSTRAP_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-bootstrap-controller
EKS_BOOTSTRAP_CONTROLLER_NAME := capa-eks-bootstrap-controller-manager
EKS_BOOTSTRAP_MANIFEST_FILE := eks-bootstrap-components
EKS_BOOTSTRAP_CONFIG_DIR := bootstrap/eks/config/default
EKS_BOOTSTRAP_NAMESPACE := capa-eks-bootstrap-system

# bootstrap
EKS_CONTROLPLANE_IMAGE_NAME ?= eks-controlplane-controller
EKS_CONTROLPLANE_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_CONTROLPLANE_IMAGE_NAME)
EKS_CONTROLPLANE_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-controlplane-controller
EKS_CONTROLPLANE_CONTROLLER_NAME := capa-eks-control-plane-controller-manager
EKS_CONTROLPLANE_MANIFEST_FILE := eks-controlplane-components
EKS_CONTROLPLANE_CONFIG_DIR := controlplane/eks/config/default
EKS_CONTROLPLANE_NAMESPACE := capa-eks-control-plane-system

# Allow overriding manifest generation destination directory
MANIFEST_ROOT ?= config
CRD_ROOT ?= $(MANIFEST_ROOT)/crd/bases
Expand Down Expand Up @@ -207,8 +189,6 @@ test-e2e-eks: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks
.PHONY: e2e-image
e2e-image: docker-pull-prerequisites
docker build -f Dockerfile --tag="gcr.io/k8s-staging-cluster-api/capa-manager:e2e" .
docker build -f Dockerfile --tag="gcr.io/k8s-staging-cluster-api/capa-eks-bootstrap-manager:e2e" --build-arg package=./bootstrap/eks .
docker build -f Dockerfile --tag="gcr.io/k8s-staging-cluster-api/capa-eks-controlplane-manager:e2e" --build-arg package=./controlplane/eks .

CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
Expand All @@ -231,22 +211,11 @@ binaries: managers clusterawsadm ## Builds and installs all binaries
.PHONY: managers
managers:
$(MAKE) manager-aws-infrastructure
$(MAKE) manager-eks-bootstrap
$(MAKE) manager-eks-controlplane

.PHONY: manager-aws-infrastructure
manager-aws-infrastructure: ## Build manager binary.
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS} -extldflags '-static'" -o $(BIN_DIR)/manager .

.PHONY: manager-eks-bootstrap
manager-eks-bootstrap:
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/eks-bootstrap-manager sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks

.PHONY: manager-eks-controlplane
manager-eks-controlplane:
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/eks-controlplane-manager sigs.k8s.io/cluster-api-provider-aws/controlplane/eks


.PHONY: clusterawsadm
clusterawsadm: ## Build clusterawsadm binary.
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/clusterawsadm ./cmd/clusterawsadm
Expand Down Expand Up @@ -331,77 +300,35 @@ generate-go-eks-controlplane: $(CONTROLLER_GEN) $(CONVERSION_GEN)
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

.PHONY: generate-manifests
generate-manifests:
$(MAKE) generate-core-manifests
$(MAKE) generate-eks-bootstrap-manifests
$(MAKE) generate-eks-controlplane-manifests

.PHONY: generate-core-manifests
generate-core-manifests:$(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./api/... \
paths=./$(EXP_DIR)/api/... \
paths=./controlplane/eks/api/...\
paths=./bootstrap/eks/api/... \
crd:crdVersions=v1 \
output:crd:dir=$(CRD_ROOT) \
output:webhook:dir=$(WEBHOOK_ROOT) \
webhook
$(CONTROLLER_GEN) \
paths=./controllers/... \
paths=./$(EXP_DIR)/controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

.PHONY: generate-eks-bootstrap-manifests
generate-eks-bootstrap-manifests: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) \
paths=./bootstrap/eks/api/... \
paths=./bootstrap/eks/controllers/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=./bootstrap/eks/config/crd/bases \
output:rbac:dir=./bootstrap/eks/config/rbac \
output:webhook:dir=./bootstrap/eks/config/webhook \
webhook

.PHONY: generate-eks-controlplane-manifests
generate-eks-controlplane-manifests: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) \
paths=./controlplane/eks/api/... \
paths=./controlplane/eks/controllers/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=./controlplane/eks/config/crd/bases \
output:rbac:dir=./controlplane/eks/config/rbac \
output:webhook:dir=./controlplane/eks/config/webhook \
webhook
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

## --------------------------------------
## Docker
## --------------------------------------

.PHONY: docker-build
docker-build:
$(MAKE) ARCH=$(ARCH) docker-build-core
$(MAKE) ARCH=$(ARCH) docker-build-eks-bootstrap
$(MAKE) ARCH=$(ARCH) docker-build-eks-controlplane

.PHONY: docker-build-core
docker-build-core: docker-pull-prerequisites ## Build the docker image for controller-manager
docker-build: docker-pull-prerequisites ## Build the docker image for controller-manager
docker build --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CORE_CONTROLLER_IMG)-$(ARCH):$(TAG)

.PHONY: docker-build-eks-bootstrap
docker-build-eks-bootstrap: docker-pull-prerequisites
docker build --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" --build-arg package=./bootstrap/eks . -t $(EKS_BOOTSTRAP_CONTROLLER_IMG)-$(ARCH):$(TAG)

.PHONY: docker-build-eks-controlplane
docker-build-eks-controlplane: docker-pull-prerequisites
docker build --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" --build-arg package=./controlplane/eks . -t $(EKS_CONTROLPLANE_CONTROLLER_IMG)-$(ARCH):$(TAG)

.PHONY: docker-push
docker-push: ## Push the docker image
docker push $(CORE_CONTROLLER_IMG)-$(ARCH):$(TAG)
docker push $(EKS_BOOTSTRAP_CONTROLLER_IMG)-$(ARCH):$(TAG)
docker push $(EKS_CONTROLPLANE_CONTROLLER_IMG)-$(ARCH):$(TAG)

.PHONY: docker-pull-prerequisites
docker-pull-prerequisites:
Expand All @@ -422,8 +349,6 @@ docker-build-%:
.PHONY: docker-push-all ## Push all the architecture docker images
docker-push-all: $(addprefix docker-push-,$(ALL_ARCH))
$(MAKE) docker-push-core-manifest
$(MAKE) docker-push-eks-bootstrap-manifest
$(MAKE) docker-push-eks-controlplane-manifest

docker-push-%:
$(MAKE) ARCH=$* docker-push
Expand All @@ -433,16 +358,6 @@ docker-push-core-manifest: ## Push the fat manifest docker image.
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
$(MAKE) docker-push-manifest CONTROLLER_IMG=$(CORE_CONTROLLER_IMG) MANIFEST_FILE=$(CORE_MANIFEST_FILE)

.PHONY: docker-push-eks-bootstrap-manifest
docker-push-eks-bootstrap-manifest: ## Push the fat manifest docker image.
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
$(MAKE) docker-push-manifest CONTROLLER_IMG=$(EKS_BOOTSTRAP_CONTROLLER_IMG) MANIFEST_FILE=$(EKS_BOOTSTRAP_MANIFEST_FILE)

.PHONY: docker-push-eks-controlplane-manifest
docker-push-eks-controlplane-manifest: ## Push the fat manifest docker image.
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
$(MAKE) docker-push-manifest CONTROLLER_IMG=$(EKS_CONTROLPLANE_CONTROLLER_IMG) MANIFEST_FILE=$(EKS_CONTROLPLANE_MANIFEST_FILE)

.PHONY: docker-push-manifest
docker-push-manifest:
docker manifest create --amend $(CONTROLLER_IMG):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(CONTROLLER_IMG)\-&:$(TAG)~g")
Expand All @@ -452,8 +367,6 @@ docker-push-manifest:
.PHONY: staging-manifests
staging-manifests:
$(MAKE) $(RELEASE_DIR)/$(CORE_MANIFEST_FILE).yaml PULL_POLICY=IfNotPresent TAG=$(RELEASE_ALIAS_TAG)
$(MAKE) $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml PULL_POLICY=IfNotPresent TAG=$(RELEASE_ALIAS_TAG)
$(MAKE) $(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml PULL_POLICY=IfNotPresent TAG=$(RELEASE_ALIAS_TAG)

## --------------------------------------
## Release
Expand All @@ -466,10 +379,6 @@ $(RELEASE_DIR):
list-staging-releases: ## List staging images for image promotion
@echo $(CORE_IMAGE_NAME):
$(MAKE) list-image RELEASE_TAG=$(RELEASE_TAG) IMAGE=$(CORE_IMAGE_NAME)
@echo $(EKS_BOOTSTRAP_IMAGE_NAME):
$(MAKE) list-image RELEASE_TAG=$(RELEASE_TAG) IMAGE=$(EKS_BOOTSTRAP_IMAGE_NAME)
@echo $(EKS_CONTROLPLANE_IMAGE_NAME):
$(MAKE) list-image RELEASE_TAG=$(RELEASE_TAG) IMAGE=$(EKS_CONTROLPLANE_IMAGE_NAME)

list-image:
gcloud container images list-tags $(STAGING_REGISTRY)/$(IMAGE) --filter="tags=('$(RELEASE_TAG)')" --format=json
Expand Down Expand Up @@ -513,8 +422,6 @@ $(RELEASE_DIR)/AWSIAMManagedPolicyCloudProviderNodes.json: $(RELEASE_DIR) $(CLUS
.PHONY: release-manifests
release-manifests:
$(MAKE) $(RELEASE_DIR)/$(CORE_MANIFEST_FILE).yaml TAG=$(RELEASE_TAG) PULL_POLICY=IfNotPresent
$(MAKE) $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml TAG=$(RELEASE_TAG) PULL_POLICY=IfNotPresent
$(MAKE) $(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml TAG=$(RELEASE_TAG) PULL_POLICY=IfNotPresent
# Add metadata to the release artifacts
cp metadata.yaml $(RELEASE_DIR)/metadata.yaml

Expand Down Expand Up @@ -575,8 +482,6 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
.PHONY: release-alias-tag
release-alias-tag: # Adds the tag to the last build tag.
gcloud container images add-tag -q $(CORE_CONTROLLER_IMG):$(TAG) $(CORE_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag -q $(EKS_BOOTSTRAP_CONTROLLER_IMG):$(TAG) $(EKS_BOOTSTRAP_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag -q $(EKS_CONTROLPLANE_CONTROLLER_IMG):$(TAG) $(EKS_CONTROLPLANE_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)

.PHONY: release-templates
release-templates: $(RELEASE_DIR) ## Generate release templates
Expand All @@ -597,26 +502,6 @@ $(RELEASE_DIR)/$(CORE_MANIFEST_FILE).yaml:
PROVIDER_CONFIG_DIR=$(CORE_CONFIG_DIR) \
NAMESPACE=$(CORE_NAMESPACE) \

.PHONY: $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml
$(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml:
$(MAKE) compiled-manifest \
PROVIDER=$(EKS_BOOTSTRAP_MANIFEST_FILE) \
OLD_IMG=$(EKS_BOOTSTRAP_CONTROLLER_ORIGINAL_IMG) \
MANIFEST_IMG=$(EKS_BOOTSTRAP_CONTROLLER_IMG) \
CONTROLLER_NAME=$(EKS_BOOTSTRAP_CONTROLLER_NAME) \
PROVIDER_CONFIG_DIR=$(EKS_BOOTSTRAP_CONFIG_DIR) \
NAMESPACE=$(EKS_BOOTSTRAP_NAMESPACE)

.PHONY: $(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml
$(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml:
$(MAKE) compiled-manifest \
PROVIDER=$(EKS_CONTROLPLANE_MANIFEST_FILE) \
OLD_IMG=$(EKS_CONTROLPLANE_CONTROLLER_ORIGINAL_IMG) \
MANIFEST_IMG=$(EKS_CONTROLPLANE_CONTROLLER_IMG) \
CONTROLLER_NAME=$(EKS_CONTROLPLANE_CONTROLLER_NAME) \
PROVIDER_CONFIG_DIR=$(EKS_CONTROLPLANE_CONFIG_DIR) \
NAMESPACE=$(EKS_CONTROLPLANE_NAMESPACE) \

.PHONY: compiled-manifest
compiled-manifest: $(RELEASE_DIR) $(KUSTOMIZE)
$(MAKE) image-patch-source-manifest
Expand Down
26 changes: 0 additions & 26 deletions bootstrap/eks/config/certmanager/certificate.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions bootstrap/eks/config/certmanager/kustomization.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions bootstrap/eks/config/certmanager/kustomizeconfig.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions bootstrap/eks/config/crd/kustomization.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions bootstrap/eks/config/crd/kustomizeconfig.yaml

This file was deleted.

59 changes: 0 additions & 59 deletions bootstrap/eks/config/default/kustomization.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions bootstrap/eks/config/default/kustomizeconfig.yaml

This file was deleted.

Loading