Skip to content
Merged
2 changes: 1 addition & 1 deletion helm/blueapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ A Helm chart deploying a worker pod that runs Bluesky plans
| startupProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/healthz","port":"http"},"periodSeconds":10}` | A more lenient livenessProbe to allow the service to start fully. This is automatically disabled when in debug mode. |
| tolerations | list | `[]` | May be required to run on specific nodes (e.g. the control machine) |
| tracing | object | `{"fastapi":{"excludedURLs":"/healthz"},"otlp":{"enabled":false,"protocol":"http/protobuf","server":{"host":"http://opentelemetry-collector.tracing","port":4318}}}` | Exclude health probe requests from tracing by default to prevent spamming |
| volumeMounts | list | `[{"mountPath":"/config","name":"worker-config","readOnly":true}]` | Additional volumeMounts on the output StatefulSet definition. Define how volumes are mounted to the container referenced by using the same name. |
| volumeMounts | list | `[]` | Additional volumeMounts on the output StatefulSet definition. Define how volumes are mounted to the container referenced by using the same name. |
| volumes | list | `[]` | Additional volumes on the output StatefulSet definition. Define volumes from e.g. Secrets, ConfigMaps or the Filesystem |
| worker | object | `{"api":{"url":"http://0.0.0.0:8000/"},"env":{"sources":[{"kind":"planFunctions","module":"dodal.plans"},{"kind":"planFunctions","module":"dodal.plan_stubs.wrapped"}]},"logging":{"graylog":{"enabled":false,"url":"tcp://graylog-log-target.diamond.ac.uk:12231/"},"level":"INFO"},"scratch":{"repositories":[],"root":"/workspace"},"stomp":{"auth":{"password":"guest","username":"guest"},"enabled":false,"url":"tcp://rabbitmq:61613/"}}` | Config for the worker goes here, will be mounted into a config file |
| worker.api.url | string | `"http://0.0.0.0:8000/"` | 0.0.0.0 required to allow non-loopback traffic If using hostNetwork, the port must be free on the host |
Expand Down
3 changes: 3 additions & 0 deletions helm/blueapi/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: worker-config
mountPath: "/config"
readOnly: true
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
16 changes: 1 addition & 15 deletions helm/blueapi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,21 +334,7 @@
},
"volumeMounts": {
"description": "Additional volumeMounts on the output StatefulSet definition. Define how volumes are mounted to the container referenced by using the same name.",
"type": "array",
"items": {
"type": "object",
"properties": {
"mountPath": {
"type": "string"
},
"name": {
"type": "string"
},
"readOnly": {
"type": "boolean"
}
}
}
"type": "array"
},
"volumes": {
"description": "Additional volumes on the output StatefulSet definition. Define volumes from e.g. Secrets, ConfigMaps or the Filesystem",
Expand Down
16 changes: 10 additions & 6 deletions helm/blueapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ podAnnotations: {}
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podLabels: {}

podSecurityContext: {}
# fsGroup: 2000
podSecurityContext: {} # fsGroup: 2000

securityContext:
# https://github.com/DiamondLightSource/blueapi/issues/1096
Expand Down Expand Up @@ -131,13 +130,18 @@ startupProbe:
# -- Additional volumes on the output StatefulSet definition.
# Define volumes from e.g. Secrets, ConfigMaps or the Filesystem
volumes: []
# - name: dls-sw-bl
# hostPath:
# path: "/dls_sw/i23"
# type: Directory

# -- Additional volumeMounts on the output StatefulSet definition.
# Define how volumes are mounted to the container referenced by using the same name.
volumeMounts:
- name: worker-config
mountPath: "/config"
readOnly: true
volumeMounts: []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add a commented-out example of a volumeMount, as per extraEnvVars in the same file. That way people can see what to expect.

# - name: dls-sw-bl
# mountPath: /dls_sw/i23
# readOnly: true
# mountPropagation: HostToContainer

# -- May be required to run on specific nodes (e.g. the control machine)
nodeSelector: {}
Expand Down
13 changes: 9 additions & 4 deletions tests/unit_tests/test_helm_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ def test_service_linked_to_api(worker_api_url: str | None, service_port: int):

@pytest.mark.parametrize(
"added_mounts",
[[{"name": "worker-config", "mountPath": "/config", "readOnly": True}], [], None],
[[{"name": "foo", "mountPath": "/bar", "readOnly": True}], [], None],
)
@pytest.mark.parametrize(
"added_volumes", [[{"name": "foo", "configMap": {"name": "bar"}}], [], None]
Expand All @@ -1218,6 +1218,13 @@ def test_volumes_created(
manifests = render_chart(
values={"volumes": added_volumes, "volumeMounts": added_mounts}
)
expected_mounts = [
{
"name": "worker-config",
"mountPath": "/config",
"readOnly": True,
}
]

expected_volumes = [
{
Expand All @@ -1229,9 +1236,7 @@ def test_volumes_created(
if added_volumes:
expected_volumes += added_volumes
if added_mounts:
expected_mounts = added_mounts
else:
expected_mounts = None
expected_mounts += added_mounts

container_mounts = manifests["StatefulSet"]["blueapi"]["spec"]["template"]["spec"][
"containers"
Expand Down
Loading