From 5e559df22c5fedb1cdbb7f313b9abb91b54a9e21 Mon Sep 17 00:00:00 2001 From: Farid Bagishev Date: Tue, 9 Apr 2024 16:31:05 +0500 Subject: [PATCH] Add documentation --- README.md | 4 + aidbox/Chart.yaml | 6 +- aidbox/README.md | 82 +++++++++++++++++++ aidbox/README.md.gotmpl | 38 +++++++++ aidbox/templates/configmap.yaml | 4 +- aidbox/templates/deployment.yaml | 1 - aidbox/templates/secrets.yaml | 17 ++-- aidbox/values.yaml | 20 +---- aidboxdb/Chart.yaml | 6 +- aidboxdb/README.md | 57 +++++++++++++ aidboxdb/README.md.gotmpl | 41 ++++++++++ aidboxdb/templates/configmap-env.yaml | 7 +- aidboxdb/templates/configmap-files.yaml | 3 +- aidboxdb/templates/persistentvolumeclaim.yaml | 6 +- aidboxdb/templates/secrets.yaml | 4 +- aidboxdb/values.yaml | 29 ++++--- 16 files changed, 275 insertions(+), 50 deletions(-) create mode 100644 README.md create mode 100644 aidbox/README.md create mode 100644 aidbox/README.md.gotmpl create mode 100644 aidboxdb/README.md create mode 100644 aidboxdb/README.md.gotmpl diff --git a/README.md b/README.md new file mode 100644 index 0000000..84d0b94 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Aidbox helm charts + +- [aidbox](./aidbox) +- [aidboxdb](./aidboxdb) diff --git a/aidbox/Chart.yaml b/aidbox/Chart.yaml index de4046b..4eceb07 100644 --- a/aidbox/Chart.yaml +++ b/aidbox/Chart.yaml @@ -1,6 +1,8 @@ apiVersion: v2 appVersion: edge -description: Aidbox +description: Aidbox FHIR server by HealthSamurai +home: https://www.health-samurai.io/aidbox +icon: https://aidbox.github.io/helm-charts/icon.png?1712669999 name: aidbox type: application -version: 0.1.1 +version: 0.1.4 diff --git a/aidbox/README.md b/aidbox/README.md new file mode 100644 index 0000000..39f6b0e --- /dev/null +++ b/aidbox/README.md @@ -0,0 +1,82 @@ +# aidbox + +[Aidbox](https://docs.aidbox.app/) is an efficient and scalable FHIR server built to handle healthcare data effectively, empowering healthcare providers and developers alike with its comprehensive platform for storing, accessing, and exchanging healthcare information in accordance with FHIR standards. + +![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: edge](https://img.shields.io/badge/AppVersion-edge-informational?style=flat-square) + +## Installation + +Prepare the configuration file. Please refer to the [Aidbox environment variables](https://docs.aidbox.app/reference/configuration/environment-variables) for details. + +```yaml +host: +protocol: + +config: + AIDBOX_FHIR_VERSION: + PGHOST: + PGDATABASE: + PGUSER: + PGPASSWORD: + AIDBOX_CLIENT_ID: + AIDBOX_CLIENT_SECRET: + AIDBOX_ADMIN_ID: + AIDBOX_ADMIN_PASSWORD: + AIDBOX_LICENSE: +``` + +```console +helm upgrade --install aidbox aidbox \ + --repo https://aidbox.github.io/helm-charts \ + --namespace aidbox --create-namespace \ + --values /path/to/config/file +``` + +It will install the Aidbox in the `aidbox` namespace, creating that namespace if it doesn't already exist. + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| config | object | `{"AIDBOX_PORT":8080,"BOX_METRICS_PORT":8765,"PGPORT":5432}` | Aidbox config see [Aidbox environment variables](https://docs.aidbox.app/reference/configuration/environment-variables) for details | +| fullnameOverride | string | `""` | | +| host | string | `"my.domain.tld"` | Host name Aidbox will be available at | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"healthsamurai/aidboxone"` | | +| image.tag | string | `""` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `"nginx"` | | +| ingress.enabled | bool | `true` | | +| livenessProbe.failureThreshold | int | `10` | | +| livenessProbe.httpGet.path | string | `"/health"` | | +| livenessProbe.httpGet.port | string | `"api"` | | +| livenessProbe.periodSeconds | int | `10` | | +| nameOverride | string | `""` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| protocol | string | `"http"` | Protocol to be used to access Aidbox (http or https) | +| readinessProbe.failureThreshold | int | `5` | | +| readinessProbe.httpGet.path | string | `"/health"` | | +| readinessProbe.httpGet.port | string | `"api"` | | +| readinessProbe.periodSeconds | int | `10` | | +| readinessProbe.successThreshold | int | `1` | | +| replicaCount | int | `1` | | +| resources.requests.cpu | string | `"500m"` | | +| resources.requests.memory | string | `"256Mi"` | | +| securityContext.runAsNonRoot | bool | `true` | | +| securityContext.runAsUser | int | `1000` | | +| service.apiPort | int | `80` | | +| service.metricsPort | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| startupProbe.failureThreshold | int | `10` | | +| startupProbe.httpGet.path | string | `"/health"` | | +| startupProbe.httpGet.port | string | `"api"` | | +| startupProbe.initialDelaySeconds | int | `20` | | +| startupProbe.periodSeconds | int | `5` | | +| volumeMounts | list | `[]` | | +| volumes | list | `[]` | | diff --git a/aidbox/README.md.gotmpl b/aidbox/README.md.gotmpl new file mode 100644 index 0000000..e1489df --- /dev/null +++ b/aidbox/README.md.gotmpl @@ -0,0 +1,38 @@ +{{ template "chart.header" . }} + +[Aidbox](https://docs.aidbox.app/) is an efficient and scalable FHIR server built to handle healthcare data effectively, empowering healthcare providers and developers alike with its comprehensive platform for storing, accessing, and exchanging healthcare information in accordance with FHIR standards. + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +## Installation + +Prepare the configuration file. Please refer to the [Aidbox environment variables](https://docs.aidbox.app/reference/configuration/environment-variables) for details. + +```yaml +host: +protocol: + +config: + AIDBOX_FHIR_VERSION: + PGHOST: + PGDATABASE: + PGUSER: + PGPASSWORD: + AIDBOX_CLIENT_ID: + AIDBOX_CLIENT_SECRET: + AIDBOX_ADMIN_ID: + AIDBOX_ADMIN_PASSWORD: + AIDBOX_LICENSE: +``` + + +```console +helm upgrade --install aidbox aidbox \ + --repo https://aidbox.github.io/helm-charts \ + --namespace aidbox --create-namespace \ + --values /path/to/config/file +``` + +It will install the Aidbox in the `aidbox` namespace, creating that namespace if it doesn't already exist. + +{{ template "chart.valuesSection" . }} diff --git a/aidbox/templates/configmap.yaml b/aidbox/templates/configmap.yaml index 636909c..d9c4589 100644 --- a/aidbox/templates/configmap.yaml +++ b/aidbox/templates/configmap.yaml @@ -6,7 +6,9 @@ metadata: {{- include "aidbox.labels" . | nindent 4 }} data: {{- range $key, $val := .Values.config }} + {{- if and (ne $key "PGUSER") (ne $key "PGPASSWORD") (ne $key "AIDBOX_CLIENT_ID") (ne $key "AIDBOX_CLIENT_SECRET") (ne $key "AIDBOX_ADMIN_ID") (ne $key "AIDBOX_ADMIN_PASSWORD") (ne $key "AIDBOX_LICENSE") }} {{ $key }}: {{ $val | quote }} {{- end }} - AIDBOX_BASE_URL: {{ .Values.protocol }}://{{ .Values.host }} + {{- end }} + AIDBOX_BASE_URL: {{ required "missing protocol value" .Values.protocol }}://{{ required "missing host value" .Values.host }} PGHOST: {{ required "missing config PGHOST value" .Values.config.PGHOST | quote }} diff --git a/aidbox/templates/deployment.yaml b/aidbox/templates/deployment.yaml index 5e86885..f52dbaf 100644 --- a/aidbox/templates/deployment.yaml +++ b/aidbox/templates/deployment.yaml @@ -15,7 +15,6 @@ spec: metadata: annotations: checksum/config: {{ toJson .Values.config | sha256sum }} - checksum/secrets: {{ toJson .Values.secrets | sha256sum }} labels: {{- include "aidbox.labels" . | nindent 8 }} {{- with .Values.podLabels }} diff --git a/aidbox/templates/secrets.yaml b/aidbox/templates/secrets.yaml index 1703db2..590209d 100644 --- a/aidbox/templates/secrets.yaml +++ b/aidbox/templates/secrets.yaml @@ -5,13 +5,12 @@ metadata: labels: {{- include "aidbox.labels" . | nindent 4 }} data: - {{- range $key, $val := .Values.secrets }} - {{ $key }}: {{ required (printf "missing secret %s value" $key) $val | b64enc }} - {{- end }} - - {{- with .Values.secrets }} - {{- if not .AIDBOX_LICENSE }} - AIDBOX_LICENSE_ID: {{ required "missing secret AIDBOX_LICENSE or AIDBOX_LICENSE_ID value" .AIDBOX_LICENSE_ID | b64enc }} - AIDBOX_LICENSE_KEY: {{ required "missing secret AIDBOX_LICENSE or AIDBOX_LICENSE_KEY value" .AIDBOX_LICENSE_KEY | b64enc }} - {{- end }} + {{- with .Values.config }} + AIDBOX_ADMIN_ID: {{ required "missing AIDBOX_ADMIN_ID value" .AIDBOX_ADMIN_ID | b64enc }} + AIDBOX_ADMIN_PASSWORD: {{ required "missing AIDBOX_ADMIN_PASSWORD value" .AIDBOX_ADMIN_PASSWORD | b64enc }} + AIDBOX_CLIENT_ID: {{ required "missing AIDBOX_CLIENT_ID value" .AIDBOX_CLIENT_ID | b64enc }} + AIDBOX_CLIENT_SECRET: {{ required "missing AIDBOX_CLIENT_SECRET value" .AIDBOX_CLIENT_SECRET | b64enc }} + AIDBOX_LICENSE: {{ required "missing AIDBOX_LICENSE value" .AIDBOX_LICENSE | b64enc }} + PGUSER: {{ required "missing PGUSER value" .PGUSER | b64enc }} + PGPASSWORD: {{ required "missing PGPASSWORD value" .PGPASSWORD | b64enc }} {{- end }} diff --git a/aidbox/values.yaml b/aidbox/values.yaml index 1587f0e..6b85f85 100644 --- a/aidbox/values.yaml +++ b/aidbox/values.yaml @@ -1,27 +1,15 @@ +# -- Host name Aidbox will be available at host: my.domain.tld +# -- Protocol to be used to access Aidbox (http or https) protocol: http +# -- Aidbox config +# see [Aidbox environment variables](https://docs.aidbox.app/reference/configuration/environment-variables) for details config: - AIDBOX_BOX_ID: aidbox AIDBOX_PORT: 8080 - BOX_INSTANCE_NAME: aidbox BOX_METRICS_PORT: 8765 - PGDATABASE: aidbox PGPORT: 5432 -secrets: - AIDBOX_ADMIN_ID: admin - AIDBOX_ADMIN_PASSWORD: "" - AIDBOX_CLIENT_ID: admin - AIDBOX_CLIENT_SECRET: "" - # AIDBOX_LICENSE: "" - # or - # AIDBOX_LICENSE_ID: "" - # AIDBOX_LICENSE_KEY: "" - PGUSER: "" - PGPASSWORD: "" - - image: repository: healthsamurai/aidboxone pullPolicy: IfNotPresent diff --git a/aidboxdb/Chart.yaml b/aidboxdb/Chart.yaml index d07714b..d1c8e34 100644 --- a/aidboxdb/Chart.yaml +++ b/aidboxdb/Chart.yaml @@ -1,6 +1,8 @@ apiVersion: v2 appVersion: "16.1" -description: AidboxDB +description: AidboxDB is based on the official PostgreSQL and adapted to work with Aidbox. +home: https://www.health-samurai.io/aidbox +icon: https://aidbox.github.io/helm-charts/icon.png?1712669999 name: aidboxdb type: application -version: 0.1.1 +version: 0.1.4 diff --git a/aidboxdb/README.md b/aidboxdb/README.md new file mode 100644 index 0000000..ce696bf --- /dev/null +++ b/aidboxdb/README.md @@ -0,0 +1,57 @@ +# aidboxdb + +[AidboxDB](https://docs.aidbox.app/storage-1/aidboxdb-image) is a specialized version of the open-source PostgreSQL database, tailored for use as the data storage backend for Aidbox. It serves various purposes, including initializing and operating as a master database for Aidbox, functioning as a streaming replica, optimizing FHIR search queries, and supporting backup and maintenance functionalities. + +![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 16.1](https://img.shields.io/badge/AppVersion-16.1-informational?style=flat-square) + +## Installation with the PostgreSQL default credentials + +```console +helm upgrade --install aidboxdb aidboxdb \ + --repo https://aidbox.github.io/helm-charts \ + --namespace postgres --create-namespace +``` + +It will install the AidboxDB with default credentials in the `postgres` namespace, creating that namespace if it doesn't already exist. + +## Installation using custom PostgreSQL config and/or environment variables + +Create values YAML like + +```yaml +config: |- + max_wal_size = '4GB' + shared_buffers = '2GB' + +env: + POSTGRES_USER: superuser + POSTGRES_PASSWORD: strongpassword +``` + +and apply it + +```console +helm upgrade --install aidboxdb aidboxdb \ + --repo https://aidbox.github.io/helm-charts \ + --namespace postgres --create-namespace \ + --values /path/to/values.yaml +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| config | string | `"max_wal_size = '4GB'\nshared_buffers = '2GB'"` | PostgreSQL config | +| env | object | [AidboxDB environment variables](https://docs.aidbox.app/reference/configuration/environment-variables/aidboxdb-environment-variables) | Environment variables | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"healthsamurai/aidboxdb"` | | +| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. Has one-to-one mapping to the PostgreSQL version. | +| imagePullSecrets | list | `[]` | | +| nameOverride | string | `""` | | +| podSecurityContext | object | `{}` | | +| securityContext | object | `{}` | | +| storage.className | string | `""` | Storage className to use | +| storage.size | string | `"300Gi"` | Storage volume size request | +| volumeMounts | list | `[]` | Additional volume mounts | +| volumes | list | `[]` | Additional volumes | diff --git a/aidboxdb/README.md.gotmpl b/aidboxdb/README.md.gotmpl new file mode 100644 index 0000000..28741ad --- /dev/null +++ b/aidboxdb/README.md.gotmpl @@ -0,0 +1,41 @@ +{{ template "chart.header" . }} + +[AidboxDB](https://docs.aidbox.app/storage-1/aidboxdb-image) is a specialized version of the open-source PostgreSQL database, tailored for use as the data storage backend for Aidbox. It serves various purposes, including initializing and operating as a master database for Aidbox, functioning as a streaming replica, optimizing FHIR search queries, and supporting backup and maintenance functionalities. + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +## Installation with the PostgreSQL default credentials + +```console +helm upgrade --install aidboxdb aidboxdb \ + --repo https://aidbox.github.io/helm-charts \ + --namespace postgres --create-namespace +``` + +It will install the AidboxDB with default credentials in the `postgres` namespace, creating that namespace if it doesn't already exist. + +## Installation using custom PostgreSQL config and/or environment variables + +Create values YAML like + +```yaml +config: |- + max_wal_size = '4GB' + shared_buffers = '2GB' + +env: + POSTGRES_USER: superuser + POSTGRES_PASSWORD: strongpassword +``` + +and apply it + +```console +helm upgrade --install aidboxdb aidboxdb \ + --repo https://aidbox.github.io/helm-charts \ + --namespace postgres --create-namespace \ + --values /path/to/values.yaml +``` + + +{{ template "chart.valuesSection" . }} diff --git a/aidboxdb/templates/configmap-env.yaml b/aidboxdb/templates/configmap-env.yaml index c501f05..9cfe4ea 100644 --- a/aidboxdb/templates/configmap-env.yaml +++ b/aidboxdb/templates/configmap-env.yaml @@ -5,5 +5,8 @@ metadata: labels: {{- include "aidboxdb.labels" . | nindent 4 }} data: - PGDATA: /data/pg - POSTGRES_DB: postgres + {{- range $key, $val := .Values.env }} + {{- if and (not (eq $key "POSTGRES_USER")) (not (eq $key "POSTGRES_PASSWORD")) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} diff --git a/aidboxdb/templates/configmap-files.yaml b/aidboxdb/templates/configmap-files.yaml index 80a36b7..4326a50 100644 --- a/aidboxdb/templates/configmap-files.yaml +++ b/aidboxdb/templates/configmap-files.yaml @@ -7,8 +7,6 @@ metadata: data: postgres.conf: |- listen_addresses = '*' - shared_buffers = {{ .Values.config.shared_buffers | squote }} - max_wal_size = {{ .Values.config.max_wal_size | squote }} pg_stat_statements.max = 500 pg_stat_statements.save = false pg_stat_statements.track = top @@ -19,3 +17,4 @@ data: wal_log_hints = on archive_command = 'wal-g wal-push %p' restore_command = 'wal-g wal-fetch %f %p' + {{- .Values.config | nindent 4 }} diff --git a/aidboxdb/templates/persistentvolumeclaim.yaml b/aidboxdb/templates/persistentvolumeclaim.yaml index f5167ce..3d7ea8e 100644 --- a/aidboxdb/templates/persistentvolumeclaim.yaml +++ b/aidboxdb/templates/persistentvolumeclaim.yaml @@ -9,7 +9,7 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ required "missing storageSize value" .Values.storageSize }} - {{- if .Values.storageClassName }} - storageClassName: {{ .Values.storageClassName }} + storage: {{ required "missing storage.size value" .Values.storage.size }} + {{- if .Values.storage.className }} + storageClassName: {{ .Values.storage.className }} {{- end }} diff --git a/aidboxdb/templates/secrets.yaml b/aidboxdb/templates/secrets.yaml index 4834c70..648dc11 100644 --- a/aidboxdb/templates/secrets.yaml +++ b/aidboxdb/templates/secrets.yaml @@ -6,5 +6,5 @@ metadata: {{- include "aidboxdb.labels" . | nindent 4 }} type: Opaque data: - POSTGRES_PASSWORD: {{ required "missing env.PGPASSWORD value" .Values.env.PGPASSWORD | b64enc }} - POSTGRES_USER: {{ required "missing env.PGUSER value" .Values.env.PGUSER | b64enc }} + POSTGRES_PASSWORD: {{ required "missing env.POSTGRES_PASSWORD value" .Values.env.POSTGRES_PASSWORD | b64enc }} + POSTGRES_USER: {{ required "missing env.POSTGRES_USER value" .Values.env.POSTGRES_USER | b64enc }} diff --git a/aidboxdb/values.yaml b/aidboxdb/values.yaml index a306225..6e3ab63 100644 --- a/aidboxdb/values.yaml +++ b/aidboxdb/values.yaml @@ -1,18 +1,27 @@ -config: - max_wal_size: 4GB - shared_buffers: 2GB +# -- PostgreSQL config +config: |- + max_wal_size = '4GB' + shared_buffers = '2GB' +# -- Environment variables +# @default -- [AidboxDB environment variables](https://docs.aidbox.app/reference/configuration/environment-variables/aidboxdb-environment-variables) env: - PGUSER: postgres - PGPASSWORD: postgres + PGDATA: /data/pg + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + POSTGRES_DB: postgres -storageClassName: "" -storageSize: 300Gi +storage: + # -- Storage className to use + className: "" + # -- Storage volume size request + size: 300Gi image: repository: healthsamurai/aidboxdb pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. + # -- Overrides the image tag whose default is the chart appVersion. + # Has one-to-one mapping to the PostgreSQL version. tag: "" imagePullSecrets: [] @@ -30,14 +39,14 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 -# Additional volumes on the output StatefulSet definition. +# -- Additional volumes volumes: [] # - name: foo # secret: # secretName: mysecret # optional: false -# Additional volumeMounts on the output StatefulSet definition. +# -- Additional volume mounts volumeMounts: [] # - name: foo # mountPath: "/etc/foo"