Skip to content

Commit

Permalink
chore: KIC CRDs installed with make install (#304)
Browse files Browse the repository at this point in the history
* chore: KIC CRDs installed with make install

Signed-off-by: Mattia Lavacca <[email protected]>

* chore: KIC version is fetched from go.mod

Signed-off-by: Mattia Lavacca <[email protected]>

---------

Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca authored Jun 6, 2024
1 parent 7573455 commit 90e29b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,11 @@ GATEWAY_API_CRDS_STANDARD_URL = github.com/$(GATEWAY_API_REPO)/config/crd/standa
GATEWAY_API_CRDS_EXPERIMENTAL_URL = github.com/$(GATEWAY_API_REPO)/config/crd/experimental?ref=$(GATEWAY_API_VERSION)
GATEWAY_API_RAW_REPO_URL = $(GATEWAY_API_RAW_REPO)/$(GATEWAY_API_VERSION)

KIC_REPO ?= kong/kubernetes-ingress-controller
KIC_PACKAGE ?= github.com/$(KIC_REPO)/v3
KIC_VERSION ?= $(shell go list -m -f '{{ .Version }}' $(KIC_PACKAGE))
KIC_CRDS_URL ?= github.com/$(KIC_REPO)/config/crd?ref=$(KIC_VERSION)

.PHONY: generate.gateway-api-urls
generate.gateway-api-urls:
CRDS_STANDARD_URL="$(GATEWAY_API_CRDS_STANDARD_URL)" \
Expand Down Expand Up @@ -503,24 +508,28 @@ debug.skaffold.continuous: _ensure-kong-system-namespace
# Install CRDs into the K8s cluster specified in ~/.kube/config.
.PHONY: install
install: manifests kustomize install-gateway-api-crds
$(KUSTOMIZE) build $(KIC_CRDS_URL) | kubectl apply -f -
$(KUSTOMIZE) build config/crd | kubectl apply --server-side -f -

# Install standard and experimental CRDs into the K8s cluster specified in ~/.kube/config.
.PHONY: install.all
install.all: manifests kustomize install-gateway-api-crds
$(KUSTOMIZE) build $(KIC_CRDS_URL) | kubectl apply -f -
kubectl apply --server-side -f $(PROJECT_DIR)/config/crd/bases/
kubectl get crd -ojsonpath='{.items[*].metadata.name}' | xargs -n1 kubectl wait --for condition=established crd

# Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
# Call with ignore-not-found=true to ignore resource not found errors during deletion.
.PHONY: uninstall
uninstall: manifests kustomize uninstall-gateway-api-crds
$(KUSTOMIZE) build $(KIC_CRDS_URL) | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

# Uninstall standard and experimental CRDs from the K8s cluster specified in ~/.kube/config.
# Call with ignore-not-found=true to ignore resource not found errors during deletion.
.PHONY: uninstall.all
uninstall.all: manifests kustomize uninstall-gateway-api-crds
$(KUSTOMIZE) build $(KIC_CRDS_URL) | kubectl apply -f -
kubectl delete --ignore-not-found=$(ignore-not-found) -f $(PROJECT_DIR)/config/crd/bases/

# Deploy controller to the K8s cluster specified in ~/.kube/config.
Expand Down

0 comments on commit 90e29b2

Please sign in to comment.