This guide walks through deploying both the batch-gateway-apiserver and batch-gateway-processor in a Kind(Kubernetes in Docker) cluster for local development and testing.
$ kind create cluster --name batch-gateway-devSwitch context to the Kind cluster and verify the cluster is up:
$ kubectl cluster-info --context kind-batch-gateway-dev
$ kubectl get nodesFrom the repository root, build both images. The Makefile auto-detects Docker or Podman.
$ make image-buildTo force Podman:
$ CONTAINER_TOOL=podman make image-buildThis produces:
ghcr.io/llm-d/batch-gateway-apiserver:0.0.1ghcr.io/llm-d/batch-gateway-processor:0.0.1
To use a different tag:
IMAGE_TAG=dev make image-buildKind runs in Docker/Podman, so load the local images into the cluster.
# load apiserver image
$ kind load docker-image ghcr.io/llm-d/batch-gateway-apiserver:0.0.1 --name batch-gateway-dev
# load processor image
$ kind load docker-image ghcr.io/llm-d/batch-gateway-processor:0.0.1 --name batch-gateway-devIf kind load docker-image does not work with your Podman setup (e.g. no Docker API socket), save images to a tar and load the archive:
# save images to tar
$ podman save -o /tmp/apiserver.tar ghcr.io/llm-d/batch-gateway-apiserver:0.0.1
$ podman save -o /tmp/processor.tar ghcr.io/llm-d/batch-gateway-processor:0.0.1
# load into Kind
$ kind load image-archive /tmp/apiserver.tar --name batch-gateway-dev
$ kind load image-archive /tmp/processor.tar --name batch-gateway-devIf you built with a custom tag (e.g. dev), use that tag in both make image-build and the load commands above.
The chart defaults to apiserver only. To run both apiserver and processor using the images loaded in #3, override the values.
$ helm install batch-gateway ./charts/batch-gateway \
--set apiserver.image.pullPolicy=IfNotPresent \
--set apiserver.image.tag=0.0.1 \
--set processor.enabled=true \
--set processor.image.pullPolicy=IfNotPresent \
--set processor.image.tag=0.0.1 \
--namespace default# Pods
$ kubectl get pods -l app.kubernetes.io/name=batch-gateway-apiserver
$ kubectl get pods -l app.kubernetes.io/name=batch-gateway-processor
# Services
$ kubectl get svc -l app.kubernetes.io/instance=batch-gatewayCheck apiserver health:
# forward traffic from cluster port to your machine port
$ kubectl port-forward svc/batch-gateway-batch-gateway-apiserver 8000:8000
# In another terminal:
$ curl -s http://localhost:8000/healthAfter code changes:
Docker:
# rebuild images
$ make image-build
# load images with docker
$ kind load docker-image ghcr.io/llm-d/batch-gateway-apiserver:0.0.1 --name batch-gateway-dev
$ kind load docker-image ghcr.io/llm-d/batch-gateway-processor:0.0.1 --name batch-gateway-dev
# load images with podman
$ podman save -o /tmp/apiserver.tar ghcr.io/llm-d/batch-gateway-apiserver:0.0.1
$ podman save -o /tmp/processor.tar ghcr.io/llm-d/batch-gateway-processor:0.0.1
$ kind load image-archive /tmp/apiserver.tar --name batch-gateway-dev
$ kind load image-archive /tmp/processor.tar --name batch-gateway-dev
# reload deployment
$ kubectl rollout restart deployment -l app.kubernetes.io/instance=batch-gateway# removes all resources
$ helm uninstall batch-gateway
# deletes the Kind cluster
$ kind delete cluster --name batch-gateway-dev