diff --git a/.gitignore b/.gitignore index 496ee2c..5fa5a83 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ -.DS_Store \ No newline at end of file +.DS_Store + +# Jetbrains IDEs +.idea +*.iml diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 604c7b0..77a0272 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -43,6 +43,12 @@ Compile all warnings into a single message. {{- end -}} +{{/* +Return Novu API deployment full name +*/}} +{{- define "novu-api.fullname" -}} +{{- printf "%s-%s" (include "common.names.fullname" .) "api" -}} +{{- end -}} {{/* Return the proper api image name @@ -58,7 +64,12 @@ Return the proper image name (for the init container volume-permissions image) {{- include "common.images.image" ( dict "imageRoot" "global" .Values.global ) -}} {{- end -}} - +{{/* +Return Novu Worker deployment full name +*/}} +{{- define "novu-worker.fullname" -}} +{{- printf "%s-%s" (include "common.names.fullname" .) "worker" -}} +{{- end -}} {{/* Return the proper worker image name */}} @@ -73,7 +84,12 @@ Return the proper image name (for the init container volume-permissions image) {{- include "common.images.image" ( dict "imageRoot" "global" .Values.global ) -}} {{- end -}} - +{{/* +Return Novu web service deployment full name +*/}} +{{- define "novu-ws.fullname" -}} +{{- printf "%s-%s" (include "common.names.fullname" .) "ws" -}} +{{- end -}} {{/* Return the proper ws image name */}} @@ -88,6 +104,12 @@ Return the proper image name (for the init container volume-permissions image) {{- include "common.images.image" ( dict "imageRoot" "global" .Values.global ) -}} {{- end -}} +{{/* +Return Novu web service deployment full name +*/}} +{{- define "novu-web.fullname" -}} +{{- printf "%s-%s" (include "common.names.fullname" .) "web" -}} +{{- end -}} {{/* Return the proper web image name */}} diff --git a/helm/templates/api/deployment.yaml b/helm/templates/api/deployment.yaml index 151f0c0..b6aca4f 100644 --- a/helm/templates/api/deployment.yaml +++ b/helm/templates/api/deployment.yaml @@ -1,10 +1,10 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ printf "%s-%s" .Release.Name "api" }} + name: {{ include "novu-api.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "api" }} + app.kubernetes.io/component: {{ include "novu-api.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -20,14 +20,14 @@ spec: {{- end }} selector: matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "api" }} + app.kubernetes.io/component: {{ include "novu-api.fullname" . }} template: metadata: {{- if .Values.api.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.api.podAnnotations "context" $) | nindent 8 }} {{- end }} labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "api" }} + app.kubernetes.io/component: {{ include "novu-api.fullname" . }} {{- if .Values.api.podLabels }} {{- include "common.tplvalues.render" (dict "value" .Values.api.podLabels "context" $) | nindent 8 }} {{- end }} diff --git a/helm/templates/api/ingress.yaml b/helm/templates/api/ingress.yaml index af3cc93..84726c5 100644 --- a/helm/templates/api/ingress.yaml +++ b/helm/templates/api/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: - name: {{ printf "%s-%s" .Release.Name "api" }} + name: {{ include "novu-api.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -31,7 +31,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.api.ingress.pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "api") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-api.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- range .Values.api.ingress.extraHosts }} - host: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }} @@ -41,7 +41,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "api") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-api.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.api.ingress.extraRules }} {{- include "common.tplvalues.render" (dict "value" .Values.api.ingress.extraRules "context" $) | nindent 4 }} diff --git a/helm/templates/api/service.yaml b/helm/templates/api/service.yaml index 4c794bf..c524889 100644 --- a/helm/templates/api/service.yaml +++ b/helm/templates/api/service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-%s" .Release.Name "api" }} + name: {{ include "novu-api.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "api" }} + app.kubernetes.io/component: {{ include "novu-api.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -27,4 +27,4 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.api.service.extraPorts "context" $) | nindent 4 }} {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "api" }} + app.kubernetes.io/component: {{ include "novu-api.fullname" . }} diff --git a/helm/templates/externals3-secrets.yaml b/helm/templates/externals3-secrets.yaml index 1bcf6c4..1dc0921 100644 --- a/helm/templates/externals3-secrets.yaml +++ b/helm/templates/externals3-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ printf "%s-%s" .Release.Name "externals3" }} + name: {{ include "novu.s3.secretName" }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} diff --git a/helm/templates/localstack-secrets.yaml b/helm/templates/localstack-secrets.yaml index 0f782f1..f36779b 100644 --- a/helm/templates/localstack-secrets.yaml +++ b/helm/templates/localstack-secrets.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ printf "%s-%s" .Release.Name "localstack" }} + name: {{ include "novu.s3.secretName" }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} diff --git a/helm/templates/web/deployment.yaml b/helm/templates/web/deployment.yaml index 64faa01..876e5e5 100644 --- a/helm/templates/web/deployment.yaml +++ b/helm/templates/web/deployment.yaml @@ -1,10 +1,10 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ printf "%s-%s" .Release.Name "web" }} + name: {{ include "novu-web.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web" }} + app.kubernetes.io/component: {{ include "novu-web.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} @@ -21,14 +21,14 @@ spec: {{- end }} selector: matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web" }} + app.kubernetes.io/component: {{ include "novu-web.fullname" . }} template: metadata: {{- if .Values.web.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.web.podAnnotations "context" $) | nindent 8 }} {{- end }} labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web" }} + app.kubernetes.io/component: {{ include "novu-web.fullname" . }} {{- if .Values.web.podLabels }} {{- include "common.tplvalues.render" (dict "value" .Values.web.podLabels "context" $) | nindent 8 }} {{- end }} diff --git a/helm/templates/web/ingress.yaml b/helm/templates/web/ingress.yaml index 32793ae..efe3fcc 100644 --- a/helm/templates/web/ingress.yaml +++ b/helm/templates/web/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: - name: {{ printf "%s-%s" .Release.Name "web" }} + name: {{ include "novu-web.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -31,7 +31,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.web.ingress.pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "web") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-web.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- range .Values.web.ingress.extraHosts }} - host: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }} @@ -41,7 +41,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "web") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-web.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.web.ingress.extraRules }} {{- include "common.tplvalues.render" (dict "value" .Values.web.ingress.extraRules "context" $) | nindent 4 }} diff --git a/helm/templates/web/service.yaml b/helm/templates/web/service.yaml index d33ff06..033b359 100644 --- a/helm/templates/web/service.yaml +++ b/helm/templates/web/service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-%s" .Release.Name "web" }} + name: {{ include "novu-web.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web" }} + app.kubernetes.io/component: {{ include "novu-web.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -27,4 +27,4 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.web.service.extraPorts "context" $) | nindent 4 }} {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web" }} + app.kubernetes.io/component: {{ include "novu-web.fullname" . }} diff --git a/helm/templates/worker/deployment.yaml b/helm/templates/worker/deployment.yaml index c8f54a5..b94f3d6 100644 --- a/helm/templates/worker/deployment.yaml +++ b/helm/templates/worker/deployment.yaml @@ -1,10 +1,10 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ printf "%s-%s" .Release.Name "worker" }} + name: {{ include "novu-worker.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "worker" }} + app.kubernetes.io/component: {{ include "novu-worker.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -20,14 +20,14 @@ spec: {{- end }} selector: matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "worker" }} + app.kubernetes.io/component: {{ include "novu-worker.fullname" . }} template: metadata: {{- if .Values.worker.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.worker.podAnnotations "context" $) | nindent 8 }} {{- end }} labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "worker" }} + app.kubernetes.io/component: {{ include "novu-worker.fullname" . }} {{- if .Values.worker.podLabels }} {{- include "common.tplvalues.render" (dict "value" .Values.worker.podLabels "context" $) | nindent 8 }} {{- end }} diff --git a/helm/templates/worker/service.yaml b/helm/templates/worker/service.yaml index 3d03aa7..061f2aa 100644 --- a/helm/templates/worker/service.yaml +++ b/helm/templates/worker/service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-%s" .Release.Name "worker" }} + name: {{ include "novu-worker.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "worker" }} + app.kubernetes.io/component: {{ include "novu-worker.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -27,4 +27,4 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.worker.service.extraPorts "context" $) | nindent 4 }} {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "worker" }} + app.kubernetes.io/component: {{ include "novu-worker.fullname" . }} diff --git a/helm/templates/ws/deployment.yaml b/helm/templates/ws/deployment.yaml index 41a4c35..a8391f8 100644 --- a/helm/templates/ws/deployment.yaml +++ b/helm/templates/ws/deployment.yaml @@ -1,10 +1,10 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ printf "%s-%s" .Release.Name "ws" }} + name: {{ include "novu-ws.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "ws" }} + app.kubernetes.io/component: {{ include "novu-ws.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -20,14 +20,14 @@ spec: {{- end }} selector: matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "ws" }} + app.kubernetes.io/component: {{ include "novu-ws.fullname" . }} template: metadata: {{- if .Values.ws.podAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.ws.podAnnotations "context" $) | nindent 8 }} {{- end }} labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "ws" }} + app.kubernetes.io/component: {{ include "novu-ws.fullname" . }} {{- if .Values.ws.podLabels }} {{- include "common.tplvalues.render" (dict "value" .Values.ws.podLabels "context" $) | nindent 8 }} {{- end }} diff --git a/helm/templates/ws/ingress.yaml b/helm/templates/ws/ingress.yaml index 8a8a4be..007a70b 100644 --- a/helm/templates/ws/ingress.yaml +++ b/helm/templates/ws/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: - name: {{ printf "%s-%s" .Release.Name "ws" }} + name: {{ include "novu-ws.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -31,7 +31,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.ws.ingress.pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "ws") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-ws.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- range .Values.ws.ingress.extraHosts }} - host: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }} @@ -41,7 +41,7 @@ spec: {{- if eq "true" (include "common.ingress.supportsPathType" $) }} pathType: {{ default "ImplementationSpecific" .pathType }} {{- end }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-%s" .Release.Name "ws") "servicePort" "http" "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "novu-ws.fullname") "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- if .Values.ws.ingress.extraRules }} {{- include "common.tplvalues.render" (dict "value" .Values.ws.ingress.extraRules "context" $) | nindent 4 }} diff --git a/helm/templates/ws/service.yaml b/helm/templates/ws/service.yaml index 2fe0691..1d1144c 100644 --- a/helm/templates/ws/service.yaml +++ b/helm/templates/ws/service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-%s" .Release.Name "ws" }} + name: {{ include "novu-ws.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "ws" }} + app.kubernetes.io/component: {{ include "novu-ws.fullname" . }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -27,4 +27,4 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "ws" }} + app.kubernetes.io/component: {{ include "novu-ws.fullname" . }}