Skip to content

Commit

Permalink
Fix gateway bootstrap issues (#154)
Browse files Browse the repository at this point in the history
Fix delete model issue

Co-authored-by: varungupta <varungupta@BYTEDANCE.COM>
  • Loading branch information
varungup90 and varungupta authored Sep 10, 2024
1 parent a8e69d8 commit ddd2081
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 28 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,13 @@ endif
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
## helm creates objects without aibrix prefix, hence deploying gateway components outside of kustomization
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.1.0 -n aibrix-system
$(KUBECTL) wait --timeout=5m -n aibrix-system deployment/envoy-gateway --for=condition=Available
$(KUBECTL) apply -f config/gateway/gateway.yaml
$(KUBECTL) create -k config/dependency


.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.
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
$(KUBECTL) delete -f config/gateway/gateway.yaml
helm uninstall eg -n aibrix-system
$(KUBECTL) delete -k config/dependency

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
Expand Down
15 changes: 15 additions & 0 deletions config/dependency/envoy_config_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-gateway-config
namespace: envoy-gateway-system
data:
envoy-gateway.yaml: |
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
provider:
type: Kubernetes
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
extensionApis:
enableEnvoyPatchPolicy: true
5 changes: 5 additions & 0 deletions config/dependency/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
kind: Kustomization

resources:
- https://github.com/envoyproxy/gateway/releases/download/v1.1.0/install.yaml

patches:
- path: envoy_config_patch.yaml
# potential kuberay ray cluster manifest here.
20 changes: 2 additions & 18 deletions config/gateway/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,7 @@ spec:
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-gateway-config
namespace: aibrix-system
data:
envoy-gateway.yaml: |
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
provider:
type: Kubernetes
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
extensionApis:
enableEnvoyPatchPolicy: true
port: 80
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyExtensionPolicy
Expand Down Expand Up @@ -83,7 +67,7 @@ spec:
cluster: original_destination_cluster
timeout: 1000s # Increase route timeout
typed_per_filter_config:
"envoy.filters.http.ext_proc/envoyextensionpolicy/aibrix-system/gateway-plugins-extension-policy/extproc/0":
"envoy.filters.http.ext_proc/envoyextensionpolicy/aibrix-system/aibrix-gateway-plugins-extension-policy/extproc/0":
"@type": "type.googleapis.com/envoy.config.route.v3.FilterConfig"
"config": {}
- type: "type.googleapis.com/envoy.config.cluster.v3.Cluster"
Expand Down
5 changes: 3 additions & 2 deletions config/gateway/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resources:
- gateway-plugin.yaml
- redis.yaml
- gateway.yaml
- redis.yaml
- gateway-plugin.yaml

4 changes: 2 additions & 2 deletions docs/development/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ helm get all eg -n envoy-gateway-system

Port forward to the Envoy service:
```shell
kubectl -n aibrix-system port-forward service/envoy-aibrix-system-eg-95d1b654 8888:80 &
kubectl -n envoy-gateway-system port-forward service/envoy-aibrix-system-aibrix-eg-903790dc 8888:80 &
```

# Add rpm/tpm config
```shell
kubectl -n aibrix-system exec -it aibrix-redis-master-<pod-name> -- redis-cli
kubectl -n aibrix-system exec -it aibrix-redis-master-767bcb955d-qrlfc -- redis-cli

set aibrix:your-user-name_TPM_LIMIT 100
set aibrix:your-user-name_RPM_LIMIT 10
Expand Down
3 changes: 2 additions & 1 deletion docs/development/app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ spec:
# kind: HTTPRoute
# metadata:
# name: llama2-70b-router
# namespace: aibrix-system
# spec:
# parentRefs:
# - name: eg
# - name: aibrix-eg
# rules:
# - matches:
# - headers:
Expand Down

0 comments on commit ddd2081

Please sign in to comment.