161 lines
6.2 KiB
YAML
161 lines
6.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "hapi-fhir-jpaserver.fullname" . }}
|
|
labels:
|
|
{{- include "hapi-fhir-jpaserver.labels" . | nindent 4 }}
|
|
{{- with .Values.deploymentAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "hapi-fhir-jpaserver.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "hapi-fhir-jpaserver.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "hapi-fhir-jpaserver.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
initContainers:
|
|
- name: wait-for-db-to-be-ready
|
|
image: docker.io/bitnami/postgresql:17.2.0-debian-12-r3@sha256:4de5c47eb98dd8fe09abdcbc2264984486ee8196e90902fb354f5d2ab97e8921
|
|
imagePullPolicy: IfNotPresent
|
|
{{- with .Values.restrictedContainerSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.initContainers.resources }}
|
|
resources: {{- toYaml .Values.initContainers.resources | nindent 12 }}
|
|
{{- else if ne .Values.initContainers.resourcesPreset "none" }}
|
|
resources: {{- include "common.resources.preset" (dict "type" .Values.initContainers.resourcesPreset) | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: PGHOST
|
|
value: "{{ include "hapi-fhir-jpaserver.database.host" . }}"
|
|
- name: PGPORT
|
|
value: "{{ include "hapi-fhir-jpaserver.database.port" . }}"
|
|
- name: PGUSER
|
|
value: "{{ include "hapi-fhir-jpaserver.database.user" . }}"
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
until pg_isready; do
|
|
echo "Waiting for DB ${PGUSER}@${PGHOST}:${PGPORT} to be up";
|
|
sleep 15;
|
|
done;
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
protocol: TCP
|
|
- name: http-metrics
|
|
containerPort: 8081
|
|
protocol: TCP
|
|
{{- with .Values.startupProbe }}
|
|
startupProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.resources }}
|
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
|
{{- else if ne .Values.resourcesPreset "none" }}
|
|
resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: SPRING_DATASOURCE_URL
|
|
value: {{ include "hapi-fhir-jpaserver.database.jdbcUrl" $ }}
|
|
- name: SPRING_DATASOURCE_USERNAME
|
|
value: {{ include "hapi-fhir-jpaserver.database.user" $ }}
|
|
- name: SPRING_DATASOURCE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "hapi-fhir-jpaserver.postgresql.secretName" . }}
|
|
key: {{ include "hapi-fhir-jpaserver.postgresql.secretKey" . }}
|
|
- name: SPRING_DATASOURCE_DRIVERCLASSNAME
|
|
value: org.postgresql.Driver
|
|
- name: spring.jpa.properties.hibernate.dialect
|
|
value: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect
|
|
- name: HAPI_FHIR_USE_APACHE_ADDRESS_STRATEGY
|
|
value: "true"
|
|
- name: MANAGEMENT_ENDPOINT_HEALTH_PROBES_ADD_ADDITIONAL_PATHS
|
|
value: "true"
|
|
- name: MANAGEMENT_SERVER_PORT
|
|
value: "8081"
|
|
- name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE
|
|
value: "health,prometheus"
|
|
{{- if .Values.extraConfig }}
|
|
- name: SPRING_CONFIG_IMPORT
|
|
value: "/app/config/application-extra.yaml"
|
|
{{- end }}
|
|
{{- if .Values.extraEnv }}
|
|
{{ toYaml .Values.extraEnv | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- mountPath: /tmp
|
|
name: tmp-volume
|
|
- mountPath: /app/target
|
|
name: lucenefiles-volume
|
|
{{- if .Values.extraConfig }}
|
|
- name: application-extra-config
|
|
mountPath: /app/config/application-extra.yaml
|
|
readOnly: true
|
|
subPath: application-extra.yaml
|
|
{{- end }}
|
|
{{- if .Values.extraVolumeMounts }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: tmp-volume
|
|
emptyDir: {}
|
|
- name: lucenefiles-volume
|
|
emptyDir: {}
|
|
{{- if .Values.extraConfig }}
|
|
- name: application-extra-config
|
|
configMap:
|
|
name: {{ include "hapi-fhir-jpaserver.fullname" . }}-application-config
|
|
{{- end }}
|
|
{{- if .Values.extraVolumes }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
|
|
{{- end }}
|