diff --git a/config/charts/body-based-routing/README.md b/config/charts/body-based-routing/README.md index 4ef0c2010..3c914dce0 100644 --- a/config/charts/body-based-routing/README.md +++ b/config/charts/body-based-routing/README.md @@ -8,13 +8,20 @@ A chart to the body-based routing deployment and service. To install a body-based router named `body-based-router`, you can run the following command: ```txt -$ helm install body-based-router ./config/charts/body-based-routing +$ helm install body-based-router ./config/charts/body-based-routing \ + --set provider.name=[gke|istio] \ + --set inference-gateway.name=inference-gateway ``` +Note that the provider name is needed to ensure provider-specific manifests are also applied. If no provider is specified, then only +the deployment and service are deployed. + To install via the latest published chart in staging (--version v0 indicates latest dev version), you can run the following command: ```txt -$ helm install body-based-router oci://us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/charts/body-based-router --version v0 +$ helm install body-based-router oci://us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/charts/body-based-router \ + --version v0 + --set provider.name=[gke|istio] ``` ## Uninstall @@ -37,12 +44,9 @@ The following table list the configurable parameters of the chart. | `bbr.image.hub` | Registry URL where the image is hosted. | | `bbr.image.tag` | Image tag. | | `bbr.image.pullPolicy` | Image pull policy for the container. Possible values: `Always`, `IfNotPresent`, or `Never`. Defaults to `Always`. | +| `provider.name` | Name of the Inference Gateway implementation being used. Possible values: `istio`, `gke`. Defaults to `none`. | +| `inference-gateway.name` | The name of the Gateway. Defaults to `inference-gateway`. | ## Notes -This chart will only deploy the body-based router deployment and service. -Note that this should only be deployed once per Gateway. - -Additional configuration is needed to configure a proxy extension that calls -out to the service in the request path. For example, vwith Envoy Gateway, this -would require configuring EnvoyExtensionPolicy. +This chart should only be deployed once per Gateway. \ No newline at end of file diff --git a/config/charts/body-based-routing/templates/gke.yaml b/config/charts/body-based-routing/templates/gke.yaml new file mode 100644 index 000000000..db661bcfd --- /dev/null +++ b/config/charts/body-based-routing/templates/gke.yaml @@ -0,0 +1,49 @@ +{{- if eq .Values.provider.name "gke" }} +--- +kind: GCPRoutingExtension +apiVersion: networking.gke.io/v1 +metadata: + name: {{ .Values.bbr.name }} + namespace: {{ .Release.Namespace }} +spec: + targetRefs: + - group: "gateway.networking.k8s.io" + kind: Gateway + name: {{ .Values.inference-gateway.name }} + extensionChains: + - name: chain1 + extensions: + - name: ext1 + authority: "myext.com" + timeout: 1s + supportedEvents: + - RequestHeaders + - RequestBody + - RequestTrailers + requestBodySendMode: "FullDuplexStreamed" + backendRef: + group: "" + kind: Service + name: {{ .Values.bbr.name }} + port: 9004 +--- +apiVersion: networking.gke.io/v1 +kind: HealthCheckPolicy +metadata: + name: bbr-healthcheck + namespace: {{ .Release.Namespace }} +spec: + default: + logConfig: + enabled: true + config: + type: "GRPC" + grpcHealthCheck: + portSpecification: "USE_FIXED_PORT" + port: 9005 + targetRef: + group: "" + kind: Service + name: {{ .Values.bbr.name }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/config/charts/body-based-routing/templates/istio.yaml b/config/charts/body-based-routing/templates/istio.yaml new file mode 100644 index 000000000..0f9f5f117 --- /dev/null +++ b/config/charts/body-based-routing/templates/istio.yaml @@ -0,0 +1,47 @@ +{{- if eq .Values.provider.name "istio" }} +--- +apiVersion: networking.istio.io/v1alpha3 +kind: EnvoyFilter +metadata: + name: {{ .Values.bbr.name }} + namespace: {{ .Release.Namespace }} +spec: + configPatches: + - applyTo: HTTP_FILTER + match: + # context omitted so that this applies to both sidecars and gateways + listener: + filterChain: + filter: + name: "envoy.filters.network.http_connection_manager" + patch: + operation: INSERT_FIRST + value: + name: envoy.filters.http.ext_proc + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor + failure_mode_allow: false + allow_mode_override: true + processing_mode: + request_header_mode: "SEND" + response_header_mode: "SKIP" + request_body_mode: "BUFFERED" + response_body_mode: "NONE" + request_trailer_mode: "SKIP" + response_trailer_mode: "SKIP" + grpc_service: + envoy_grpc: + cluster_name: outbound|9004||{{ .Values.bbr.name }}.default.svc.cluster.local +--- +apiVersion: networking.istio.io/v1 +kind: DestinationRule +metadata: + name: {{ .Values.bbr.name }} + namespace: {{ .Release.Namespace }} +spec: + host: {{ .Values.bbr.name }}.default.svc.cluster.local + trafficPolicy: + tls: + mode: SIMPLE + insecureSkipVerify: true +{{- end }} diff --git a/config/charts/body-based-routing/values.yaml b/config/charts/body-based-routing/values.yaml index b60f5d69f..debd5f9e2 100644 --- a/config/charts/body-based-routing/values.yaml +++ b/config/charts/body-based-routing/values.yaml @@ -7,3 +7,9 @@ bbr: tag: main pullPolicy: Always extProcPort: 9002 + +provider: + name: none + +inference-gateway: + name: inference-gateway