Skip to content

feat: add make target for local kind cluster setup.#887

Open
crstrn13 wants to merge 15 commits intomainfrom
local-kind
Open

feat: add make target for local kind cluster setup.#887
crstrn13 wants to merge 15 commits intomainfrom
local-kind

Conversation

@crstrn13
Copy link
Contributor

Description

  • Add comprehensive make local-setup command for one-step local Kuadrant environment creation using Kind
  • Implement modular Makefile structure with conditional tool deployment and configurable gateway providers
  • Add support for optional AWS credentials and Red Hat registry authentication
  • Configure Kuadrant operator with optimized service timeouts for faster test execution

Changes

New Makefile Structure

  • Split monolithic Makefile into modular components under make/ directory:
    • make/vars.mk - Centralized configuration variables with sensible defaults
    • make/kind.mk - Kind cluster management (create, delete)
    • make/dependencies.mk - Infrastructure dependencies (metrics-server, MetalLB, Gateway API, cert-manager)
    • make/istio.mk - Istio gateway provider installation
    • make/envoygateway.mk - EnvoyGateway provider installation
    • make/kuadrant.mk - Kuadrant operator deployment and configuration
    • make/tools.mk - Testing tools deployment (Keycloak, Mockserver, etc.)
    • make/local-setup.mk - Main local setup orchestration

Local Setup Features

  • One-command setup: make local-setup creates complete environment
  • Gateway provider selection: Choose between Istio or EnvoyGateway via GATEWAYAPI_PROVIDER variable
  • Conditional tool deployment: Testing tools only deployed if Red Hat registry credentials provided
  • Conditional AWS secret: DNS credentials secret only created if AWS vars provided
  • Self-signed ClusterIssuer: Automatically created for TLS testing
  • MetalLB support: Enables LoadBalancer services in Kind cluster

Kuadrant Operator Configuration

  • Environment variable patching: New patch-kuadrant-operator-env target merges custom env vars with Helm defaults
  • Service timeout optimization: Default timeouts set to 1000ms for faster test execution
    • AUTH_SERVICE_TIMEOUT=1000ms
    • RATELIMIT_SERVICE_TIMEOUT=1000ms
    • RATELIMIT_CHECK_SERVICE_TIMEOUT=1000ms
    • RATELIMIT_REPORT_SERVICE_TIMEOUT=1000ms
  • Proper env var merging: Uses jq to merge with existing env vars (preserves OPERATOR_NAMESPACE, RELATED_IMAGE_*, etc.)

Documentation

  • Comprehensive README section for local setup
  • Prerequisites and quick start guide
  • Environment variable documentation
  • Red Hat registry credential instructions
  • AWS credentials configuration for DNS testing

Configuration

All configuration is centralized in make/vars.mk:

# Override any variable
GATEWAYAPI_PROVIDER ?= istio  # or envoygateway
KUADRANT_OPERATOR_VERSION ?= latest
KUADRANT_OPERATOR_ENV_VARS ?= AUTH_SERVICE_TIMEOUT=1000ms,...

# Optional credentials
RH_REGISTRY_USERNAME ?=
RH_REGISTRY_PASSWORD ?=
AWS_ACCESS_KEY_ID ?=
AWS_SECRET_ACCESS_KEY ?=

Usage

# Quick setup with defaults (Istio)
make local-setup

# Use EnvoyGateway instead
GATEWAYAPI_PROVIDER=envoygateway make local-setup

# With credentials for full testing capabilities
RH_REGISTRY_USERNAME=user RH_REGISTRY_PASSWORD=pass make local-setup

# Custom operator image
KUADRANT_OPERATOR_IMAGE=quay.io/user/kuadrant:dev make local-setup

# Cleanup
make local-cleanup

Breaking Changes

None - this is purely additive functionality. Existing workflows are unchanged.

crstrn13 added 8 commits March 9, 2026 18:06
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
@crstrn13 crstrn13 self-assigned this Mar 11, 2026
@crstrn13
Copy link
Contributor Author

closes #859

Signed-off-by: Alexander Cristurean <acristur@redhat.com>
@silvi-t
Copy link
Contributor

silvi-t commented Mar 13, 2026

I think it would be nice to have a gitignored file where we can store the env variables needed for local setup (AWS credentials, RH registry credentials, etc.) so setting up the testing environment is easier and we don't have to export them manually each time.

@silvi-t
Copy link
Contributor

silvi-t commented Mar 13, 2026

