Skip to content

Commit 7cdff43

Browse files
authored
Merge pull request #13 from aehrc/fix/statefulset-pmp-otel-exporters-serverport
fix(ontoserver): expose podManagementPolicy and OTel exporters, restore empty serverPort default
2 parents 2a65ca5 + 12f9c78 commit 7cdff43

10 files changed

Lines changed: 206 additions & 81 deletions

File tree

charts/ontoserver/README.md

Lines changed: 106 additions & 76 deletions
Large diffs are not rendered by default.

charts/ontoserver/examples/local/single-ro.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
ontoserver:
2222
serverName: localhost
23+
# Matches the port-forward above, so the CapabilityStatement and canonical URLs
24+
# advertise http://localhost:8080/... Remove this when serving on port 80/443.
25+
serverPort: "8080"
2326
hostNames:
2427
- localhost
2528

charts/ontoserver/examples/local/single-rw.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
ontoserver:
2424
serverName: localhost
25+
# Matches the port-forward above, so the CapabilityStatement and canonical URLs
26+
# advertise http://localhost:8080/... Remove this when serving on port 80/443.
27+
serverPort: "8080"
2528
hostNames:
2629
- localhost
2730

charts/ontoserver/templates/opentelemetry-instrumentation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spec:
2020
value: {{ .Values.ontoserver.opentelemetry.instrumentation.exporter.endpoint | quote }}
2121
{{- end }}
2222
- name: OTEL_METRICS_EXPORTER
23-
value: "none"
23+
value: {{ .Values.ontoserver.opentelemetry.instrumentation.metricsExporter | quote }}
2424
- name: OTEL_LOGS_EXPORTER
25-
value: "none"
25+
value: {{ .Values.ontoserver.opentelemetry.instrumentation.logsExporter | quote }}
2626
- name: OTEL_PROPAGATORS
2727
value: {{ .Values.ontoserver.opentelemetry.instrumentation.propagators | quote }}
2828
- name: OTEL_INSTRUMENTATION_COMMON_ENDUSER_ENABLED

charts/ontoserver/templates/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
{{- fail (printf "ontoserver.deployment.type must be one of the following: 'single', 'scaled'. Got: '%s'" .Values.ontoserver.deployment.type) }}
2727
{{- end }}
2828
replicas: {{ .Values.ontoserver.deployment.replicas }}
29-
podManagementPolicy: Parallel
29+
podManagementPolicy: {{ .Values.ontoserver.deployment.podManagementPolicy }}
3030
serviceName: {{ .Release.Name }}-ontoserver-headless
3131
selector:
3232
matchLabels:

charts/ontoserver/tests/deployment_test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,34 @@ tests:
1515
path: spec.replicas
1616
value: 1
1717

18+
- it: omits a port from the published base URLs by default
19+
asserts:
20+
- contains:
21+
path: spec.template.spec.containers[0].env
22+
content:
23+
name: ontoserver.fhir.base
24+
value: http://localhost/fhir
25+
- contains:
26+
path: spec.template.spec.containers[0].env
27+
content:
28+
name: ontoserver.synd.base
29+
value: http://localhost/synd
30+
31+
- it: appends serverPort to the published base URLs when set
32+
set:
33+
ontoserver.serverPort: "8080"
34+
asserts:
35+
- contains:
36+
path: spec.template.spec.containers[0].env
37+
content:
38+
name: ontoserver.fhir.base
39+
value: http://localhost:8080/fhir
40+
- contains:
41+
path: spec.template.spec.containers[0].env
42+
content:
43+
name: ontoserver.formats.html.base
44+
value: http://localhost:8080/static
45+
1846
- it: sets replicas from values
1947
set:
2048
ontoserver.deployment.replicas: 0

charts/ontoserver/tests/optional_features_test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,36 @@ tests:
6464
- equal:
6565
path: spec.exporter.endpoint
6666
value: "http://jaeger:4317"
67+
- contains:
68+
path: spec.java.env
69+
content:
70+
name: OTEL_METRICS_EXPORTER
71+
value: "none"
72+
- contains:
73+
path: spec.java.env
74+
content:
75+
name: OTEL_LOGS_EXPORTER
76+
value: "none"
77+
78+
- it: honours metricsExporter and logsExporter overrides
79+
templates:
80+
- templates/opentelemetry-instrumentation.yaml
81+
set:
82+
ontoserver.opentelemetry.instrumentation.enabled: true
83+
ontoserver.opentelemetry.instrumentation.exporter.endpoint: "http://collector:4317"
84+
ontoserver.opentelemetry.instrumentation.metricsExporter: otlp
85+
ontoserver.opentelemetry.instrumentation.logsExporter: otlp
86+
asserts:
87+
- contains:
88+
path: spec.java.env
89+
content:
90+
name: OTEL_METRICS_EXPORTER
91+
value: "otlp"
92+
- contains:
93+
path: spec.java.env
94+
content:
95+
name: OTEL_LOGS_EXPORTER
96+
value: "otlp"
6797

