fix: updated label match, added test

This commit is contained in:
Jörn Guy Süß 2025-07-16 11:06:00 +10:00
parent 410dd003f7
commit 0bb3ba7e82
2 changed files with 40 additions and 63 deletions

View File

@ -10,6 +10,9 @@ spec:
strategy: strategy:
type: Recreate type: Recreate
template: template:
metadata:
labels:
io.kompose.service: fhirflare
spec: spec:
containers: containers:
- args: - args:
@ -34,4 +37,10 @@ spec:
ports: ports:
- containerPort: 5000 - containerPort: 5000
protocol: TCP protocol: TCP
restartPolicy: Always volumeMounts:
- name: logs
mountPath: /app/logs
restartPolicy: Always
volumes:
- name: logs
emptyDir: {}

View File

@ -1,73 +1,41 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: "{{ include "hapi-fhir-jpaserver.fullname" . }}-test-endpoints" name: "{{ .Release.Name }}-fhirflare-test-endpoint"
labels: labels:
{{- include "hapi-fhir-jpaserver.labels" . | nindent 4 }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{ include "hapi-fhir-jpaserver.fullname" . }}-client: "true" app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: tests app.kubernetes.io/component: tests
annotations: annotations:
"helm.sh/hook": test "helm.sh/hook": test
spec: spec:
restartPolicy: Never restartPolicy: Never
automountServiceAccountToken: {{ .Values.tests.automountServiceAccountToken }}
securityContext:
{{- toYaml .Values.tests.podSecurityContext | nindent 4 }}
containers: containers:
- name: test-metadata-endpoint - name: test-fhirflare-endpoint
image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}" image: curlimages/curl:8.12.1
command: ["curl", "--fail-with-body"] command: ["curl", "--fail-with-body", "--retry", "5", "--retry-delay", "10"]
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/metadata?_summary=true"] args: ["http://fhirflare:5000"]
{{- with .Values.restrictedContainerSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 8 }} allowPrivilegeEscalation: false
{{- end }} capabilities:
{{- if .Values.tests.resources }} drop:
resources: {{- toYaml .Values.tests.resources | nindent 10 }} - ALL
{{- else if ne .Values.tests.resourcesPreset "none" }} privileged: false
resources: {{- include "common.resources.preset" (dict "type" .Values.tests.resourcesPreset) | nindent 10 }} readOnlyRootFilesystem: true
{{- end }} runAsGroup: 65534
livenessProbe: runAsNonRoot: true
exec: runAsUser: 65534
command: ["true"] seccompProfile:
readinessProbe: type: RuntimeDefault
exec: resources:
command: ["true"] limits:
- name: test-patient-endpoint cpu: 150m
image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}" ephemeral-storage: 2Gi
command: ["curl", "--fail-with-body"] memory: 192Mi
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/Patient?_count=1&_summary=true"] requests:
{{- with .Values.restrictedContainerSecurityContext }} cpu: 100m
securityContext: ephemeral-storage: 50Mi
{{- toYaml . | nindent 8 }} memory: 128Mi
{{- end }}
{{- if .Values.tests.resources }}
resources: {{- toYaml .Values.tests.resources | nindent 10 }}
{{- else if ne .Values.tests.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.tests.resourcesPreset) | nindent 10 }}
{{- end }}
livenessProbe:
exec:
command: ["true"]
readinessProbe:
exec:
command: ["true"]
- name: test-metrics-endpoint
image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}"
command: ["curl", "--fail-with-body"]
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.metrics.service.port }}/actuator/prometheus"]
{{- with .Values.restrictedContainerSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.tests.resources }}
resources: {{- toYaml .Values.tests.resources | nindent 10 }}
{{- else if ne .Values.tests.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.tests.resourcesPreset) | nindent 10 }}
{{- end }}
livenessProbe:
exec:
command: ["true"]
readinessProbe:
exec:
command: ["true"]