Skip to content

Commit 9d91319

Browse files
Feat/observability (#36)
* (chore): added otel tracing to envoy proxy config * (chore): added otel tracing to envoy proxy config * (chore): fixed configuration to adhere to yaml spec * (chore): changed exporter endpoint to phoenix * (chore): changed exporter endpoint to phoenix v2 * (chore): changed exporter endpoint to phoenix v3 * chore(): added proper phoenix authentication to envoy * chore(): patched gateway to allow routes from all namespaces * chore(): changed api key * chore(): changed api key v2 * chore(): changed api key v3 * chore(): changed api key v4 * chore(): http redirect fix v1 * chore(): http redirect fix v2 * chore(): http redirect fix v3 * chore(): http redirect fix v4 * chore(): http redirect fix v5 * chore(): http redirect fix v6
1 parent aa126f0 commit 9d91319

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if and .Values.tls.enabled .Values.tls.redirectToHttps }}
2+
apiVersion: gateway.envoyproxy.io/v1alpha1
3+
kind: EnvoyPatchPolicy
4+
metadata:
5+
name: {{ .Release.Name }}-redirect-308
6+
namespace: {{ .Values.namespace | default .Release.Namespace }}
7+
spec:
8+
targetRef:
9+
group: gateway.networking.k8s.io
10+
kind: Gateway
11+
name: {{ .Values.gateway.name }}
12+
type: JSONPatch
13+
jsonPatches:
14+
- type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
15+
name: "{{ .Values.namespace | default .Release.Namespace }}/{{ .Values.gateway.name }}/http"
16+
operation:
17+
# Patching indices 1 and 2 which correspond to our actual domains
18+
# Index 0 is a wildcard host that doesn't have a redirect
19+
op: add
20+
path: /virtual_hosts/1/routes/0/redirect/response_code
21+
value: "PERMANENT_REDIRECT"
22+
- type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
23+
name: "{{ .Values.namespace | default .Release.Namespace }}/{{ .Values.gateway.name }}/http"
24+
operation:
25+
op: add
26+
path: /virtual_hosts/2/routes/0/redirect/response_code
27+
value: "PERMANENT_REDIRECT"
28+
{{- end }}

charts/ai-gateway-core/templates/httproute-http-to-https.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ spec:
2222
- type: RequestRedirect
2323
requestRedirect:
2424
scheme: https
25-
statusCode: 301
25+
statusCode: {{ .Values.tls.redirectStatusCode | default 301 }}
2626
{{- end }}

charts/ai-gateway-core/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ tls:
1717
environment: staging # staging | prod
1818

1919
redirectToHttps: true
20+
redirectStatusCode: 301 # 301 (Found), 302 (Temporary), 308 (Permanent - preserves method)
2021

2122
gatewayClass:
2223
enabled: true
@@ -66,7 +67,7 @@ gatewayConfig:
6667
- name: OTEL_METRICS_EXPORTER
6768
value: "none"
6869
- name: OTEL_EXPORTER_OTLP_HEADERS
69-
value: 'Authorization=Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJBcGlLZXk6MTAifQ.ybHjFKHaFewQQ9PfBIe8vfeaOr89TFYxP6LJvaNTNxg'
70+
value: "Authorization=Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJBcGlLZXk6MTQifQ.a26PKaWL5J-xiJwFM8spE2bXR4V8auqAyWDOCTr04Z4"
7071

7172
envoyProxy:
7273
enabled: true
@@ -119,4 +120,4 @@ clientTrafficPolicy:
119120
tls: {}
120121
path: {}
121122
headers: {}
122-
healthCheck: {}
123+
healthCheck: {}

0 commit comments

Comments
 (0)