Skip to content

Commit 4b52f1e

Browse files
committed
Kiali with Gevals
Signed-off-by: Alberto Gutierrez <[email protected]>
1 parent 3a03479 commit 4b52f1e

File tree

6 files changed

+1416
-1
lines changed

6 files changed

+1416
-1
lines changed

.github/workflows/gevals.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
contains(github.event.comment.body, '/run-gevals'))
5454
outputs:
5555
should-run: ${{ steps.check.outputs.should-run }}
56+
kiali-run: ${{ steps.check.outputs.kiali-run }}
5657
pr-number: ${{ steps.check.outputs.pr-number }}
5758
pr-ref: ${{ steps.check.outputs.pr-ref }}
5859
steps:
@@ -77,6 +78,12 @@ jobs:
7778
echo "should-run=true" >> $GITHUB_OUTPUT
7879
echo "pr-ref=${{ github.ref }}" >> $GITHUB_OUTPUT
7980
fi
81+
TASK_FILTER="${{ github.event.inputs.task-filter || '' }}"
82+
if [[ "$TASK_FILTER" =~ kiali ]]; then
83+
echo "kiali-run=true" >> $GITHUB_OUTPUT
84+
else
85+
echo "kiali-run=false" >> $GITHUB_OUTPUT
86+
fi
8087
8188
# Run gevals evaluation with Kind cluster
8289
run-evaluation:
@@ -98,8 +105,14 @@ jobs:
98105
- name: Setup Kind cluster
99106
run: make kind-create-cluster KIND_CLUSTER_NAME=${{ env.KIND_CLUSTER_NAME }}
100107

108+
- name: Install Istio/Kiali and bookinfo demo
109+
if: needs.check-trigger.outputs.kiali-run == 'true'
110+
run: make setup-kiali
111+
101112
- name: Start MCP server
102113
run: make run-server
114+
env:
115+
TOOLSETS: ${{ needs.check-trigger.outputs.kiali-run == 'true' && 'kiali' || '' }}
103116

104117
- name: Run gevals evaluation
105118
id: gevals

build/gevals.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ MCP_HEALTH_INTERVAL ?= 2
77
.PHONY: run-server
88
run-server: build ## Start MCP server in background and wait for health check
99
@echo "Starting MCP server on port $(MCP_PORT)..."
10-
@./$(BINARY_NAME) --port $(MCP_PORT) & echo $$! > .mcp-server.pid
10+
@if [ -n "$(TOOLSETS)" ]; then \
11+
./$(BINARY_NAME) --port $(MCP_PORT) --toolsets $(TOOLSETS) & echo $$! > .mcp-server.pid; \
12+
else \
13+
./$(BINARY_NAME) --port $(MCP_PORT) & echo $$! > .mcp-server.pid; \
14+
fi
1115
@echo "MCP server started with PID $$(cat .mcp-server.pid)"
1216
@echo "Waiting for MCP server to be ready..."
1317
@elapsed=0; \

build/kiali.mk

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Kind cluster management
2+
3+
KIND_CLUSTER_NAME ?= kubernetes-mcp-server
4+
5+
# Detect container engine (docker or podman)
6+
CONTAINER_ENGINE ?= $(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)
7+
8+
##@ Istio
9+
10+
ISTIOCTL = _output/bin/istioctl
11+
12+
$(ISTIOCTL):
13+
@mkdir -p _output/bin
14+
@echo "Downloading istioctl..."
15+
@set -e; \
16+
TMPDIR=$$(mktemp -d); \
17+
cd $$TMPDIR; \
18+
curl -sL https://istio.io/downloadIstio | sh -; \
19+
ISTIODIR=$$(ls -d istio-* | head -n1); \
20+
cp $$ISTIODIR/bin/istioctl $(PWD)/$(ISTIOCTL); \
21+
cd - >/dev/null; \
22+
rm -rf $$TMPDIR; \
23+
echo "istioctl installed at $(ISTIOCTL)"
24+
25+
.PHONY: istioctl
26+
istioctl: $(ISTIOCTL) ## Ensure istioctl is installed to _output/bin/
27+
28+
.PHONY: install-istio
29+
install-istio: istioctl ## Install Istio (demo profile) and enable sidecar injection in default ns
30+
./$(ISTIOCTL) install --set profile=demo -y
31+
kubectl label namespace default istio-injection=enabled --overwrite
32+
33+
.PHONY: install-istio-addons
34+
install-istio-addons: install-istio ## Install Istio addons
35+
kubectl apply -f dev/config/istio/prometheus.yaml -n istio-system
36+
kubectl apply -f dev/config/istio/kiali.yaml -n istio-system
37+
kubectl wait --namespace istio-system --for=condition=available deployment/kiali --timeout=300s
38+
kubectl wait --namespace istio-system --for=condition=available deployment/prometheus --timeout=300s
39+
40+
.PHONY: install-bookinfo-demo
41+
install-bookinfo-demo: ## Install Bookinfo demo
42+
kubectl create ns bookinfo
43+
kubectl label namespace bookinfo istio-discovery=enabled istio.io/rev=default istio-injection=enabled
44+
kubectl apply -f dev/config/istio/bookinfo.yaml -n bookinfo
45+
kubectl wait --for=condition=Ready pod --all -n bookinfo --timeout=300s
46+
47+
.PHONY: setup-kiali
48+
setup-kiali: install-istio-addons install-bookinfo-demo ## Setup Kiali

0 commit comments

Comments
 (0)