Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
faridco committed Apr 9, 2024
1 parent c93287f commit f03f775
Show file tree
Hide file tree
Showing 16 changed files with 281 additions and 50 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Aidbox helm charts

This repository hosts Helm charts designed to simplify the deployment process of [Aidbox](https://docs.aidbox.app/) and [AidboxDB](https://docs.aidbox.app/storage-1/aidboxdb-image) in Kubernetes for Aidbox customers. Aidbox, a robust and scalable FHIR server, empowers healthcare providers and developers to manage healthcare data efficiently.

Our Helm charts streamline the deployment process, enabling easy configuration and customization while ensuring a seamless deployment experience within Kubernetes clusters. Whether you're a healthcare institution, developer, or DevOps engineer, these Helm charts provide a straightforward path to deploying Aidbox in your Kubernetes environment.

To get started, simply browse the collections below and follow the easy deployment instructions.

- [Aidbox](./aidbox)
- [AidboxDB](./aidboxdb)
6 changes: 4 additions & 2 deletions aidbox/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: v2
appVersion: edge
description: Aidbox
description: Aidbox is FHIR backend platform by Health Samurai
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.5
82 changes: 82 additions & 0 deletions aidbox/README.md
Original file line number Diff line number Diff line change
@@ -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.5](https://img.shields.io/badge/Version-0.1.5-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: <your host here, e.g. my.domain.tld>
protocol: <http or https>

config:
AIDBOX_FHIR_VERSION: <FHIR version, e.g. 4.0.0>
PGHOST: <PostgreSQL host to connect to>
PGDATABASE: <name of the database that is used to store resources>
PGUSER: <PostgreSQL user>
PGPASSWORD: <PostgreSQL password>
AIDBOX_CLIENT_ID: <root client resource id to create on startup>
AIDBOX_CLIENT_SECRET: <secret for the root client>
AIDBOX_ADMIN_ID: <root user resource id to create on startup>
AIDBOX_ADMIN_PASSWORD: <password for the root user>
AIDBOX_LICENSE: <license JWT obtained from the license server>
```
```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 | `[]` | |
38 changes: 38 additions & 0 deletions aidbox/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -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: <your host here, e.g. my.domain.tld>
protocol: <http or https>

config:
AIDBOX_FHIR_VERSION: <FHIR version, e.g. 4.0.0>
PGHOST: <PostgreSQL host to connect to>
PGDATABASE: <name of the database that is used to store resources>
PGUSER: <PostgreSQL user>
PGPASSWORD: <PostgreSQL password>
AIDBOX_CLIENT_ID: <root client resource id to create on startup>
AIDBOX_CLIENT_SECRET: <secret for the root client>
AIDBOX_ADMIN_ID: <root user resource id to create on startup>
AIDBOX_ADMIN_PASSWORD: <password for the root user>
AIDBOX_LICENSE: <license JWT obtained from the license server>
```


```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" . }}
4 changes: 3 additions & 1 deletion aidbox/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion aidbox/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
17 changes: 8 additions & 9 deletions aidbox/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
20 changes: 4 additions & 16 deletions aidbox/values.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions aidboxdb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: v2
appVersion: "16.1"
description: AidboxDB
description: AidboxDB is based on the official PostgreSQL and contains additional tools
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.5
57 changes: 57 additions & 0 deletions aidboxdb/README.md
Original file line number Diff line number Diff line change
@@ -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.5](https://img.shields.io/badge/Version-0.1.5-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 |
41 changes: 41 additions & 0 deletions aidboxdb/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -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" . }}
7 changes: 5 additions & 2 deletions aidboxdb/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 1 addition & 2 deletions aidboxdb/templates/configmap-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
6 changes: 3 additions & 3 deletions aidboxdb/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions aidboxdb/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading

0 comments on commit f03f775

Please sign in to comment.