-
-
Notifications
You must be signed in to change notification settings - Fork 44
Add envoy ai gateway #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add envoy ai gateway #353
Changes from all commits
bbb79c0
c56150a
126e74c
8e60d69
775fccb
1fcbcff
6e969f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ ginkgo: ## Download ginkgo locally if necessary. | |
|
|
||
| INTEGRATION_TARGET ?= ./test/integration/... | ||
|
|
||
| BASE_IMAGE ?= gcr.io/distroless/static:nonroot | ||
| BASE_IMAGE ?= m.daocloud.io/gcr.io/distroless/static:nonroot | ||
| DOCKER_BUILDX_CMD ?= docker buildx | ||
| IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build | ||
| IMAGE_BUILD_EXTRA_OPTS ?= | ||
|
|
@@ -67,8 +67,11 @@ IMAGE_NAME ?= llmaz | |
| IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME) | ||
| GIT_TAG ?= $(shell git describe --tags --dirty --always) | ||
| GOPROXY=${GOPROXY:-""} | ||
| ifeq ($(origin GOPROXY), undefined) | ||
| unexport GOPROXY | ||
| endif | ||
| IMG ?= $(IMAGE_REPO):$(GIT_TAG) | ||
| BUILDER_IMAGE ?= golang:$(GO_VERSION) | ||
| BUILDER_IMAGE ?= m.daocloud.io/docker.io/library/golang:$(GO_VERSION) | ||
| KIND_CLUSTER_NAME ?= kind | ||
| CGO_ENABLED ?= 0 | ||
|
|
||
|
|
@@ -177,7 +180,6 @@ run: manifests generate fmt vet ## Run a controller from your host. | |
| PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le | ||
| .PHONY: docker-buildx | ||
| docker-buildx: ## Build and push docker image for the manager for cross-platform support | ||
| [ -n "$(GOPROXY)" ] && export GOPROXY=$(GOPROXY) | ||
| # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile | ||
| sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross | ||
| - $(CONTAINER_TOOL) buildx create --name project-v3-builder | ||
|
|
@@ -226,7 +228,7 @@ endif | |
|
|
||
| .PHONY: install | ||
| install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. | ||
| $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f - | ||
| $(KUSTOMIZE) build config/crd | $(KUBECTL) apply --server-side --force-conflicts -f - | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will --force-conflicts cause other problems? Should be careful here, prefer to keep the server-side only. |
||
|
|
||
| .PHONY: uninstall | ||
| uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| {{- if .Values.envoyAIGateway.enabled -}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not include these files in the helm chart I think, let's make them an example instead. Because most of them should be user-defined. |
||
| # source : https://github.com/envoyproxy/ai-gateway/blob/main/examples/basic/basic.yaml | ||
|
|
||
| # Copyright Envoy AI Gateway Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # The full text of the Apache license is available in the LICENSE file at | ||
| # the root of the repo. | ||
|
|
||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: GatewayClass | ||
| metadata: | ||
| name: envoy-ai-gateway-basic | ||
| spec: | ||
| controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
| --- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: envoy-ai-gateway-basic | ||
| namespace: default | ||
| spec: | ||
| gatewayClassName: envoy-ai-gateway-basic | ||
| listeners: | ||
| - name: http | ||
| protocol: HTTP | ||
| port: 80 | ||
| --- | ||
| apiVersion: aigateway.envoyproxy.io/v1alpha1 | ||
| kind: AIGatewayRoute | ||
| metadata: | ||
| name: envoy-ai-gateway-basic | ||
| namespace: default | ||
| spec: | ||
| schema: | ||
| name: OpenAI | ||
| targetRefs: | ||
| - name: envoy-ai-gateway-basic | ||
| kind: Gateway | ||
| group: gateway.networking.k8s.io | ||
| rules: | ||
| # - matches: | ||
| # - headers: | ||
| # - type: Exact | ||
| # name: x-ai-eg-model | ||
| # value: some-cool-self-hosted-model | ||
| # backendRefs: | ||
| # - name: envoy-ai-gateway-basic-testupstream | ||
| # Below is a testupstream service that can be used to test the AI Gateway | ||
| # --- | ||
| # apiVersion: aigateway.envoyproxy.io/v1alpha1 | ||
| # kind: AIServiceBackend | ||
| # metadata: | ||
| # name: envoy-ai-gateway-basic-testupstream | ||
| # namespace: default | ||
| # spec: | ||
| # schema: | ||
| # name: OpenAI | ||
| # backendRef: | ||
| # name: envoy-ai-gateway-basic-testupstream | ||
| # kind: Service | ||
| # port: 80 | ||
| # --- | ||
| # apiVersion: apps/v1 | ||
| # kind: Deployment | ||
| # metadata: | ||
| # name: envoy-ai-gateway-basic-testupstream | ||
| # namespace: default | ||
| # spec: | ||
| # replicas: 1 | ||
| # selector: | ||
| # matchLabels: | ||
| # app: envoy-ai-gateway-basic-testupstream | ||
| # template: | ||
| # metadata: | ||
| # labels: | ||
| # app: envoy-ai-gateway-basic-testupstream | ||
| # spec: | ||
| # containers: | ||
| # - name: testupstream | ||
| # image: docker.io/envoyproxy/ai-gateway-testupstream:latest | ||
| # imagePullPolicy: IfNotPresent | ||
| # ports: | ||
| # - containerPort: 8080 | ||
| # env: | ||
| # - name: TESTUPSTREAM_ID | ||
| # value: test | ||
| # readinessProbe: | ||
| # httpGet: | ||
| # path: /health | ||
| # port: 8080 | ||
| # initialDelaySeconds: 1 | ||
| # periodSeconds: 1 | ||
| # --- | ||
| # apiVersion: v1 | ||
| # kind: Service | ||
| # metadata: | ||
| # name: envoy-ai-gateway-basic-testupstream | ||
| # namespace: default | ||
| # spec: | ||
| # selector: | ||
| # app: envoy-ai-gateway-basic-testupstream | ||
| # ports: | ||
| # - protocol: TCP | ||
| # port: 80 | ||
| # targetPort: 8080 | ||
| # type: ClusterIP | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| {{- if .Values.envoyGateway.enabled -}} | ||
| # source: https://github.com/envoyproxy/gateway/blob/main/examples/kubernetes/quickstart.yaml | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: GatewayClass | ||
| metadata: | ||
| name: eg | ||
| spec: | ||
| controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
| --- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: eg | ||
| spec: | ||
| gatewayClassName: eg | ||
| listeners: | ||
| - name: http | ||
| protocol: HTTP | ||
| port: 80 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: backend | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: backend | ||
| labels: | ||
| app: backend | ||
| service: backend | ||
| spec: | ||
| ports: | ||
| - name: http | ||
| port: 3000 | ||
| targetPort: 3000 | ||
| selector: | ||
| app: backend | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: backend | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: backend | ||
| version: v1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: backend | ||
| version: v1 | ||
| spec: | ||
| serviceAccountName: backend | ||
| containers: | ||
| - image: {{ .Values.envoyGateway.image.repository }}:{{ .Values.envoyGateway.image.tag }} | ||
| imagePullPolicy: IfNotPresent | ||
| name: backend | ||
| ports: | ||
| - containerPort: 3000 | ||
| env: | ||
| - name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| --- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: backend | ||
| spec: | ||
| parentRefs: | ||
| - name: eg | ||
| hostnames: | ||
| - "www.example.com" | ||
| rules: | ||
| - backendRefs: | ||
| - group: "" | ||
| kind: Service | ||
| name: backend | ||
| port: 3000 | ||
| weight: 1 | ||
| matches: | ||
| - path: | ||
| type: PathPrefix | ||
| value: / | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please submit with another PR. It's irrelevant.