Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 32176e6

Browse files
authored
Merge pull request #50 from shaneutt/kgateway-deployment
Add Kubernetes dev environment deployments with KGateway
2 parents 8eb8707 + 7275019 commit 32176e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+485
-71
lines changed

Makefile

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,11 @@ clean.environment.dev.kind:
721721
environment.dev.kubernetes.infrastructure:
722722
ifeq ($(strip $(INFRASTRUCTURE_OVERRIDE)),true)
723723
@echo "Deploying OpenShift Infrastructure Components"
724-
kustomize build deploy/environments/dev/kubernetes-infra | kubectl apply --server-side --force-conflicts -f -
724+
kustomize build deploy/components/crds-gateway-api | kubectl apply --server-side --force-conflicts -f -
725+
kustomize build deploy/components/crds-gie | kubectl apply --server-side --force-conflicts -f -
726+
kustomize build --enable-helm deploy/components/crds-kgateway | kubectl apply --server-side --force-conflicts -f -
727+
kustomize build --enable-helm deploy/environments/dev/kubernetes-kgateway-infra | kubectl apply --server-side --force-conflicts -f -
728+
kubectl -n kgateway-system wait deployment/kgateway --for=condition=Available --timeout=60s
725729
else
726730
$(error "Error: The environment variable INFRASTRUCTURE_OVERRIDE must be set to true in order to run this target.")
727731
endif
@@ -743,7 +747,10 @@ ifeq ($(strip $(INFRASTRUCTURE_OVERRIDE)),true)
743747
@echo "This is extremely destructive. We'll provide 5 seconds before starting to give you a chance to cancel."
744748
sleep 5
745749
@echo "Tearing Down OpenShift Infrastructure Components"
746-
kustomize build deploy/environments/dev/kubernetes-infra | kubectl delete -f - || true
750+
kustomize build --enable-helm deploy/environments/dev/kubernetes-kgateway-infra | kubectl delete -f - || true
751+
kustomize build --enable-helm deploy/components/crds-kgateway | kubectl delete -f - || true
752+
kustomize build deploy/components/crds-gie | kubectl delete -f - || true
753+
kustomize build deploy/components/crds-gateway-api | kubectl delete -f - || true
747754
else
748755
$(error "Error: The environment variable INFRASTRUCTURE_OVERRIDE must be set to true in order to run this target.")
749756
endif
@@ -754,33 +761,9 @@ endif
754761
# This target deploys the GIE stack in a specific namespace for development and
755762
# testing.
756763
# ------------------------------------------------------------------------------
757-
VLLM_SIM_IMAGE ?= quay.io/vllm-d/vllm-sim
758-
VLLM_SIM_TAG ?= 0.0.2
759-
EPP_IMAGE ?= us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp
760-
EPP_TAG ?= main
761764
.PHONY: environment.dev.kubernetes
762765
environment.dev.kubernetes: check-kubectl check-kustomize check-envsubst
763-
@echo "INFO: checking required vars"
764-
ifndef NAMESPACE
765-
$(error "Error: NAMESPACE is required but not set")
766-
endif
767-
export NAMESPACE=$(NAMESPACE)
768-
ifndef REGISTRY_SECRET
769-
$(error "Error: REGISTRY_SECRET is required but not set")
770-
endif
771-
export REGISTRY_SECRET=$(REGISTRY_SECRET)
772-
export VLLM_SIM_IMAGE=$(VLLM_SIM_IMAGE)
773-
export VLLM_SIM_TAG=$(VLLM_SIM_TAG)
774-
export EPP_IMAGE=$(EPP_IMAGE)
775-
export EPP_TAG=$(EPP_TAG)
776-
@echo "INFO: Creating namespace (if needed) and setting context to $(NAMESPACE)..."
777-
kubectl create namespace $(NAMESPACE) 2>/dev/null || true
778-
@echo "INFO: Deploying Development Environment in namespace $(NAMESPACE)"
779-
kustomize build deploy/environments/dev/kubernetes | envsubst | kubectl -n $(NAMESPACE) apply -f -
780-
@echo "INFO: Waiting for Pods in namespace $(NAMESPACE) to become ready"
781-
kubectl -n $(NAMESPACE) wait --for=condition=Ready --all pods --timeout=300s
782-
@echo "INFO: Waiting for Gateway in namespace $(NAMESPACE) to become ready"
783-
kubectl -n $(NAMESPACE) wait gateway/inference-gateway --for=condition=Programmed --timeout=60s
766+
./scripts/kubernetes-dev-env.sh 2>&1
784767
@echo "INFO: Development environment deployed to namespace $(NAMESPACE)"
785768

