Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*-values.yaml
*-values.yaml
.DS_Store
395 changes: 395 additions & 0 deletions src/digma/embedded-jaeger-proxy-files/index.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/digma/embedded-jaeger-proxy-files/login-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
</head>
<body>
<div id="root"></div>
<!-- Environment variables -->
<script>
window.platform = "Web";
</script>
<script src="./index.js"></script>
</body>
</html>
58 changes: 58 additions & 0 deletions src/digma/embedded-jaeger-proxy-files/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
events { }

http {
upstream jaeger {
server {{ tpl .Values.embeddedJaeger.host . }}:16686;
}
upstream digma {
server {{ tpl .Values.digmaAnalytics.host . }}:5051;
}
port_in_redirect off;
absolute_redirect off;
server {
listen 16686;

location / {
# Call /auth/validate before serving the request
auth_request /auth/validate;
# Catch the cookie from /auth/validate
auth_request_set $auth_cookie $upstream_http_set_cookie;
# Forward the cookie to th client
add_header Set-Cookie $auth_cookie;
# Catch header "X-Auth-Fail-Reason" from /auth/validate
auth_request_set $auth_fail_reason $upstream_http_x_auth_fail_reason;

proxy_pass http://jaeger;
}

error_page 401 = @error401;

location @error401 {
# Forward header "X-Auth-Fail-Reason" to the client as part of the redirect response
add_header X-Auth-Fail-Reason $auth_fail_reason;
return 302 /login-page.html?return_url=$request_uri;
}

location /login-page.html {
root /etc/nginx;
}
location /index.js {
root /etc/nginx;
}

location /auth/validate {
internal;
proxy_pass https://digma/authentication/jaeger/validate-or-refresh;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Digma-Access-Token {{ printf "Token %s" (.Values.digmaAnalytics.accesstoken) | quote }};
}

location /auth/login {
proxy_pass https://digma/authentication/jaeger/login;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Digma-Access-Token {{ printf "Token %s" (.Values.digmaAnalytics.accesstoken) | quote }};
}
}
}
4 changes: 1 addition & 3 deletions src/digma/templates/digma-analytics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,4 @@ spec:
- name: Analytics.Endpoints__Default__Secured
value: {{ .Values.digmaAnalytics.secured | quote }}
- name: CollectorUrl
value: {{ printf " http://%s:5048" (tpl .Values.digmaCollectorApi.host .)}}


value: {{ printf " http://%s:5048" (tpl .Values.digmaCollectorApi.host .)}}
67 changes: 67 additions & 0 deletions src/digma/templates/embedded-jaeger-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{- if .Values.embeddedJaeger.enabled }}

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-embedded-jaeger-proxy-files
data:
nginxConf: |
{{ tpl (.Files.Get "embedded-jaeger-proxy-files/nginx.conf") $ | indent 4 }}

loginPageHtml: |
{{ .Files.Get "embedded-jaeger-proxy-files/login-page.html" | indent 4 }}

indexJs: |
{{ .Files.Get "embedded-jaeger-proxy-files/index.js" | indent 4 }}

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-embedded-jaeger-proxy-deployment
labels:
app: embedded-jaeger-proxy
spec:
replicas: 1
selector:
matchLabels:
app: embedded-jaeger-proxy
template:
metadata:
labels:
app: embedded-jaeger-proxy
spec:
containers:
- name: embedded-jaeger-proxy
image: nginx:1.27
volumeMounts:
- name: files
mountPath: /etc/nginx/nginx.conf
subPath: nginxConf
- name: files
mountPath: /etc/nginx/login-page.html
subPath: loginPageHtml
- name: files
mountPath: /etc/nginx/index.js
subPath: indexJs
volumes:
- name: files
configMap:
name: {{ .Release.Name }}-embedded-jaeger-proxy-files
---

apiVersion: v1
kind: Service
metadata:
name: {{ tpl .Values.embeddedJaeger.proxyHost . }}
spec:
type: ClusterIP
selector:
app: "embedded-jaeger-proxy"
ports:
- name: api
port: 16686
protocol: TCP

{{- end }}
1 change: 1 addition & 0 deletions src/digma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pgadmin:

embeddedJaeger:
host: "{{ .Release.Name }}-embedded-jaeger"
proxyHost: "{{ .Release.Name }}-embedded-jaeger-proxy"
imageTag: "1.61.0"
enabled: true
loadbalancer: true
Expand Down