Skip to content

Commit 04fc277

Browse files
authored
Merge pull request #3 from LinuxForHealth/lee-main
version bumps and related changes
2 parents 06af9ad + da3766c commit 04fc277

14 files changed

+181
-258
lines changed

.github/workflows/chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Helm
2323
uses: azure/setup-helm@v3
2424
with:
25-
version: v3.7.1
25+
version: v3.10.3
2626

2727
- name: Install dependency repos
2828
run: |

.github/workflows/lint-and-test.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
fetch-depth: 0
4141

4242
- name: Set up Helm
43-
uses: azure/setup-helm@v1
43+
uses: azure/setup-helm@v3
4444
with:
45-
version: v3.7.1
45+
version: v3.10.3
4646

4747
- name: Run chart-testing (lint)
4848
run: |

charts/fhir-server/Chart.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
dependencies:
22
- name: postgresql
33
repository: https://charts.bitnami.com/bitnami
4-
version: 10.16.2
4+
version: 11.9.13
55
- name: keycloak
66
repository: https://codecentric.github.io/helm-charts
7-
version: 18.3.0
8-
digest: sha256:6608e389e9fecee483c76eb1f61534211e461c7c79140b2aaedcf8be9adc34a6
9-
generated: "2022-09-27T12:21:15.687118-04:00"
7+
version: 18.4.0
8+
digest: sha256:429523c822843b4d9bd76185bb7c2c87b40bbca7479bb1016aa5015b92d1f58f
9+
generated: "2023-01-17T16:25:52.14111-05:00"

charts/fhir-server/Chart.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: v2
22
description: Helm chart for the LinuxForHealth FHIR Server
33
name: fhir-server
4-
version: 0.8.3
4+
version: 0.9.0
55
appVersion: 5.1.1
66
dependencies:
77
- name: postgresql
8-
version: 10.16.2
8+
version: 11.9.13
99
repository: https://charts.bitnami.com/bitnami
1010
condition: postgresql.enabled
1111
- name: keycloak
@@ -29,3 +29,11 @@ annotations:
2929
description: bumped to LinuxForHealth version 5.1.1
3030
- kind: changed
3131
description: bumped to codecentric keycloak chart version 18.4.0
32+
- kind: changed
33+
description: bumped to bitnami postgresql chart version 11.9.13
34+
- kind: changed
35+
description: split db user creds in two; now uses separate admin user for schematool
36+
- kind: removed
37+
description: support for Db2 and all Db2-related values
38+
- kind: removed
39+
description: support for networking.k8s.io/v1/beta (kubernetes <1.19)

charts/fhir-server/README.md

+34-36
Large diffs are not rendered by default.

charts/fhir-server/README.md.gotmpl

+8-7
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,16 @@ In addition to providing a default FHIR server configuration named template, thi
9191

9292
The deployer can specify a custom search parameters named template which will be used in the generation of the `extension-search-parameters.json` file by overriding the `extensionSearchParametersTemplate` chart value.
9393

94-
The deployer can specify custom datasource named templates which will be used in the generation of the `datasource.xml` and `bulkdata.xml` files by overriding the `datasourcesTemplate` chart value. The default for this chart value is a datasources template for a Postgres database, but this helm chart also provides named templates for Db2, Db2 on Cloud, and Derby databases in the `_datasourcesXml.tpl` file.
94+
The deployer can specify custom datasource named templates which will be used in the generation of the `datasource.xml` and `bulkdata.xml` files by overriding the `datasourcesTemplate` chart value.
95+
The default for this chart value is a template with datasources for a single Postgres database.
9596

9697
## Using existing Secrets for sensitive data
9798

9899
This helm chart specifies chart values for the following pieces of sensitive data:
99100

100-
- Database password or api key:
101+
- Database user passwords:
102+
- `db.adminPassword`
101103
- `db.password`
102-
- `db.apiKey`
103104
- FHIR server user and admin passwords:
104105
- `fhirUserPassword`
105106
- `fhirAdminPassword`
@@ -113,13 +114,13 @@ These values can be specified directly in the `values.yaml` file, or the deploye
113114

114115
### Database password or api key
115116

116-
To have the `db.password` and `db.apiKey` values read from an existing Secret, the deployer must override the following chart values:
117+
To have the `db.adminPassword` and `db.password` values read from an existing Secret, the deployer must override the following chart values:
117118

118119
- `db.dbSecret` - this is set to the name of the Secret from which the database information will be read
119-
- `db.passwordSecretKey` - this is set to the key of the key/value pair within the Secret that contains the password
120-
- `db.apiKeySecretKey` - this is set to the key of the key/value pair within the Secret that contains the api key
120+
- `db.adminPasswordKey` - this is set to the key of the key/value pair within the Secret that contains the admin user password (for schema management)
121+
- `db.userPasswordKey` - this is set to the key of the key/value pair within the Secret that contains the fhir-server's user password
121122