I ran into an issue with the kubeconfig setup when running tests against the Kind cluster. The testsuite requires kubeconfig_path in settings.local.yaml, but Kind writes its config to a separate file and the default
~/.kube/config may not contain the Kind context. I had to manually run kind get kubeconfig --name kuadrant-local > /tmp/kind-kubeconfig and point the settings there. It might be worth having make local-setup handle this
automatically. Not sure if this is specific to my setup or if others would hit the same issue.

@crstrn13
Copy link
Contributor Author

@silvi-t kind should add the context to the default kubeconfig, i.e ~/.kube/config. By default, if you don't provide a kubeconfig_path in the config it will use the default location. You might need to change the context after instalaltion to use the local kind one.

Signed-off-by: Alexander Cristurean <acristur@redhat.com>
@crstrn13 crstrn13 requested a review from emmaaroche March 13, 2026 16:34
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Copy link
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future work: Add tracing, Add multicluster kind setup

make clean is not working due to missing crd's, the make clean can be refactored

The .PHONY target is used multiple times, can you check its not overriding itself each time

README.md Outdated
# Optional: Red Hat registry credentials (for testing tools like Keycloak)
# (if not provided, tools won't be deployed but core functionality will work)
export RH_REGISTRY_USERNAME=<your-username>
export RH_REGISTRY_PASSWORD=<your-token>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if Kuadrant/helm-charts-olm#77 merged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

README.md Outdated
Comment on lines +61 to +66
# Optional: AWS credentials for DNS testing
# (if not provided, the secret won't be created and DNS tests will be skipped)
export AWS_ACCESS_KEY_ID=<your-aws-key>
export AWS_SECRET_ACCESS_KEY=<your-aws-secret>
export AWS_REGION=us-east-1
export AWS_BASE_DOMAIN=test.example.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe take additionalManifests.yaml used in helm-olm to create needed secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that one is not actually populated with any secrets. The installation will not fail if these are not available, one could create the secret by himself with the help of the 'additionalManifest' as well. In CI, we can have this vars set in the secrets of the repository.

make/vars.mk Outdated
# Kuadrant Operator environment variables
# Default: Service timeouts for faster test execution
# Override with your own: KUADRANT_OPERATOR_ENV_VARS="LOG_LEVEL=debug,..."
KUADRANT_OPERATOR_ENV_VARS ?= AUTH_SERVICE_TIMEOUT=1000ms,RATELIMIT_SERVICE_TIMEOUT=1000ms,RATELIMIT_CHECK_SERVICE_TIMEOUT=1000ms,RATELIMIT_REPORT_SERVICE_TIMEOUT=1000ms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add the DNS tls values for dnstls tests, and metrics endpints if needed
https://github.com/Kuadrant/helm-charts-olm/blob/main/charts/kuadrant-operators/templates/kuadrant/06-subscription.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.


# Include local environment setup modules
# Load variables first, then all other modules
include ./make/vars.mk
Copy link
Member

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

Copy link
Contributor Author

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.

# 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))
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

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.

make/kuadrant.mk Outdated
Comment on lines +20 to +21
helm install kuadrant-operator kuadrant/kuadrant-operator --create-namespace --namespace $(KUADRANT_NAMESPACE), \
helm install kuadrant-operator kuadrant/kuadrant-operator --version $(KUADRANT_OPERATOR_VERSION) --create-namespace --namespace $(KUADRANT_NAMESPACE))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add --wait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

'metadata:' \
' name: kuadrant-sample' \
' namespace: $(KUADRANT_NAMESPACE)' \
'spec: {}' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will create issue for this

make/kuadrant.mk Outdated
endif

.PHONY: deploy-kuadrant-operator-local
deploy-kuadrant-operator-local: ## Deploy Kuadrant Operator from local build/image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the OLM install, it wont work on Kind, rather remove it and just use kuadrant helm chart

Copy link
Contributor Author

@crstrn13 crstrn13 Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, added component mode.

$(MAKE) create-cluster-issuer
$(MAKE) $(GATEWAYAPI_PROVIDER)-install
$(MAKE) create-test-namespaces
$(MAKE) create-aws-credentials
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be replaced with "apply additionalManifests" to also add other secrets needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworked to do additionalManifests.

make/tools.mk Outdated
helm repo update; \
helm install \
--set=tools.keycloak.keycloakProvider=deployment \
--set=tools.coredns.enable=false \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This disable doesnt need to be here, coredns can be installed in kind

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set to true, instead

Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
Signed-off-by: Alexander Cristurean <acristur@redhat.com>
@crstrn13 crstrn13 requested a review from azgabur March 17, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants