-
Notifications
You must be signed in to change notification settings - Fork 23
feat: add make target for local kind cluster setup. #887
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
base: main
Are you sure you want to change the base?
Changes from all commits
eb0e6a6
8c98821
012081e
87e6693
2b0c1da
375cb51
e4efe50
5599247
5e9f6ea
4c34a39
6ff7840
40ad4f3
d5de51c
56e0adb
f69cd27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,6 +190,11 @@ test-scale-dnspolicy: kube-burner ## Run DNSPolicy scale tests. | |
| cd scale_test/dnspolicy && $(KUBE_BURNER) init -c ${KUBEBURNER_WORKLOAD} --log-level debug | ||
|
|
||
|
|
||
| # Include local environment setup modules | ||
| # Load variables first, then all other modules | ||
| include ./make/vars.mk | ||
| include $(filter-out ./make/vars.mk,$(wildcard ./make/*.mk)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the make/vars.mk two times if I understand the wildcard corrently
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is importing the vars first as the other make files need it as well. One the next line is actually importing all the other make files, except this one. |
||
|
|
||
| ##@ Build Dependencies | ||
|
|
||
| ## Location to install dependencies to | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
|
|
||
| ##@ Component Deployment (Direct from GitHub) | ||
|
|
||
| # Component versions (when not using Helm) | ||
| AUTHORINO_OPERATOR_VERSION ?= latest | ||
| LIMITADOR_OPERATOR_VERSION ?= latest | ||
| DNS_OPERATOR_VERSION ?= latest | ||
|
|
||
| # Convert "latest" to "main" for GitHub refs, otherwise use as-is (e.g., v0.13.0) | ||
| AUTHORINO_GITREF = $(if $(filter latest,$(AUTHORINO_OPERATOR_VERSION)),main,$(AUTHORINO_OPERATOR_VERSION)) | ||
| LIMITADOR_GITREF = $(if $(filter latest,$(LIMITADOR_OPERATOR_VERSION)),main,$(LIMITADOR_OPERATOR_VERSION)) | ||
| DNS_GITREF = $(if $(filter latest,$(DNS_OPERATOR_VERSION)),main,$(DNS_OPERATOR_VERSION)) | ||
|
|
||
| .PHONY: deploy-authorino-operator | ||
| deploy-authorino-operator: ## Deploy Authorino Operator | ||
| @echo "Deploying Authorino Operator ($(AUTHORINO_GITREF)) to $(KUADRANT_NAMESPACE)..." | ||
| @mkdir -p /tmp/kuadrant-kustomize-authorino | ||
| @printf '%s\n' \ | ||
| 'namespace: $(KUADRANT_NAMESPACE)' \ | ||
| 'resources:' \ | ||
| '- github.com/Kuadrant/authorino-operator/config/deploy?ref=$(AUTHORINO_GITREF)' \ | ||
| > /tmp/kuadrant-kustomize-authorino/kustomization.yaml | ||
| kubectl apply --server-side -k /tmp/kuadrant-kustomize-authorino | ||
| @rm -rf /tmp/kuadrant-kustomize-authorino | ||
| @echo "Authorino Operator deployed" | ||
|
|
||
| .PHONY: deploy-limitador-operator | ||
| deploy-limitador-operator: ## Deploy Limitador Operator | ||
| @echo "Deploying Limitador Operator ($(LIMITADOR_GITREF)) to $(KUADRANT_NAMESPACE)..." | ||
| @mkdir -p /tmp/kuadrant-kustomize-limitador | ||
| @printf '%s\n' \ | ||
| 'namespace: $(KUADRANT_NAMESPACE)' \ | ||
| 'resources:' \ | ||
| '- github.com/Kuadrant/limitador-operator/config/default?ref=$(LIMITADOR_GITREF)' \ | ||
| > /tmp/kuadrant-kustomize-limitador/kustomization.yaml | ||
| kubectl apply --server-side -k /tmp/kuadrant-kustomize-limitador | ||
| @rm -rf /tmp/kuadrant-kustomize-limitador | ||
| @echo "Limitador Operator deployed" | ||
|
|
||
| .PHONY: deploy-dns-operator | ||
| deploy-dns-operator: ## Deploy DNS Operator | ||
| @echo "Deploying DNS Operator ($(DNS_GITREF)) to $(KUADRANT_NAMESPACE)..." | ||
| @mkdir -p /tmp/kuadrant-kustomize-dns | ||
| @printf '%s\n' \ | ||
| 'namespace: $(KUADRANT_NAMESPACE)' \ | ||
| 'resources:' \ | ||
| '- github.com/kuadrant/dns-operator/config/default?ref=$(DNS_GITREF)' \ | ||
| > /tmp/kuadrant-kustomize-dns/kustomization.yaml | ||
| kubectl apply --server-side -k /tmp/kuadrant-kustomize-dns | ||
| @rm -rf /tmp/kuadrant-kustomize-dns | ||
| @echo "DNS Operator deployed" | ||
|
|
||
| .PHONY: deploy-kuadrant-operator-components | ||
| deploy-kuadrant-operator-components: ## Deploy Kuadrant Operator from components | ||
| kubectl create namespace $(KUADRANT_NAMESPACE) || true | ||
| $(MAKE) deploy-authorino-operator | ||
| $(MAKE) deploy-limitador-operator | ||
| $(MAKE) deploy-dns-operator | ||
| @echo "Deploying Kuadrant Operator ($(KUADRANT_OPERATOR_GITREF)) to $(KUADRANT_NAMESPACE)..." | ||
| kubectl apply --server-side -k "github.com/kuadrant/kuadrant-operator/config/deploy?ref=$(KUADRANT_OPERATOR_GITREF)" | ||
| @echo "Waiting for all operator deployments to be ready..." | ||
| kubectl -n $(KUADRANT_NAMESPACE) wait --timeout=$(KUBECTL_TIMEOUT) --for=condition=Available deployments --all | ||
| $(MAKE) patch-kuadrant-operator-env | ||
| @echo "All operators deployed in $(KUADRANT_NAMESPACE)" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
|
|
||
| ##@ Core Dependencies | ||
|
|
||
| .PHONY: install-metrics-server | ||
| install-metrics-server: ## Install metrics-server | ||
| @echo "Installing metrics-server..." | ||
| kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml | ||
| kubectl patch deployment metrics-server -n kube-system --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--kubelet-insecure-tls"}]' | ||
| @echo "metrics-server installed" | ||
|
|
||
| .PHONY: install-metallb | ||
| install-metallb: ## Install MetalLB for LoadBalancer services | ||
| @echo "Installing MetalLB $(METALLB_VERSION)..." | ||
| kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/$(METALLB_VERSION)/config/manifests/metallb-native.yaml | ||
| kubectl wait --namespace metallb-system --for=condition=Available deployment/controller --timeout=$(METALLB_TIMEOUT) | ||
| kubectl wait --namespace metallb-system --for=condition=ready pod --selector=component=controller --timeout=$(METALLB_TIMEOUT) | ||
| @echo "Configuring MetalLB IP pool..." | ||
| @printf '%s\n' \ | ||
| 'apiVersion: metallb.io/v1beta1' \ | ||
| 'kind: IPAddressPool' \ | ||
| 'metadata:' \ | ||
| ' name: default' \ | ||
| ' namespace: metallb-system' \ | ||
| 'spec:' \ | ||
| ' addresses:' \ | ||
| ' - 172.18.255.200-172.18.255.250' \ | ||
| | kubectl apply -f - | ||
| @printf '%s\n' \ | ||
| 'apiVersion: metallb.io/v1beta1' \ | ||
| 'kind: L2Advertisement' \ | ||
| 'metadata:' \ | ||
| ' name: default' \ | ||
| ' namespace: metallb-system' \ | ||
| | kubectl apply -f - | ||
| @echo "MetalLB installed with IP pool 172.18.255.200-172.18.255.250" | ||
|
|
||
| .PHONY: gateway-api-install | ||
| gateway-api-install: ## Install Gateway API CRDs | ||
| @echo "Installing Gateway API $(GATEWAY_API_VERSION)..." | ||
| kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/$(GATEWAY_API_VERSION)/standard-install.yaml | ||
| @echo "Gateway API CRDs installed" | ||
|
|
||
| .PHONY: install-cert-manager | ||
| install-cert-manager: ## Install cert-manager | ||
| @echo "Installing cert-manager $(CERT_MANAGER_VERSION)..." | ||
| kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml | ||
| kubectl wait --namespace cert-manager --for=condition=Available deployment/cert-manager --timeout=$(CERT_MANAGER_TIMEOUT) | ||
| kubectl wait --namespace cert-manager --for=condition=Available deployment/cert-manager-webhook --timeout=$(CERT_MANAGER_TIMEOUT) | ||
| kubectl wait --namespace cert-manager --for=condition=ready pod --selector=app.kubernetes.io/name=webhook --timeout=$(CERT_MANAGER_TIMEOUT) | ||
| @echo "cert-manager installed" | ||
|
|
||
| .PHONY: create-cluster-issuer | ||
| create-cluster-issuer: ## Create self-signed ClusterIssuer for TLS testing | ||
| @echo "Creating self-signed ClusterIssuer..." | ||
| @printf '%s\n' \ | ||
| 'apiVersion: cert-manager.io/v1' \ | ||
| 'kind: ClusterIssuer' \ | ||
| 'metadata:' \ | ||
| ' name: kuadrant-qe-issuer' \ | ||
| 'spec:' \ | ||
| ' selfSigned: {}' \ | ||
| | kubectl apply -f - | ||
|
Comment on lines
+55
to
+62
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe replace with https://github.com/Kuadrant/helm-charts-olm/blob/main/charts/kuadrant-instances/templates/cert-manager/03-clusterissuer-kuadrant-qe.yaml so the CA trusted by testsuite is used
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will most likely trigger the gitGuardian and reconcilation with them. I think for kind, self-signed should be good enough. What do you reckon? |
||
| @echo "ClusterIssuer 'kuadrant-qe-issuer' created" | ||
|
|
||
| .PHONY: install-prometheus-crds | ||
| install-prometheus-crds: ## Install only Prometheus Operator CRDs (ServiceMonitor, PodMonitor, etc.) | ||
| @echo "Installing Prometheus Operator CRDs $(PROMETHEUS_OPERATOR_VERSION)..." | ||
| @curl -sL https://github.com/prometheus-operator/prometheus-operator/releases/download/$(PROMETHEUS_OPERATOR_VERSION)/stripped-down-crds.yaml | \ | ||
| kubectl apply --server-side -f - | ||
| @echo "Prometheus CRDs installed" | ||
|
|
||
| .PHONY: apply-additional-manifests | ||
| apply-additional-manifests: ## Apply additional manifests from file (if ADDITIONAL_MANIFESTS is set) | ||
| @if [ -n "$(ADDITIONAL_MANIFESTS)" ]; then \ | ||
| if [ -f "$(ADDITIONAL_MANIFESTS)" ]; then \ | ||
| echo "Applying additional manifests from $(ADDITIONAL_MANIFESTS)..."; \ | ||
| kubectl apply -f "$(ADDITIONAL_MANIFESTS)"; \ | ||
| echo "Additional manifests applied"; \ | ||
| else \ | ||
| echo "❌ Error: ADDITIONAL_MANIFESTS file '$(ADDITIONAL_MANIFESTS)' not found"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| else \ | ||
| echo "⏭️ No additional manifests to apply (ADDITIONAL_MANIFESTS not set)"; \ | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| ##@ EnvoyGateway | ||
|
|
||
| .PHONY: envoygateway-install | ||
| envoygateway-install: ## Install EnvoyGateway | ||
| @echo "Installing EnvoyGateway..." | ||
| helm install eg oci://docker.io/envoyproxy/gateway-helm --version $(ENVOYGATEWAY_VERSION) \ | ||
| --create-namespace \ | ||
| --namespace envoy-gateway-system \ | ||
| --wait | ||
| @echo "EnvoyGateway installed" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
|
|
||
| ##@ Istio | ||
|
|
||
| .PHONY: istio-install | ||
| istio-install: ## Install Istio via SAIL operator | ||
| @echo "Installing Sail Operator $(SAIL_OPERATOR_VERSION)..." | ||
| helm repo add sail-operator https://istio-ecosystem.github.io/sail-operator --force-update | ||
| helm install sail-operator \ | ||
| --create-namespace \ | ||
| --namespace istio-system \ | ||
| --wait \ | ||
| --timeout=$(HELM_TIMEOUT) \ | ||
| sail-operator/sail-operator \ | ||
| --version $(SAIL_OPERATOR_VERSION) | ||
| @echo "Creating Istio CR..." | ||
| @printf '%s\n' \ | ||
| 'apiVersion: sailoperator.io/v1' \ | ||
| 'kind: Istio' \ | ||
| 'metadata:' \ | ||
| ' name: default' \ | ||
| 'spec:' \ | ||
| ' namespace: istio-system' \ | ||
| ' updateStrategy:' \ | ||
| ' type: InPlace' \ | ||
| ' values:' \ | ||
| ' pilot:' \ | ||
| ' autoscaleMin: 2' \ | ||
| ' version: $(ISTIO_VERSION)' \ | ||
| | kubectl apply -f - | ||
| @echo "Istio $(ISTIO_VERSION) installed via SAIL" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| ##@ Kind Cluster | ||
|
|
||
| .PHONY: kind-create-cluster | ||
| kind-create-cluster: ## Create kind cluster | ||
| @echo "Creating kind cluster '$(KIND_CLUSTER_NAME)'..." | ||
| @kind create cluster --name $(KIND_CLUSTER_NAME) || echo "Cluster already exists" | ||
|
|
||
| .PHONY: kind-delete-cluster | ||
| kind-delete-cluster: ## Delete kind cluster | ||
| @echo "Deleting kind cluster '$(KIND_CLUSTER_NAME)'..." | ||
| @kind delete cluster --name $(KIND_CLUSTER_NAME) || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed because of the following line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is importing the vars first as the other make files need it as well. One the next line is actually importing all the other make files, except this one.