122-
If the `db.dbSecret` value is set, this helm chart will only look in the specified Secret for the password and api key. The `db.password` and `db.apiKey` chart values will be ignored.
123+
If the `db.dbSecret` value is set, this helm chart will only look in the specified Secret for the passwords. The `db.adminPassword` and `db.password` chart values will be ignored.
123124

124125
### FHIR server user and admin passwords
125126

charts/fhir-server/templates/_datasourcesXml.tpl

-104
Original file line numberDiff line numberDiff line change
@@ -56,110 +56,6 @@ The datasource.xml file for a Postgres DB.
5656
</server>
5757
{{- end }}
5858

59-
{{/*
60-
The datasource.xml file for a Db2 DB.
61-
*/}}
62-
{{- define "defaultDb2Datasources" }}
63-
<server>
64-
<!-- ============================================================== -->
65-
<!-- TENANT: default; DSID: default; TYPE: read-write -->
66-
<!-- ============================================================== -->
67-
<dataSource id="fhirDefaultDefault" jndiName="jdbc/fhir_default_default" type="javax.sql.XADataSource" statementCacheSize="200" syncQueryTimeoutWithTransactionTimeout="true" validationTimeout="30s" isolationLevel="TRANSACTION_READ_COMMITTED">
68-
<jdbcDriver javax.sql.XADataSource="com.ibm.db2.jcc.DB2XADataSource" libraryRef="sharedLibDb2"/>
69-
<properties.db2.jcc
70-
sslConnection="${env.FHIR_DB_SSL}"
71-
serverName="${env.FHIR_DB_HOSTNAME}"
72-
portNumber="${env.FHIR_DB_PORT}"
73-
databaseName="${env.FHIR_DB_NAME}"
74-
user="${env.FHIR_DB_USER}"
75-
password="${env.FHIR_DB_PASSWORD}"
76-
currentSchema="${env.FHIR_DB_SCHEMA}"
77-
driverType="4"
78-
/>
79-
<connectionManager
80-
minPoolSize="${env.DS_MIN_POOL_SIZE}"
81-
maxPoolSize="${env.DS_MAX_POOL_SIZE}"
82-
agedTimeout="${env.DS_AGED_TIMEOUT}"
83-
connectionTimeout="60s"
84-
maxIdleTime="2m"
85-
/>
86-
</dataSource>
87-
88-
{{- if .Values.objectStorage.enabled }}
89-
<featureManager>
90-
<feature>batch-1.0</feature>
91-
<feature>batchManagement-1.0</feature>
92-
</featureManager>
93-
94-
<dataSource id="fhirbatchDS" jndiName="jdbc/fhirbatchDB" type="javax.sql.XADataSource" statementCacheSize="200" syncQueryTimeoutWithTransactionTimeout="true">
95-
<jdbcDriver javax.sql.XADataSource="com.ibm.db2.jcc.DB2XADataSource" libraryRef="sharedLibDb2"/>
96-
<properties.db2.jcc
97-
serverName="${env.BATCH_DB_HOSTNAME}"
98-
currentSchema="${env.BATCH_DB_SCHEMA}"
99-
databaseName="${env.BATCH_DB_NAME}"
100-
driverType="4"
101-
portNumber="${env.BATCH_DB_PORT}"
102-
sslConnection="${env.BATCH_DB_SSL}"
103-
user="${env.BATCH_DB_USER}"
104-
password="${env.BATCH_DB_PASS}"/>
105-
</dataSource>
106-
{{- end }}
107-
</server>
108-
{{- end }}
109-
110-
{{/*
111-
The datasource.xml file for a Db2 DB on Cloud.
112-
*/}}
113-
{{- define "defaultDb2CloudDatasources" }}
114-
<server>
115-
<!-- ============================================================== -->
116-
<!-- TENANT: default; DSID: default; TYPE: read-write -->
117-
<!-- ============================================================== -->
118-
<dataSource id="fhirDefaultDefault" jndiName="jdbc/fhir_default_default" type="javax.sql.XADataSource" statementCacheSize="200" syncQueryTimeoutWithTransactionTimeout="true" validationTimeout="30s" isolationLevel="TRANSACTION_READ_COMMITTED">
119-
<jdbcDriver javax.sql.XADataSource="com.ibm.db2.jcc.DB2XADataSource" libraryRef="sharedLibDb2"/>
120-
<properties.db2.jcc
121-
apiKey="${env.FHIR_DB_APIKEY}"
122-
serverName="${env.FHIR_DB_HOSTNAME}"
123-
currentSchema="${env.FHIR_DB_SCHEMA}"
124-
databaseName="${env.FHIR_DB_NAME}"
125-
driverType="4"
126-
pluginName="${env.FHIR_DB_PLUGIN}"
127-
portNumber="${env.FHIR_DB_PORT}"
128-
securityMechanism="${env.FHIR_DB_SECURITY}"
129-
sslConnection="${env.FHIR_DB_SSL}"
130-
/>
131-
<connectionManager
132-
minPoolSize="${env.DS_MIN_POOL_SIZE}"
133-
maxPoolSize="${env.DS_MAX_POOL_SIZE}"
134-
agedTimeout="${env.DS_AGED_TIMEOUT}"
135-
connectionTimeout="60s"
136-
maxIdleTime="2m"
137-
/>
138-
</dataSource>
139-
140-
{{- if .Values.objectStorage.enabled }}
141-
<featureManager>
142-
<feature>batch-1.0</feature>
143-
<feature>batchManagement-1.0</feature>
144-
</featureManager>
145-
146-
<dataSource id="fhirbatchDS" jndiName="jdbc/fhirbatchDB" type="javax.sql.XADataSource" statementCacheSize="200" syncQueryTimeoutWithTransactionTimeout="true">
147-
<jdbcDriver javax.sql.XADataSource="com.ibm.db2.jcc.DB2XADataSource" libraryRef="sharedLibDb2"/>
148-
<properties.db2.jcc
149-
apiKey="${env.BATCH_DB_APIKEY}"
150-
serverName="${env.BATCH_DB_HOSTNAME}"
151-
currentSchema="${env.BATCH_DB_SCHEMA}"
152-
databaseName="${env.BATCH_DB_NAME}"
153-
driverType="4"
154-
pluginName="${env.BATCH_DB_PLUGIN}"
155-
portNumber="${env.BATCH_DB_PORT}"
156-
securityMechanism="${env.BATCH_DB_SECURITY}"
157-
sslConnection="${env.BATCH_DB_SSL}"/>
158-
</dataSource>
159-
{{- end }}
160-
</server>
161-
{{- end }}
162-
16359
{{/*
16460
The datasource.xml file for a Derby DB.
16561
*/}}

