Skip to content

Commit 948da92

Browse files
author
ci bot
committed
Merge branch 'parametrize-ui' into 'enterprise'
misc: Parametrizing the UI deploy configuration See merge request dkinternal/observability/dataops-observability!56
2 parents 9e3c456 + bb31ce0 commit 948da92

7 files changed

Lines changed: 30 additions & 60 deletions

File tree

deploy/charts/observability-app/templates/observability-ui.yaml

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ spec:
3030
serviceAccountName: {{ include "observability.serviceAccountName" . }}
3131
securityContext:
3232
{{- toYaml .Values.observability_ui.podSecurityContext | nindent 8 }}
33-
{{- if or .Values.observability_ui.environmentJson .Values.observability_ui.manifestJson }}
34-
volumes:
35-
- name: {{ include "observability.observability_ui.name" . }}-configmap-volume
36-
configMap:
37-
name: {{ include "observability.observability_ui.name" . }}-configmap
38-
items:
39-
{{- if .Values.observability_ui.environmentJson }}
40-
- key: "environment.json"
41-
path: "environment.json"
42-
{{- end }}
43-
{{- if .Values.observability_ui.manifestJson }}
44-
- key: "module-federation.manifest.json"
45-
path: "module-federation.manifest.json"
46-
{{- end }}
47-
{{- end }}
4833
containers:
4934
- name: {{ include "observability.observability_ui.name" . }}
5035
securityContext:
@@ -58,31 +43,21 @@ spec:
5843
resources:
5944
{{- toYaml .Values.observability_ui.resources | nindent 12 }}
6045
env:
61-
{{- if .Values.observability_api.hostname }}
46+
- name: OBSERVABILITY_API_BASE_URL
47+
value: {{ .Values.observability_ui.api_base_url | quote }}
48+
- name: OBSERVABILITY_AUTH_METHOD
49+
value: {{ .Values.observability_ui.auth_method | quote }}
50+
{{- if .Values.observability_ui.hostname }}
6251
- name: OBSERVABILITY_API_HOSTNAME
6352
value: {{ tpl .Values.observability_api.hostname . | quote }}
6453
{{- end }}
6554
{{- if not (quote .Values.observability_ui.csp_extra | empty) }}
6655
- name: OBSERVABILITY_CSP_EXTRA
6756
value: {{ tpl .Values.observability_ui.csp_extra . | quote }}
6857
{{- end }}
69-
{{- if or .Values.observability_ui.environmentJson .Values.observability_ui.manifestJson .Values.extraVolumeMounts }}
58+
{{- with .Values.extraVolumeMounts }}
7059
volumeMounts:
71-
{{- if .Values.observability_ui.environmentJson }}
72-
- mountPath: /observability_ui/shell/environments/environment.json
73-
name: {{ include "observability.observability_ui.name" . }}-configmap-volume
74-
readOnly: true
75-
subPath: environment.json
76-
{{- end }}
77-
{{- if .Values.observability_ui.manifestJson }}
78-
- mountPath: /observability_ui/shell/assets/module-federation.manifest.json
79-
name: {{ include "observability.observability_ui.name" . }}-configmap-volume
80-
readOnly: true
81-
subPath: module-federation.manifest.json
82-
{{- end }}
83-
{{- with .Values.extraVolumeMounts }}
8460
{{ toYaml . | nindent 12 }}
85-
{{- end }}
8661
{{- end }}
8762
{{- with .Values.extraVolumes }}
8863
volumes:
@@ -122,21 +97,4 @@ spec:
12297
{{- end }}
12398
selector:
12499
{{- include "observability.observability_ui.selectorLabels" . | nindent 4 }}
125-
{{- if or .Values.observability_ui.environmentJson .Values.observability_ui.manifestJson }}
126-
---
127-
apiVersion: v1
128-
kind: ConfigMap
129-
metadata:
130-
name: {{ include "observability.observability_ui.name" . }}-configmap
131-
labels:
132-
{{- include "observability.labels" . | nindent 4 }}
133-
{{- include "observability.observability_ui.selectorLabels" . | nindent 4 }}
134-
data:
135-
{{- if .Values.observability_ui.environmentJson }}
136-
environment.json: {{ .Values.observability_ui.environmentJson | toPrettyJson | quote }}
137-
{{- end }}
138-
{{- if .Values.observability_ui.manifestJson }}
139-
module-federation.manifest.json: {{ .Values.observability_ui.manifestJson | toPrettyJson | quote }}
140-
{{- end }}
141-
{{- end }}
142100
{{- end }}

deploy/charts/observability-app/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ observability_ui:
2424
type: NodePort
2525
port: 8082
2626
nodePort: 8082
27+
api_base_url: "/api"
28+
auth_method: "sso"
2729
podSecurityContext:
2830
sysctls:
2931
- name: net.core.somaxconn
@@ -32,7 +34,6 @@ observability_ui:
3234
nodeSelector: { }
3335
tolerations: [ ]
3436
affinity: { }
35-
environmentJson: {"apiBaseUrl": "/api"}
3637

3738
observability_api:
3839
enable: true

deploy/docker/observability-ui.dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
1818

1919
COPY --from=build-image --chown=nginx:nginx /observability_ui/dist /observability_ui
2020
COPY --from=build-image --chown=nginx:nginx /observability_ui/nginx.conf /etc/nginx/templates/nginx.conf.template
21+
COPY --from=build-image --chown=nginx:nginx \
22+
/observability_ui/config-observability-docker.sh /docker-entrypoint.d/40-configure-observability.sh
2123

2224
RUN mv /observability_ui/auth /observability_ui/shell/

observability_ui/apps/shell/src/module-federation.manifest.prod.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
/usr/bin/envsubst <<EOT > /observability_ui/shell/environments/environment.json
4+
{
5+
"apiBaseUrl": "${OBSERVABILITY_API_BASE_URL:-/api}"
6+
}
7+
EOT
8+
9+
cat <<EOT > /observability_ui/shell/assets/module-federation.manifest.json
10+
{
11+
"basic-auth": {
12+
"routePath": "authentication",
13+
"remoteEntry": "/auth/remoteEntry.js",
14+
"remoteName": "basic-auth",
15+
"exposedModule": "./Authentication",
16+
"exposedModuleName": "AuthenticationModule"
17+
}
18+
}
19+
EOT

observability_ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"scripts": {
66
"start": "nx serve-mfe",
77
"build": "yarn lerna run make:linkable && yarn link @observability/ui && yarn nx build-mfe",
8-
"postbuild": "cp apps/shell/src/module-federation.manifest.prod.json dist/shell/assets/module-federation.manifest.json",
98
"build:ci": "nx reset && yarn build",
109
"test": "jest",
1110
"postinstall": "lerna run make:linkable && yarn link @observability/ui",

scripts/invocations/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
from scripts.invocations.common import MINIKUBE_PROFILE, check_env_tools, get_docker_env, get_host_env
3232

33-
KUBE_VERSION = os.environ.get("INVOKE_KUBE_VERSION", "v1.29")
33+
KUBE_VERSION = os.environ.get("INVOKE_KUBE_VERSION", "v1.33.5")
3434
NAMESPACE = "datakitchen"
3535
HELM_SVC_FOLDER = os.path.join("deploy", "charts", "observability-services")
3636
HELM_APP_FOLDER = os.path.join("deploy", "charts", "observability-app")

0 commit comments

Comments
 (0)