Skip to content

First step in enabling running conformance tests for Istio on MacOS using Kind #1269

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
25 changes: 19 additions & 6 deletions conformance/scripts/istio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ metadata:
name: config
namespace: metallb-system
endef
export METALLB_CONFIG

# Multi-line YAML configuration for metallb (kind)
define METALLB_KIND_CONFIG
Expand All @@ -66,6 +67,7 @@ metadata:
name: empty
namespace: metallb-system
endef
export METALLB_KIND_CONFIG

define TLS_DESTINATION_RULES
apiVersion: networking.istio.io/v1
Expand All @@ -92,6 +94,7 @@ spec:
mode: SIMPLE
insecureSkipVerify: true
endef
export TLS_DESTINATION_RULES

# README template for implementation conformance reports
define README_TEMPLATE
Expand All @@ -118,6 +121,7 @@ For instructions on how to reproduce these test results and run the conformance

For detailed information about conformance testing, report generation, and requirements, see the [main conformance README](../../../../../README.md).
endef
export README_TEMPLATE

.PHONY: setup-env-minikube setup-env-kind setup-env-openshift setup-minikube setup-kind setup-openshift setup-istio setup-istio-minikube setup-istio-kind setup-istio-openshift setup-gateway-api-crds setup-inference-extension-crds setup-crds setup-tls run-tests readme-update clean clean-reports help ensure-report-dir

Expand Down Expand Up @@ -268,7 +272,7 @@ setup-minikube:
minikube start --kubernetes-version=$(MINIKUBE_K8S_VERSION)
minikube addons enable metallb
@echo "Configuring metallb address pool..."
$(file >/tmp/metallb-config.yaml,$(METALLB_CONFIG))
echo '$${METALLB_CONFIG}' | envsubst '$${METALLB_CONFIG}' >/tmp/metallb-config.yaml
@MINIKUBE_IP=$$(minikube ip); \
NETWORK_PREFIX=$${MINIKUBE_IP%.*}; \
echo "Using IP range: $${NETWORK_PREFIX}.100-$${NETWORK_PREFIX}.200"; \
Expand All @@ -292,11 +296,17 @@ setup-kind:
kubectl wait --namespace metallb-system --for=condition=ready pod --selector=component=controller --timeout=90s
kubectl wait --namespace metallb-system --for=condition=ready pod --selector=component=speaker --timeout=90s
@echo "Configuring metallb address pool..."
$(file >/tmp/metallb-kind-config.yaml,$(METALLB_KIND_CONFIG))
echo '$${METALLB_KIND_CONFIG}' | envsubst '$${METALLB_KIND_CONFIG}' >/tmp/metallb-kind-config.yaml
@DOCKER_NETWORK=$$(docker network inspect -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}' kind); \
NETWORK_PREFIX=$${DOCKER_NETWORK%.*}; \
echo "Using IP range: $${NETWORK_PREFIX}.200-$${NETWORK_PREFIX}.250"; \
sed -i "s/NETWORK_PREFIX/$${NETWORK_PREFIX}/g" /tmp/metallb-kind-config.yaml
OS=$$(uname -s | tr '[:upper:]' '[:lower:]'); \
if [ "$$OS" = "darwin" ]; then \
BACKUP=".bak"; \
else \
BACKUP=""; \
fi; \
sed -i $${BACKUP} "s/NETWORK_PREFIX/$${NETWORK_PREFIX}/g" /tmp/metallb-kind-config.yaml
kubectl apply -f /tmp/metallb-kind-config.yaml
@rm -f /tmp/metallb-kind-config.yaml

Expand All @@ -313,6 +323,9 @@ $(ISTIOCTL_BIN):
@echo "Downloading istioctl version $(ISTIO_VERSION)..."
@mkdir -p $(ISTIOCTL_DIR)
@OS=$$(uname -s | tr '[:upper:]' '[:lower:]'); \
case "$$OS" in \
darwin) OS=OSX ;; \
esac; \
ARCH=$$(uname -m); \
case "$$ARCH" in \
x86_64) ARCH=amd64 ;; \
Expand Down Expand Up @@ -369,7 +382,7 @@ $(ISTIOCTL_BIN):
$(REPORT_BASE_DIR)/README.md: Makefile | ensure-report-dir
@echo "Generating README for $(PROJECT) conformance reports..."
@echo "Report directory: $(REPORT_BASE_DIR)"
$(file >/tmp/readme-template.md,$(README_TEMPLATE))
echo '$${README_TEMPLATE}' | envsubst '$${README_TEMPLATE}' >/tmp/readme-template.md
@sed -e 's/$$(PROJECT)/$(PROJECT)/g' \
-e 's/$$(PROFILE)/$(PROFILE)/g' \
-e 's/$$(INFERENCE_EXTENSION_VERSION)/$(INFERENCE_EXTENSION_VERSION)/g' \
Expand Down Expand Up @@ -433,7 +446,7 @@ setup-crds: setup-gateway-api-crds setup-inference-extension-crds
setup-tls:
@echo "Setting up TLS for EPP..."
-kubectl create namespace gateway-conformance-app-backend || true
$(file >/tmp/tls-destination-rules.yaml,$(TLS_DESTINATION_RULES))
echo '$${TLS_DESTINATION_RULES}' | envsubst '$${TLS_DESTINATION_RULES}' >/tmp/tls-destination-rules.yaml
kubectl apply -f /tmp/tls-destination-rules.yaml
@rm -f /tmp/tls-destination-rules.yaml

Expand Down Expand Up @@ -533,4 +546,4 @@ clean-reports:
@echo "Cleaning up README..."
rm -f $(REPORT_BASE_DIR)/README.md
@echo "Conformance reports and README for $(PROJECT) cleaned up"
@echo "Note: Run 'make readme-update' to regenerate the README with current $(REPORT_BASE_DIR) reports"
@echo "Note: Run 'make readme-update' to regenerate the README with current $(REPORT_BASE_DIR) reports"