Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion helm/gen3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: global.dev

# helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/
# adds the hapi-fhir-jpaserver chart to the list of charts that can be installed
- name: hapi-fhir-jpaserver
version: 0.17.1
repository: "https://hapifhir.github.io/hapi-fhir-jpaserver-starter/"
condition: global.dev
- name: hapi-fhir-db-init
version: 0.1.0
repository: "file://../hapi-fhir-db-init"
condition: global.dev

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -117,7 +128,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.19
version: 0.1.20

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
23 changes: 23 additions & 0 deletions helm/hapi-fhir-db-init/.helmignore
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/
30 changes: 30 additions & 0 deletions helm/hapi-fhir-db-init/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
name: hapi-fhir-db-init
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"


dependencies:
- name: hapi-fhir-jpaserver
version: 0.17.1
repository: "https://hapifhir.github.io/hapi-fhir-jpaserver-starter/"
1 change: 1 addition & 0 deletions helm/hapi-fhir-db-init/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
62 changes: 62 additions & 0 deletions helm/hapi-fhir-db-init/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hapi-fhir-db-init.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 "hapi-fhir-db-init.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 "hapi-fhir-db-init.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "hapi-fhir-db-init.labels" -}}
helm.sh/chart: {{ include "hapi-fhir-db-init.chart" . }}
{{ include "hapi-fhir-db-init.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "hapi-fhir-db-init.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hapi-fhir-db-init.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "hapi-fhir-db-init.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hapi-fhir-db-init.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions helm/hapi-fhir-db-init/templates/db-init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ include "common.db-secret" . }}
---
{{ include "common.db_setup_job" . }}
---
{{ include "common.db_setup_sa" . }}
---
31 changes: 31 additions & 0 deletions helm/hapi-fhir-db-init/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Global configuration

# -- (map) Postgres database configuration. If db does not exist in postgres cluster and dbCreate is set ot true then these databases will be created for you
postgres:
# (bool) Whether the database should be restored from s3. Default to global.postgres.dbRestore
dbRestore: false
# -- (bool) Whether the database should be created. Default to global.postgres.dbCreate
dbCreate:
# -- (string) Hostname for postgres server. This is a service override, defaults to global.postgres.host
host:
# -- (string) Database name for postgres. This is a service override, defaults to <serviceName>-<releaseName>
database:
# -- (string) Username for postgres. This is a service override, defaults to <serviceName>-<releaseName>
username:
# -- (string) Port for Postgres.
port: "5432"
# -- (string) Password for Postgres. Will be autogenerated if left empty.
password:
# -- (string) Will create a Database for the individual service to help with developing it.
separate: false

# -- (map) External Secrets settings.
externalSecrets:
# -- (string) Will override the name of the aws secrets manager secret. Default is "Values.global.environment-.Chart.Name-creds"
dbcreds:
# -- (map) Secret information for External Secrets.
secrets:
# -- (str) AWS access key ID. Overrides global key.
awsAccessKeyId:
# -- (str) AWS secret access key ID. Overrides global key.
awsSecretAccessKey:
10 changes: 10 additions & 0 deletions helm/revproxy/gen3.nginx.conf/hapi-fhir-jpaserver-service.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
location /fhir/ {
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
send_timeout 600s;

# maintain the /fhir prefix in the proxied request
proxy_pass http://local-hapi-fhir-jpaserver.$namespace.svc.cluster.local:8080;
}