Skip to content
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ For local development and testing, you can set up a complete Kuadrant environmen

### Prerequisites
* [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
* [cloud-provider-kind](https://github.com/kubernetes-sigs/cloud-provider-kind) (LoadBalancer support)
* [Helm](https://helm.sh/docs/intro/install/)
* [jq](https://jqlang.github.io/jq/download/) (JSON processor)

> **⚠️ macOS Limitation:**
> MetalLB LoadBalancer services have limited functionality on macOS due to Docker Desktop's VM isolation. While MetalLB will work inside the cluster, LoadBalancer IPs won't be accessible from your Mac host machine. **For macOS users, we recommend running tests in containers** (see [From a Container](#from-a-container) section above) in addition to the local Kind setup.
> **Podman users:** Set `CONTAINER_ENGINE=podman` when running `make local-setup`. Docker is used by default.

> **macOS container runtime:** Use [Podman Desktop](https://podman-desktop.io/) or [Docker Desktop](https://www.docker.com/products/docker-desktop/) as the container runtime. Other Docker-compatible runtimes (e.g. OrbStack) may not work due to LoadBalancer networking incompatibilities with `cloud-provider-kind`.

### Quick Start

Expand All @@ -67,7 +69,7 @@ GATEWAYAPI_PROVIDER=envoygateway INSTALL_PROMETHEUS=true ADDITIONAL_MANIFESTS=./

This will:
1. Create a Kind cluster named `kuadrant-local`
2. Install metrics-server and MetalLB (LoadBalancer support)
2. Install metrics-server and start cloud-provider-kind (LoadBalancer support)
3. Install Gateway API CRDs
4. Install cert-manager and create a self-signed ClusterIssuer
5. Install Prometheus stack (enabled by default, disable with `INSTALL_PROMETHEUS=false`) - full monitoring stack with Prometheus Operator, Prometheus Server, and Grafana exposed via LoadBalancer
Expand Down
56 changes: 31 additions & 25 deletions make/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,37 @@ install-metrics-server: ## Install metrics-server
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: start-cloud-provider
start-cloud-provider: ## Start cloud-provider-kind for LoadBalancer services
@if ! command -v cloud-provider-kind >/dev/null 2>&1; then \
echo "ERROR: cloud-provider-kind not found."; \
echo "Install it with: go install sigs.k8s.io/cloud-provider-kind@latest"; \
echo " or on macOS: brew install cloud-provider-kind"; \
exit 1; \
fi
@if pgrep -x cloud-provider-kind >/dev/null 2>&1; then \
echo "cloud-provider-kind is already running"; \
elif [ "$$(uname)" = "Darwin" ]; then \
echo "Starting cloud-provider-kind (macOS, requires sudo)..."; \
sudo cloud-provider-kind > /tmp/cloud-provider-kind.log 2>&1 & \
sleep 2; \
echo "cloud-provider-kind started (log: /tmp/cloud-provider-kind.log)"; \
else \
echo "Starting cloud-provider-kind..."; \
cloud-provider-kind > /tmp/cloud-provider-kind.log 2>&1 & \
sleep 2; \
echo "cloud-provider-kind started (log: /tmp/cloud-provider-kind.log)"; \
fi

.PHONY: stop-cloud-provider
stop-cloud-provider: ## Stop cloud-provider-kind background process
@echo "Stopping cloud-provider-kind..."
@if [ "$$(uname)" = "Darwin" ]; then \
sudo pkill -f cloud-provider-kind 2>/dev/null || true; \
else \
kill [c]loud-provider-kind 2>/dev/null || true; \
fi
@echo "cloud-provider-kind stopped"

.PHONY: gateway-api-install
gateway-api-install: ## Install Gateway API CRDs
Expand Down
8 changes: 6 additions & 2 deletions make/kind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
.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"
@if kind get clusters | grep -qx "$(KIND_CLUSTER_NAME)"; then \
echo "Cluster already exists"; \
else \
KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) kind create cluster --name $(KIND_CLUSTER_NAME); \
fi

.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
@KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) kind delete cluster --name $(KIND_CLUSTER_NAME) || true
5 changes: 3 additions & 2 deletions make/local-setup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local-setup: ## Complete local environment setup (kind cluster + all dependencie
$(MAKE) kind-delete-cluster
$(MAKE) kind-create-cluster
$(MAKE) install-metrics-server
$(MAKE) install-metallb
$(MAKE) start-cloud-provider
$(MAKE) gateway-api-install
$(MAKE) install-cert-manager
$(MAKE) create-cluster-issuer
Expand Down Expand Up @@ -45,5 +45,6 @@ ifeq ($(INSTALL_PROMETHEUS),true)
endif

.PHONY: local-cleanup
local-cleanup: ## Delete local kind cluster
local-cleanup: ## Delete local kind cluster and stop background processes
$(MAKE) stop-cloud-provider
$(MAKE) kind-delete-cluster
3 changes: 1 addition & 2 deletions make/vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Kind cluster configuration
KIND_CLUSTER_NAME ?= kuadrant-local
CONTAINER_ENGINE ?= docker
Comment thread
silvi-t marked this conversation as resolved.

# Gateway provider (istio or envoygateway)
GATEWAYAPI_PROVIDER ?= istio
Expand All @@ -12,7 +13,6 @@ ISTIO_VERSION ?= v1.26-latest
SAIL_OPERATOR_VERSION ?= v1.26-latest
ENVOYGATEWAY_VERSION ?= v1.2.4
CERT_MANAGER_VERSION ?= v1.18.2
METALLB_VERSION ?= v0.15.2
GATEWAY_API_VERSION ?= v1.3.0
PROMETHEUS_OPERATOR_VERSION ?= v0.78.2

Expand Down Expand Up @@ -45,6 +45,5 @@ ADDITIONAL_MANIFESTS ?=
KUBECTL_TIMEOUT ?= 300s
CERT_MANAGER_TIMEOUT ?= 120s
KUADRANT_CR_TIMEOUT ?= 120s
METALLB_TIMEOUT ?= 90s
HELM_TIMEOUT ?= 300s
TOOLS_TIMEOUT ?= 10m0s
2 changes: 2 additions & 0 deletions testsuite/gateway/envoy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import openshift_client as oc

from testsuite.certificates import Certificate
from testsuite.config import settings
from testsuite.gateway import Gateway
from testsuite.kubernetes import Selector
from testsuite.kubernetes.client import KubernetesClient
Expand Down Expand Up @@ -98,6 +99,7 @@ def commit(self):
service_type="LoadBalancer",
)
self.service.commit()
self.service.wait_for_ready(slow_loadbalancers=settings["control_plane"]["slow_loadbalancers"])

def get_tls_cert(self, _) -> Optional[Certificate]:
return None
Expand Down
Loading