diff --git a/.github/ci_config/bin/install-dependencies b/.github/ci_config/bin/install-dependencies old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 6b116c40..61f761e9 100644 --- a/README.md +++ b/README.md @@ -407,7 +407,7 @@ If installed, to upgrade `timescaledb`, uncomment the `production.yaml` line `ti ```shell kubectl delete secrets timescaledb-postgresql kubectl delete statefulsets timescaledb-postgresql -helmfile -f helmfile.d/20-grafana.yaml apply +helmfile -f helmfile.d/20-dashboard.yaml apply ``` If installed, to upgrade `radar-upload-postgresql`, uncomment the `production.yaml` line `radar_upload_postgresql.primary.existingClaim: "data-radar-upload-postgresql-postgresql-0"`. Then run diff --git a/bin/chart-updates b/bin/chart-updates old mode 100755 new mode 100644 diff --git a/bin/generate-secrets b/bin/generate-secrets old mode 100755 new mode 100644 index 0e5ee732..f7746aee --- a/bin/generate-secrets +++ b/bin/generate-secrets @@ -68,6 +68,7 @@ insert_secret ".management_portal.oauth_clients.radar_redcap_integrator.client_s insert_secret ".management_portal.oauth_clients.radar_fitbit_connector.client_secret" insert_secret ".management_portal.oauth_clients.radar_appconfig.client_secret" insert_secret ".management_portal.oauth_clients.radar_push_endpoint.client_secret" +insert_secret ".management_portal.oauth_clients.radar_data_dashboard_backend.client_secret" insert_secret \ ".radar_appserver_postgresql.global.postgresql.auth.postgresPassword" \ diff --git a/bin/init b/bin/init old mode 100755 new mode 100644 diff --git a/bin/keystore-init b/bin/keystore-init old mode 100755 new mode 100644 diff --git a/bin/log-failed-release b/bin/log-failed-release old mode 100755 new mode 100644 diff --git a/bin/util.sh b/bin/util.sh old mode 100755 new mode 100644 diff --git a/charts/data-dashboard-backend/.helmignore b/charts/data-dashboard-backend/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/data-dashboard-backend/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/data-dashboard-backend/Chart.yaml b/charts/data-dashboard-backend/Chart.yaml new file mode 100644 index 00000000..41b468f6 --- /dev/null +++ b/charts/data-dashboard-backend/Chart.yaml @@ -0,0 +1,22 @@ +apiVersion: v2 +appVersion: "0.1.0" +name: data-dashboard-backend +description: API for data in the data dashboard +version: 0.1.6 +sources: ["https://github.com/thehyve/radar-data-dashboard-backend"] +deprecated: false +type: application +home: "https://radar-base.org" +maintainers: + - email: keyvan@thehyve.nl + name: Keyvan Hedayati + url: https://www.thehyve.nl + - email: nivethika@thehyve.nl + name: Nivethika Mahasivam + url: https://www.thehyve.nl/experts/nivethika-mahasivam + - email: bastiaan@thehyve.nl + name: Bastiaan de Graaf + url: https://www.thehyve.nl/experts/bastiaan-de-graaf + - email: pim@thehyve.nl + name: Pim van Nierop + url: https://www.thehyve.nl/experts/pim-van-nierop diff --git a/charts/data-dashboard-backend/DOCS.md.gotmpl b/charts/data-dashboard-backend/DOCS.md.gotmpl new file mode 100644 index 00000000..e69de29b diff --git a/charts/data-dashboard-backend/README.md b/charts/data-dashboard-backend/README.md new file mode 100644 index 00000000..dbcdad36 --- /dev/null +++ b/charts/data-dashboard-backend/README.md @@ -0,0 +1,67 @@ +# data-dashboard-backend + +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) + +API for data in the data dashboard + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Keyvan Hedayati | | | +| Joris Borgdorff | | | +| Nivethika Mahasivam | | | + +## Source Code + +* + +## Prerequisites +* Kubernetes 1.17+ +* Kubectl 1.17+ +* Helm 3.1.0+ + +## Values + +| Key | Type | Default | Description | +|-----|------|----------------------------------------------------|-------------| +| replicaCount | int | `2` | Number of replicas to deploy | +| image.repository | string | `"quay.io/imi-h2o/data-dashboard-backend"` | docker image repository | +| image.pullPolicy | string | `"Always"` | image pull policy | +| image.tag | string | `"dev"` | | +| imagePullSecrets | list | `[]` | Docker registry secret names as an array | +| nameOverride | string | `""` | String to partially override fullname template with a string (will prepend the release name) | +| fullnameOverride | string | `""` | String to fully override fullname template with a string | +| podSecurityContext | object | `{}` | Configure pod's Security Context | +| securityContext | object | `{}` | Configure container's Security Context | +| service.type | string | `"ClusterIP"` | Kubernetes Service type | +| service.port | int | `9000` | data-dashboard-backend port | +| ingress.enabled | bool | `true` | Enable ingress controller resource | +| ingress.className | string | `""` | Ingress class name | +| ingress.annotations | object | check values.yaml | Annotations that define default ingress class, certificate issuer | +| ingress.path | string | `"/api($ |/)(.*)"` | Path within the url structure | +| ingress.pathType | string | `"ImplementationSpecific"` | | +| ingress.hosts | list | `["localhost"]` | Hosts to accept requests from | +| ingress.tls.secretName | string | `"radar-base-tls"` | TLS Secret Name | +| resources | object | `{}` | | +| autoscaling.enabled | bool | `false` | Enable horizontal autoscaling | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| nodeSelector | object | `{}` | Node labels for pod assignment | +| tolerations | list | `[]` | Toleration labels for pod assignment | +| affinity | object | `{}` | Affinity labels for pod assignment | +| existingSecret | string | `""` | | +| javaOpts | string | `"-Xmx550m"` | Standard JAVA_OPTS that should be passed to this service | +| managementPortal.url | string | `"http://management-portal:8080/managementportal"` | ManagementPortal URL | +| managementPortal.clientId | string | `"data_dashboard_backend"` | ManagementPortal OAuth 2.0 client ID, having grant type client_credentials | +| managementPortal.clientSecret | string | `"secret"` | ManagementPortal OAuth 2.0 client secret | +| path | string | `"/api"` | | +| score | object | Diabetes score calculation table configurations | Where to find lookup tables for score calculations, and how to calculate them. | +| jdbc.driver | string | `"org.postgresql.Driver"` | JDBC Driver to connect to the database. | +| jdbc.url | string | `"jdbc:postgresql://postgresql:5432/outcomes"` | JDBC Connection url of the database. | +| jdbc.user | string | `"radarbase"` | Username of the database | +| jdbc.password | string | `"password"` | Password of the user | +| jdbc.dialect | string | `"org.hibernate.dialect.PostgreSQLDialect"` | Hibernate dialect to use for JDBC Connection | diff --git a/charts/data-dashboard-backend/README.md.gotmpl b/charts/data-dashboard-backend/README.md.gotmpl new file mode 100644 index 00000000..34465139 --- /dev/null +++ b/charts/data-dashboard-backend/README.md.gotmpl @@ -0,0 +1,18 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "common.prerequisites" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} diff --git a/charts/data-dashboard-backend/templates/NOTES.txt b/charts/data-dashboard-backend/templates/NOTES.txt new file mode 100644 index 00000000..3a3c3f97 --- /dev/null +++ b/charts/data-dashboard-backend/templates/NOTES.txt @@ -0,0 +1,20 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ $.Values.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "data-dashboard-backend.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "data-dashboard-backend.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "data-dashboard-backend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "data-dashboard-backend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:9000 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9000:$CONTAINER_PORT +{{- end }} diff --git a/charts/data-dashboard-backend/templates/_helpers.tpl b/charts/data-dashboard-backend/templates/_helpers.tpl new file mode 100644 index 00000000..f7a340f9 --- /dev/null +++ b/charts/data-dashboard-backend/templates/_helpers.tpl @@ -0,0 +1,73 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "data-dashboard-backend.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "data-dashboard-backend.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "data-dashboard-backend.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Get the password secret. +*/}} +{{- define "data-dashboard-backend.secretName" -}} +{{- if .Values.existingSecret }} + {{- printf "%s" .Values.existingSecret -}} +{{- else -}} + {{- printf "%s" (include "data-dashboard-backend.fullname" .) -}} +{{- end -}} +{{- end -}} + +{{/* +Return true if a secret object should be created +*/}} +{{- define "data-dashboard-backend.createSecret" -}} +{{- if .Values.existingSecret }} +{{- else if .Values.existingSecret -}} +{{- else -}} + {{- true -}} +{{- end -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "data-dashboard-backend.labels" -}} +helm.sh/chart: {{ include "data-dashboard-backend.chart" . }} +{{ include "data-dashboard-backend.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "data-dashboard-backend.selectorLabels" -}} +app.kubernetes.io/name: {{ include "data-dashboard-backend.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/data-dashboard-backend/templates/configmap.yaml b/charts/data-dashboard-backend/templates/configmap.yaml new file mode 100644 index 00000000..851f9484 --- /dev/null +++ b/charts/data-dashboard-backend/templates/configmap.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "data-dashboard-backend.fullname" . }} + labels: + app: {{ template "data-dashboard-backend.name" . }} + chart: {{ template "data-dashboard-backend.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + dashboard.yml: | + service: + baseUri: http://0.0.0.0:9000{{ .Values.path }} + advertisedBaseUri: null + enableCors: true + auth: + managementPortal: + url: {{ .Values.managementPortal.url }} + clientId: {{ .Values.managementPortal.clientId }} + clientSecret: {{ .Values.managementPortal.clientSecret }} + jwtResourceName: res_data_dashboard_backend + database: + url: {{ .Values.jdbc.url }} + user: {{ .Values.jdbc.user }} + password: {{ .Values.jdbc.password }} + dialect: {{ .Values.jdbc.dialect }} diff --git a/charts/data-dashboard-backend/templates/deployment.yaml b/charts/data-dashboard-backend/templates/deployment.yaml new file mode 100644 index 00000000..d9fa0fb4 --- /dev/null +++ b/charts/data-dashboard-backend/templates/deployment.yaml @@ -0,0 +1,93 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "data-dashboard-backend.fullname" . }} + labels: + {{- include "data-dashboard-backend.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "data-dashboard-backend.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + labels: + {{- include "data-dashboard-backend.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "/etc/data-dashboard-backend/dashboard.yml" + env: + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: {{ template "data-dashboard-backend.secretName" . }} + key: databaseUrl + - name: DATABASE_USER + valueFrom: + secretKeyRef: + name: {{ template "data-dashboard-backend.secretName" . }} + key: databaseUser + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "data-dashboard-backend.secretName" . }} + key: databasePassword + ports: + - name: http + containerPort: 9000 + protocol: TCP + livenessProbe: + httpGet: + path: /api/health + port: http + httpHeaders: + - name: Accept + value: application/json + readinessProbe: + httpGet: + path: /api/health + port: http + httpHeaders: + - name: Accept + value: application/json + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config + mountPath: /etc/data-dashboard-backend/ + volumes: + - name: config + configMap: + name: {{ include "data-dashboard-backend.fullname" . }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/data-dashboard-backend/templates/hpa.yaml b/charts/data-dashboard-backend/templates/hpa.yaml new file mode 100644 index 00000000..bed41097 --- /dev/null +++ b/charts/data-dashboard-backend/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "data-dashboard-backend.fullname" . }} + labels: + {{- include "data-dashboard-backend.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "data-dashboard-backend.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/data-dashboard-backend/templates/ingress.yaml b/charts/data-dashboard-backend/templates/ingress.yaml new file mode 100644 index 00000000..d3ac18c1 --- /dev/null +++ b/charts/data-dashboard-backend/templates/ingress.yaml @@ -0,0 +1,50 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "data-dashboard-backend.fullname" . -}} +{{- $path := .Values.ingress.path -}} +{{- $hosts := .Values.ingress.hosts -}} +{{- $svcPort := .Values.service.port -}} +{{- $pathType := .Values.ingress.pathType -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "data-dashboard-backend.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + - hosts: + {{- range .Values.ingress.hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .Values.ingress.tls.secretName }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $path | quote }} + {{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/data-dashboard-backend/templates/service.yaml b/charts/data-dashboard-backend/templates/service.yaml new file mode 100644 index 00000000..e046b9e4 --- /dev/null +++ b/charts/data-dashboard-backend/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "data-dashboard-backend.fullname" . }} + labels: + {{- include "data-dashboard-backend.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "data-dashboard-backend.selectorLabels" . | nindent 4 }} diff --git a/charts/data-dashboard-backend/templates/tests/test-connection.yaml b/charts/data-dashboard-backend/templates/tests/test-connection.yaml new file mode 100644 index 00000000..1bae497b --- /dev/null +++ b/charts/data-dashboard-backend/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "data-dashboard-backend.fullname" . }}-test-connection" + labels: + {{- include "data-dashboard-backend.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox:1.36 + command: ['wget'] + args: ['{{ include "data-dashboard-backend.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/data-dashboard-backend/values.yaml b/charts/data-dashboard-backend/values.yaml new file mode 100644 index 00000000..45335d3d --- /dev/null +++ b/charts/data-dashboard-backend/values.yaml @@ -0,0 +1,118 @@ +# Default values for data-dashboard-backend. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# -- Number of replicas to deploy +replicaCount: 2 + +image: + # -- docker image repository + repository: ghcr.io/thehyve/radar-data-dashboard-backend + # -- image pull policy + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: v0.1.3-alpha + +# -- Docker registry secret names as an array +imagePullSecrets: [] + +# -- String to partially override fullname template with a string (will prepend the release name) +nameOverride: "" +# -- String to fully override fullname template with a string +fullnameOverride: "" + +# -- Configure pod's Security Context +podSecurityContext: {} + # fsGroup: 2000 + +# -- Configure container's Security Context +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + # -- Kubernetes Service type + type: ClusterIP + # -- data-dashboard-backend port + port: 9000 + +ingress: + # -- Enable ingress controller resource + enabled: true + # -- Ingress class name + className: "" + # -- Annotations that define default ingress class, certificate issuer + # @default -- check values.yaml + annotations: + kubernetes.io/ingress.class: nginx + cert-manager.io/cluster-issuer: letsencrypt-prod + # -- Path within the url structure + path: /api + pathType: ImplementationSpecific + # -- Hosts to accept requests from + hosts: + - localhost + tls: + secretName: radar-base-data-dashboard + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + # -- Enable horizontal autoscaling + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# -- Node labels for pod assignment +nodeSelector: {} + +# -- Toleration labels for pod assignment +tolerations: [] + +# -- Affinity labels for pod assignment +affinity: {} + +existingSecret: "" + +# -- Standard JAVA_OPTS that should be passed to this service +javaOpts: "-Xmx550m" + + +managementPortal: + # -- ManagementPortal URL + url: http://management-portal:8080/managementportal + # -- ManagementPortal OAuth 2.0 client ID, having grant type client_credentials + clientId: radar_data_dashboard_backend + # -- ManagementPortal OAuth 2.0 client secret + clientSecret: secret + +# Base path to use in application +path: /api + +jdbc: + # -- JDBC Driver to connect to the database. + driver: org.postgresql.Driver + # -- JDBC Connection url of the database. + url: jdbc:postgresql://postgresql:5432/data-dashboard + # -- Username of the database + user: radarbase + # -- Password of the user + password: password + # -- Hibernate dialect to use for JDBC Connection + dialect: org.hibernate.dialect.PostgreSQLDialect diff --git a/etc/base-secrets.yaml b/etc/base-secrets.yaml index ce392ebd..44366bce 100644 --- a/etc/base-secrets.yaml +++ b/etc/base-secrets.yaml @@ -86,6 +86,8 @@ management_portal: client_secret: secret radar_push_endpoint: client_secret: secret + radar_data_dashboard_backend: + client_secret: secret smtp: password: secret @@ -117,7 +119,7 @@ fitbit_api_secret: "secret" radar_rest_sources_backend: postgres: password: secret -# --------------------------------------------------------- 20-grafana.yaml --------------------------------------------------------- +# --------------------------------------------------------- 20-dashboard.yaml --------------------------------------------------------- timescaledb_password: secret grafana_password: secret grafana_metrics_password: secret diff --git a/etc/base.yaml b/etc/base.yaml index aaf0e50c..4d9d0d96 100644 --- a/etc/base.yaml +++ b/etc/base.yaml @@ -275,11 +275,10 @@ radar_rest_sources_backend: garmin: enable: "false" -# --------------------------------------------------------- 20-grafana.yaml --------------------------------------------------------- +# --------------------------------------------------------- 20-dashboard.yaml --------------------------------------------------------- timescaledb_username: postgres -timescaledb_db_name: grafana-metrics -grafana_metrics_username: postgres +timescaledb_db_name: data-dashboard timescaledb: _install: true @@ -300,6 +299,8 @@ timescaledb: # Uncomment when upgrading #existingClaim: "data-timescaledb-postgresql-0" +grafana_metrics_username: postgres + radar_grafana: _install: true _chart_version: 6.26.8 @@ -308,6 +309,11 @@ radar_grafana: env: GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/allprojects/home.json +data_dashboard_backend: + _install: false + _chart_version: 0.1.0 + replicaCount: 1 + radar_jdbc_connector: _install: true _chart_version: 0.5.1 @@ -459,6 +465,22 @@ radar_upload_source_connector: replicaCount: 1 s3Endpoint: http://minio:9000/ +# --------------------------------------------------------- 20-outcomes-transform.yaml --------------------------------------------------------- + +outcomes_jdbc_sink_connector: + _install: true + _chart_version: 0.3.0 + replicaCount: 1 + +outcomes_jdbc_source_connector: + _install: true + _chart_version: 0.3.0 + replicaCount: 1 + +outcomes_ksql_transform: + _install: true + _chart_version: 0.3.1 + # --------------------------------------------------------- 30-confluent-cloud.yaml --------------------------------------------------------- ccSchemaRegistryProxy: diff --git a/etc/data-dashboard-backend/values.yaml b/etc/data-dashboard-backend/values.yaml new file mode 100644 index 00000000..ae35ab3f --- /dev/null +++ b/etc/data-dashboard-backend/values.yaml @@ -0,0 +1,15 @@ +ingress: + enabled: true + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + nginx.ingress.kubernetes.io/enable-cors: "true" + className: nginx + hosts: + - host: localhost + tls: + secretName: radar-base-data-dashboard + hosts: + - localhost +jdbc: + url: jdbc:postgresql://timescaledb-postgresql-hl:5432/data-dashboard + user: radarbase diff --git a/etc/timescaledb/values.yaml b/etc/timescaledb/values.yaml index 81b4d5af..882b5b20 100644 --- a/etc/timescaledb/values.yaml +++ b/etc/timescaledb/values.yaml @@ -39,7 +39,7 @@ auth: postgresPassword: "" ## @param auth.database Name for a custom database to create ## - database: grafana-metrics + database: data-dashboard ## @param architecture PostgreSQL architecture (`standalone` or `replication`) ## architecture: standalone diff --git a/helmfile.d/20-grafana.yaml b/helmfile.d/20-dashboard.yaml similarity index 80% rename from helmfile.d/20-grafana.yaml rename to helmfile.d/20-dashboard.yaml index ddaa8959..ddafd75a 100644 --- a/helmfile.d/20-grafana.yaml +++ b/helmfile.d/20-dashboard.yaml @@ -65,6 +65,26 @@ releases: - name: "grafana\\.ini.auth\\.generic_oauth.token_url" value: "https://{{ .Values.server_name }}/managementportal/oauth/token" + - name: data-dashboard-backend + chart: ../charts/data-dashboard-backend + version: {{ .Values.data_dashboard_backend._chart_version }} + installed: {{ .Values.data_dashboard_backend._install }} + values: + - "../etc/data-dashboard-backend/values.yaml" + - {{ .Values.data_dashboard_backend | toYaml | indent 8 | trim }} + set: + - name: serverName + value: {{ .Values.server_name }} + - name: ingress.hosts + values: + - data.{{ .Values.server_name }} + - name: jdbc.user + value: {{ .Values.timescaledb_username }} + - name: jdbc.password + value: {{ .Values.timescaledb_password }} + - name: jdbc.url + value: {{ dig "jdbc" "url" (printf "jdbc:postgresql://timescaledb-postgresql-hl:5432/%s" .Values.timescaledb_db_name) .Values.data_dashboard_backend }} + - name: radar-jdbc-connector chart: radar/radar-jdbc-connector version: {{ .Values.radar_jdbc_connector._chart_version }}