-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0394516
commit 2f01987
Showing
27 changed files
with
634 additions
and
6 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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:** <https://radar-base.org> | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| Keyvan Hedayati | <keyvan@thehyve.nl> | <https://www.thehyve.nl> | | ||
| Joris Borgdorff | <joris@thehyve.nl> | <https://www.thehyve.nl/experts/joris-borgdorff> | | ||
| Nivethika Mahasivam | <nivethika@thehyve.nl> | <https://www.thehyve.nl/experts/nivethika-mahasivam> | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/IMI-H2O/outcomes-dashboard> | ||
|
||
## 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
Oops, something went wrong.