Skip to content

Commit 5be9c27

Browse files
committed
fix tools k8s
Signed-off-by: Dmytro Rashko <dmitriy.rashko@amdocs.com>
1 parent ce0eeb4 commit 5be9c27

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

DEVELOPMENT.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -286,24 +286,8 @@ make bin/kagent-tools-linux-amd64
286286
# Build Docker image
287287
make docker-build
288288

289-
# Build with specific version
290-
VERSION=v1.0.0 make docker-build
291-
292289
# Run in Docker
293-
docker run --rm kagent-tools:latest
294-
```
295-
296-
### Release Process
297-
298-
```bash
299-
# Tag version
300-
git tag v1.0.0
301-
302-
# Build release artifacts
303-
make release
304-
305-
# Push Docker image
306-
make docker-push
290+
make run
307291
```
308292

309293
## Environment Configuration

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DOCKER_REGISTRY ?= ghcr.io
22
BASE_IMAGE_REGISTRY ?= cgr.dev
33
DOCKER_REPO ?= kagent-dev/kagent
4+
KIND_CLUSTER_NAME ?= kagent
45

56
BUILD_DATE := $(shell date -u '+%Y-%m-%d')
67
GIT_COMMIT := $(shell git rev-parse --short HEAD || echo "unknown")
@@ -81,6 +82,18 @@ build:
8182
@echo "Build complete. Binaries are available in the bin/ directory."
8283
ls -lt bin/kagent-tools-*
8384

85+
.PHONY: run
86+
run: docker-build
87+
@echo "Running tool server on http://localhost:8084/mcp ..."
88+
@echo "Use: npx @modelcontextprotocol/inspector to connect to the tool server"
89+
@docker run --rm -p 8084:8084 -e KAGENT_TOOLS_PORT=8084 $(TOOLS_IMG)
90+
91+
PHONY: retag
92+
retag: docker-build
93+
@echo "Retagging tools image to $(RETAGGED_TOOLS_IMG)"
94+
docker tag $(TOOLS_IMG) $(RETAGGED_TOOLS_IMG)
95+
kind load docker-image --name $(KIND_CLUSTER_NAME) $(RETAGGED_TOOLS_IMG)
96+
8497
TOOLS_IMAGE_NAME ?= tools
8598
TOOLS_IMAGE_TAG ?= $(VERSION)
8699
TOOLS_IMG ?= $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(TOOLS_IMAGE_NAME):$(TOOLS_IMAGE_TAG)

pkg/k8s/k8s.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,6 @@ func RegisterK8sTools(s *server.MCPServer) {
568568
// Log the error and proceed without native tool implementations
569569
logger.Get().Info("Failed to initialize Kubernetes client, falling back to kubectl commands",
570570
"level", "warn", "error", err.Error())
571-
// Here you could register the pure-kubectl versions of the tools as a fallback
572-
return
573571
}
574572
s.AddTool(mcp.NewTool("k8s_get_resources",
575573
mcp.WithDescription("Get Kubernetes resources using kubectl with enhanced native client support"),

0 commit comments

Comments
 (0)