Skip to content

Commit

Permalink
PS-705 add novu, remove notify (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem authored Dec 11, 2024
1 parent c775661 commit af7dc2f
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 31 deletions.
2 changes: 1 addition & 1 deletion charts/phrasea/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.0.1
version: 2.1.0-rc1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
4 changes: 4 additions & 0 deletions charts/phrasea/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ gateway-tls
name: urls-config
- configMapRef:
name: configurator-s3
- configMapRef:
name: novu
- secretRef:
name: novu
{{- end }}

{{- define "envRef.phpApp" }}
Expand Down
1 change: 0 additions & 1 deletion charts/phrasea/templates/config/urls-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ data:
STACK_NAME: {{ .Values.stack.name | default "" | quote }}
STACK_VERSION: {{ .Values.repository.tag | quote }}
REPORT_API_URL: {{ required "Missing report.api.baseUrl" .Values.report.api.baseUrl | quote }}
NOTIFY_API_URL: {{ required "Missing notify.api.baseUrl" .Values.notify.api.baseUrl | quote }}
KEYCLOAK_URL: {{ required "Missing keycloak.baseUrl" .Values.keycloak.baseUrl | quote }}
KEYCLOAK_REALM_NAME: {{ required "Missing mailer.dsn value" .Values.keycloak.realm.name | quote }}
EXPOSE_API_URL: {{ required "Missing expose.api.baseUrl" .Values.expose.api.baseUrl | quote }}
Expand Down
2 changes: 2 additions & 0 deletions charts/phrasea/templates/dashboard/dashboard-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
envFrom:
- configMapRef:
name: urls-config
- configMapRef:
name: novu
- configMapRef:
name: configurator-s3
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
envFrom:
- configMapRef:
name: urls-config
- configMapRef:
name: novu
- configMapRef:
name: soketi
- configMapRef:
Expand Down
2 changes: 2 additions & 0 deletions charts/phrasea/templates/expose/expose-client-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
envFrom:
- configMapRef:
name: urls-config
- configMapRef:
name: novu
- configMapRef:
name: expose-client-config
- configMapRef:
Expand Down
9 changes: 0 additions & 9 deletions charts/phrasea/templates/notify/api-configmap.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions charts/phrasea/templates/novu/novu-bridge-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{- if and $.Values.stack.running .Values.novu.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: novu-bridge
spec:
replicas: 1
selector:
matchLabels:
app: phrasea
tier: novu-bridge
template:
metadata:
labels:
app: phrasea
tier: novu-bridge
annotations:
{{- include "annotation.checksum.configs" $ | indent 8 }}
spec:
{{ include "imagePullSecrets" $ | indent 6 }}
{{- if $.Values.nodeSelector }}
nodeSelector: {{ toYaml $.Values.nodeSelector | nindent 8 }}
{{- end }}
volumes:
containers:
- name: novu-bridge
image: {{ $.Values.repository.baseurl }}/ps-novu-bridge:{{ $.Values.repository.tag }}
{{- if not (eq "latest" $.Values.repository.tag) }}
imagePullPolicy: Always
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: NEXT_PUBLIC_NOVU_SECRET_KEY
valueFrom:
secretKeyRef:
name: novu
key: NOVU_SECRET_KEY
- name: NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_APPLICATION_IDENTIFIER
- name: NEXT_PUBLIC_NOVU_API_URL
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_API_URL
envFrom:
- configMapRef:
name: novu
- secretRef:
name: novu
{{- end }}
42 changes: 42 additions & 0 deletions charts/phrasea/templates/novu/novu-bridge-ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if and $.Values.stack.running .Values.novu.enabled }}
{{- with .Values.novu.bridge }}
{{- if .ingress.enabled }}
{{- $ingressNode := . }}
apiVersion: {{ template "ingress.apiVersion" $ }}
kind: Ingress
metadata:
name: novu-bridge
{{- if .ingress.annotations }}
annotations:
{{ toYaml .ingress.annotations | indent 4 }}
{{- end }}
{{- if .ingress.extraLabels }}
labels:
{{ toYaml .ingress.extraLabels | indent 4 }}
{{- end }}
spec:
ingressClassName: nginx
rules:
- host: {{ required "Missing novu.bridge.hostname" .hostname }}
http:
paths:
{{- include "ingress.rule_path" (dict "_" $ "name" "novu-bridge" "port" 80) | indent 6 }}
{{- if .ingress.tls }}
{{- $tlsNode := .ingress.tls -}}
{{- range $value := $tlsNode }}
{{- if not (hasKey $value "hosts") }}
{{- $hosts := list $ingressNode.hostname }}
{{- $_ := set $value "hosts" $hosts }}
{{- end -}}
{{- end }}
tls:
{{ toYaml $tlsNode | indent 2 }}
{{- else if $.Values.ingress.tls.wildcard.enabled }}
tls:
- hosts:
- {{ .hostname }}
secretName: {{ include "secretRef.ingress.tls.wildcard" $ }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/phrasea/templates/novu/novu-bridge-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and $.Values.stack.running .Values.novu.enabled }}
apiVersion: v1
kind: Service
metadata:
name: novu-bridge
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
app: phrasea
tier: novu-bridge
{{- end }}
14 changes: 14 additions & 0 deletions charts/phrasea/templates/novu/novu-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- with .Values.novu }}
{{- if .enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: novu
data:
NOVU_API_HOST: {{ required "Missing novu.apiHost" .apiHost | quote }}
NOVU_API_URL: {{ (print "https://" (required "Missing novu.apiHost" .apiHost)) | quote }}
NOVU_BRIDGE_URL: {{ required "Missing novu.bridge.baseUrl" .bridge.baseUrl | quote }}
NOVU_WS_URL: {{ required "Missing novu.wsUrl" .wsUrl | quote }}
NOVU_APPLICATION_IDENTIFIER: {{ required "Missing novu.applicationIdentifier" .applicationIdentifier | quote }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
envFrom:
- configMapRef:
name: urls-config
- configMapRef:
name: novu
- configMapRef:
name: uploader-client-config
- configMapRef:
Expand Down
34 changes: 14 additions & 20 deletions charts/phrasea/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ auth:
database:
name: auth

novu:
enabled: true
bridge:
hostname:
baseUrl:
ingress:
enabled: true
annotations: {}
extraLabels: {}
tls: []
apiHost: api.novu.co
wsUrl: https://ws.novu.co
applicationIdentifier:

databox:
enabled: true
api:
Expand Down Expand Up @@ -222,25 +236,6 @@ expose:
clientId: expose
clientSecret: __CHANGE_ME_zEp1JbcjuQ

notify:
enabled: true
api:
hostname:
baseUrl:
ingress:
enabled: true
annotations: {}
extraLabels: {}
tls: []
adminOAuthClient:
externalSecretName:
id: notify-admin
secret: '__CHANGE_ME_5H$56@IbhNuJpDY3O#'
rabbitmq:
vhost: notify
database:
name: notify

uploader:
enabled: true
api:
Expand Down Expand Up @@ -409,7 +404,6 @@ _internal:
services:
- databox
- expose
- notify
- uploader
clients:
- databox
Expand Down

0 comments on commit af7dc2f

Please sign in to comment.