6898
- it: renders no Envoy policies by default
6999
templates:

charts/ontoserver/tests/statefulset_test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ tests:
2525
path: spec.podManagementPolicy
2626
value: Parallel
2727

28+
- it: honours a podManagementPolicy override
29+
set:
30+
ontoserver.deployment.kind: StatefulSet
31+
ontoserver.deployment.podManagementPolicy: OrderedReady
32+
asserts:
33+
- equal:
34+
path: spec.podManagementPolicy
35+
value: OrderedReady
36+
2837
- it: sets serviceName to headless service
2938
set:
3039
ontoserver.deployment.kind: StatefulSet

charts/ontoserver/values.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
"type": "integer",
5454
"minimum": 0
5555
},
56+
"podManagementPolicy": {
57+
"type": "string",
58+
"enum": [
59+
"Parallel",
60+
"OrderedReady"
61+
],
62+
"description": "StatefulSet pod management policy. Parallel does not wait for Ready before replacing the next pod; OrderedReady does. Immutable on a live StatefulSet."
63+
},
5664
"clusterName": {
5765
"type": "string"
5866
},
@@ -653,6 +661,14 @@
653661
"excludedClasses": {
654662
"type": "string"
655663
},
664+
"metricsExporter": {
665+
"type": "string",
666+
"description": "OTEL_METRICS_EXPORTER for the Java agent (e.g. otlp, prometheus, none)."
667+
},
668+
"logsExporter": {
669+
"type": "string",
670+
"description": "OTEL_LOGS_EXPORTER for the Java agent (e.g. otlp, none)."
671+
},
656672
"exporter": {
657673
"type": "object",
658674
"properties": {

charts/ontoserver/values.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ontoserver:
2828
allowScaledReadWrite: false
2929
## @param ontoserver.deployment.replicas Number of replicas - min 2 for scaled deployment - can be set to 0
3030
replicas: 1
31+
## @param ontoserver.deployment.podManagementPolicy StatefulSet pod management policy (Parallel or OrderedReady); ignored when kind is Deployment. Parallel starts and replaces pods without waiting for Ready, so a multi-replica rolling update can leave the Service with no ready endpoint; OrderedReady waits for each pod to become Ready first. Immutable on a live StatefulSet - see the README for the --cascade=orphan recreate.
32+
podManagementPolicy: Parallel
3133
## @param ontoserver.deployment.clusterName Cluster name for auto-discovery in scaled deployments (overrides the default "ontoserver" set in application.properties); ignored for single deployments
3234
clusterName: ""
3335
## @param ontoserver.deployment.annotations Deployment/Statefulset manifest annotations
@@ -199,7 +201,7 @@ ontoserver:
199201
## @param ontoserver.serverName Server hostname - must match a hostName at ontoserver.hostNames
200202
serverName: localhost
201203
## @param ontoserver.serverPort Non-standard port exposed to clients (e.g. 8080 when port-forwarding or k3d maps 8080:80). Leave empty for standard ports (80/443).
202-
serverPort: "8080"
204+
serverPort: ""
203205
## @param ontoserver.hostNames Hostnames for ingress/gateway
204206
hostNames:
205207
- localhost
@@ -318,8 +320,12 @@ ontoserver:
318320
propagators: "tracecontext,baggage,b3multi"
319321
## @param ontoserver.opentelemetry.instrumentation.excludedClasses Classes to exclude from instrumentation
320322
excludedClasses: "ca.uhn.fhir.*Interceptor*"
323+
## @param ontoserver.opentelemetry.instrumentation.metricsExporter OTEL_METRICS_EXPORTER for the Java agent (e.g. otlp for JVM heap and GC metrics, or none to disable)
324+
metricsExporter: "none"
325+
## @param ontoserver.opentelemetry.instrumentation.logsExporter OTEL_LOGS_EXPORTER for the Java agent (e.g. otlp, or none to disable)
326+
logsExporter: "none"
321327
exporter:
322-
## @param ontoserver.opentelemetry.instrumentation.exporter.type Exporter type (zipkin, otlp, etc.)
328+
## @param ontoserver.opentelemetry.instrumentation.exporter.type Trace exporter type (OTEL_TRACES_EXPORTER - zipkin, otlp, etc.)
323329
type: zipkin
324330
## @param ontoserver.opentelemetry.instrumentation.exporter.endpoint Exporter endpoint URL (required when enabled)
325331
endpoint: ""

0 commit comments

Comments
 (0)