786769
# ------------------------------------------------------------------------------
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# ------------------------------------------------------------------------------
2-
# Custom Resource Definitions (CRDs)
3-
#
4-
# This deploys the CRDs needed for development environments (e.g. Gateway API).
2+
# Custom Resource Definitions (CRDs) for Gateway API
53
#
64
# **Warning**: CRDs are cluster-level, so in a shared development environment
75
# this needs to be done in a controlled and communicated manner.
@@ -10,10 +8,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
108
kind: Kustomization
119

1210
resources:
13-
# Gateway API CRDs
1411
- https://github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.2.1
15-
# Gateway API Inference Extension (GIE) CRDs
16-
# NOTE: deploys whatever is in the current branch
17-
- ../../../config/crd # GIE CRDs
18-
# Istio CRDs
19-
- istio.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ------------------------------------------------------------------------------
2+
# Custom Resource Definitions (CRDs) for Gateway API Inference Extension (GIE)
3+
#
4+
# This deploys the GIE CRDs from the local directory.
5+
#
6+
# **Warning**: CRDs are cluster-level, so in a shared development environment
7+
# this needs to be done in a controlled and communicated manner.
8+
# ------------------------------------------------------------------------------
9+
apiVersion: kustomize.config.k8s.io/v1beta1
10+
kind: Kustomization
11+
12+
resources:
13+
- ../../../config/crd
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ------------------------------------------------------------------------------
2+
# Custom Resource Definitions (CRDs) for Istio
3+
#
4+
# **Warning**: CRDs are cluster-level, so in a shared development environment
5+
# this needs to be done in a controlled and communicated manner.
6+
# ------------------------------------------------------------------------------
7+
apiVersion: kustomize.config.k8s.io/v1beta1
8+
kind: Kustomization
9+
10+
resources:
11+
- istio.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
charts/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ------------------------------------------------------------------------------
2+
# Custom Resource Definitions (CRDs) for KGateway
3+
#
4+
# **Warning**: CRDs are cluster-level, so in a shared development environment
5+
# this needs to be done in a controlled and communicated manner.
6+
# ------------------------------------------------------------------------------
7+
apiVersion: kustomize.config.k8s.io/v1beta1
8+
kind: Kustomization
9+
10+
resources:
11+
- namespaces.yaml
12+
13+
helmCharts:
14+
- name: kgateway-crds
15+
repo: oci://cr.kgateway.dev/kgateway-dev/charts
16+
version: v2.0.0
17+
releaseName: kgateway-crds
18+
namespace: kgateway-system
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: kgateway-system

deploy/components/inference-gateway/deployments.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ spec:
2121
image: quay.io/vllm-d/gateway-api-inference-extension/epp:latest
2222
imagePullPolicy: IfNotPresent
2323
args:
24-
- -refreshMetricsInterval
25-
- "500ms"
2624
- -poolName
2725
- "vllm-llama3-8b-instruct"
2826
- -v

deploy/components/inference-gateway/gateways.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ apiVersion: gateway.networking.k8s.io/v1
22
kind: Gateway
33
metadata:
44
name: inference-gateway
5-
labels:
6-
istio.io/enable-inference-extproc: "true"
7-
annotations:
8-
networking.istio.io/service-type: ClusterIP
95
spec:
10-
gatewayClassName: istio
116
listeners:
127
- name: default
138
port: 80

0 commit comments

Comments
 (0)