Skip to content

Commit ecfbf08

Browse files
committed
Kiali with Gevals
Signed-off-by: Alberto Gutierrez <[email protected]>
1 parent 5623684 commit ecfbf08

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
@@ -54,6 +54,7 @@ jobs:
5454
contains(github.event.comment.body, '/run-gevals'))
5555
outputs:
5656
should-run: ${{ steps.check.outputs.should-run }}
57+
kiali-run: ${{ steps.check.outputs.kiali-run }}
5758
pr-number: ${{ steps.check.outputs.pr-number }}
5859
pr-ref: ${{ steps.check.outputs.pr-ref }}
5960
steps:
@@ -78,6 +79,12 @@ jobs:
7879
echo "should-run=true" >> $GITHUB_OUTPUT
7980
echo "pr-ref=${{ github.ref }}" >> $GITHUB_OUTPUT
8081
fi
82+
TASK_FILTER="${{ github.event.inputs.task-filter || '' }}"
83+
if [[ "$TASK_FILTER" =~ kiali ]]; then
84+
echo "kiali-run=true" >> $GITHUB_OUTPUT
85+
else
86+
echo "kiali-run=false" >> $GITHUB_OUTPUT
87+
fi
8188
8289
# Run gevals evaluation with Kind cluster
8390
run-evaluation:
@@ -99,8 +106,14 @@ jobs:
99106
- name: Setup Kind cluster
100107
run: make kind-create-cluster KIND_CLUSTER_NAME=${{ env.KIND_CLUSTER_NAME }}
101108

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

105118
- name: Run gevals evaluation
106119
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)