charts/fhir-server/templates/_fhirServerConfigJson.tpl

-5
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ The default fhir-server-config.json.
136136
"from_collapse_limit": 12,
137137
"join_collapse_limit": 12
138138
}
139-
{{- else if eq .Values.db.type "db2" }}
140-
"tenantKey": "{{ .Values.db.tenantKey }}",
141-
"hints" : {
142-
"search.reopt": "ONCE"
143-
}
144139
{{- end }}
145140
}
146141
}

charts/fhir-server/templates/_helpers.tpl

+27-19
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ app.kubernetes.io/name: {{ include "fhir.name" . }}
5252
app.kubernetes.io/instance: {{ .Release.Name }}
5353
{{- end -}}
5454

55-
56-
{{/*
57-
Return the appropriate apiVersion for ingress.
58-
*/}}
59-
{{- define "fhir.ingressAPIVersion" -}}
60-
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
61-
{{- print "networking.k8s.io/v1" -}}
62-
{{- else -}}
63-
{{- print "networking.k8s.io/v1beta1" -}}
64-
{{- end -}}
65-
{{- end -}}
66-
6755
{{/*
6856
Create a default fully qualified PostgreSQL name.
6957
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
@@ -75,28 +63,35 @@ NOTE: we should be able to replace this approach once https://github.com/helm/he
7563
{{- end -}}
7664

7765
{{/*
78-
Get the database server's hostname
66+
Get the database server hostname
7967
*/}}
8068
{{- define "fhir.database.host" -}}
8169
{{- ternary (include "fhir.postgresql.fullname" .) .Values.db.host .Values.postgresql.enabled -}}
8270
{{- end -}}
8371

72+
{{/*
73+
Get the admin user to connect to the database server
74+
*/}}
75+
{{- define "fhir.database.adminUser" -}}
76+
{{- ternary "postgres" .Values.db.adminUser .Values.postgresql.enabled -}}
77+
{{- end -}}
78+
8479
{{/*
8580
Get the user to connect to the database server
8681
*/}}
8782
{{- define "fhir.database.user" -}}
88-
{{- ternary .Values.postgresql.postgresqlUsername .Values.db.user .Values.postgresql.enabled -}}
83+
{{- ternary .Values.postgresql.auth.username .Values.db.user .Values.postgresql.enabled -}}
8984
{{- end -}}
9085

9186
{{/*
9287
Get the name of the database
9388
*/}}
9489
{{- define "fhir.database.name" -}}
95-
{{- ternary .Values.postgresql.postgresqlDatabase .Values.db.name .Values.postgresql.enabled -}}
90+
{{- ternary .Values.postgresql.auth.database .Values.db.name .Values.postgresql.enabled -}}
9691
{{- end -}}
9792

9893
{{/*
99-
Get the database server's port
94+
Get the database server port
10095
*/}}
10196
{{- define "fhir.database.port" -}}
10297
{{- ternary "5432" .Values.db.port .Values.postgresql.enabled -}}
@@ -120,11 +115,24 @@ Get the database credentials secret name.
120115
{{/*
121116
Get the database credentials password secret key.
122117
*/}}
123-
{{- define "fhir.database.passwordSecretKey" -}}
118+
{{- define "fhir.database.adminPasswordKey" -}}
119+
{{- if .Values.postgresql.enabled }}
120+
{{- include "postgresql.adminPasswordKey" .Subcharts.postgresql }}
121+
{{- else if (.Values.db.dbSecret) -}}
122+
{{- printf "%s" .Values.db.adminPasswordKey -}}
123+
{{- else }}
124+
{{- printf "password" -}}
125+
{{- end -}}
126+
{{- end -}}
127+
128+
{{/*
129+
Get the database credentials password secret key.
130+
*/}}
131+
{{- define "fhir.database.userPasswordKey" -}}
124132
{{- if .Values.postgresql.enabled }}
125-
{{- printf "postgresql-password" -}}
133+
{{- include "postgresql.userPasswordKey" .Subcharts.postgresql }}
126134
{{- else if (.Values.db.dbSecret) -}}
127-
{{- printf "%s" .Values.db.passwordSecretKey -}}
135+
{{- printf "%s" .Values.db.userPasswordKey -}}
128136
{{- else }}
129137
{{- printf "password" -}}
130138
{{- end -}}

charts/fhir-server/templates/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ spec:
217217
valueFrom:
218218
secretKeyRef:
219219
name: "{{ include "fhir.database.secretName" $ }}"
220-
key: "{{ include "fhir.database.passwordSecretKey" $ }}"
220+
key: "{{ include "fhir.database.userPasswordKey" $ }}"
221221
{{- if ne .Values.db.type "postgresql" }}
222222
- name: FHIR_DB_APIKEY
223223
valueFrom:
@@ -258,7 +258,7 @@ spec:
258258
valueFrom:
259259
secretKeyRef:
260260
name: "{{ include "fhir.database.secretName" $ }}"
261-
key: "{{ include "fhir.database.passwordSecretKey" $ }}"
261+
key: "{{ include "fhir.database.userPasswordKey" $ }}"
262262
{{- if ne .Values.db.type "postgresql" }}
263263
- name: BATCH_DB_APIKEY
264264
valueFrom:

charts/fhir-server/templates/fhir-db-secret.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ metadata:
88
{{- include "fhir.labels" . | nindent 4 }}
99
type: Opaque
1010
data:
11-
{{- if .Values.db.password }}
12-
password: {{ .Values.db.password | b64enc }}
11+
{{- if .Values.db.adminPassword }}
12+
postgres-password: {{ .Values.db.adminPassword | b64enc | quote }}
1313
{{- end }}
14-
{{- if .Values.db.apiKey }}
15-
apiKey: {{ .Values.db.apiKey | b64enc }}
14+
{{- if .Values.db.password }}
15+
password: {{ .Values.db.password | b64enc | quote }}
1616
{{- end }}
1717
{{- end }}
1818
{{- end }}

charts/fhir-server/templates/ingress.yaml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- $ingress := .Values.ingress -}}
22
{{- if $ingress.enabled -}}
3-
apiVersion: {{ template "fhir.ingressAPIVersion" . }}
3+
apiVersion: networking.k8s.io/v1
44
kind: Ingress
55
metadata:
66
name: {{ template "fhir.fullname" . }}
@@ -23,18 +23,12 @@ spec:
2323
paths:
2424
{{- range .paths }}
2525
- path: {{ .path }}
26-
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
2726
pathType: {{ .pathType }}
2827
backend:
2928
service:
3029
name: {{ template "fhir.fullname" $ }}
3130
port:
3231
name: {{ $ingress.servicePort }}
33-
{{- else }}
34-
backend:
35-
serviceName: {{ template "fhir.fullname" $ }}
36-
servicePort: {{ $ingress.servicePort }}
37-
{{- end }}
3832
{{- end }}
3933
{{- end }}
4034
{{- if $ingress.tls }}

0 commit comments

Comments
 (0)