Repository navigation
Helm chart: naming, labels, security context, lint #82
Copy link
Copy link
Closed
Labels
priority: lowLow priorityLow prioritytype: deliveryRelated to packaging, deployment etc.Related to packaging, deployment etc.type: securityRelated to securityRelated to securityworkload: daysLikely takes days to resolveLikely takes days to resolve
Description
Why?
Apart from configuration (#67) and MongoDB (#68), the Helm chart in deployment/ does not follow common chart conventions, which makes it hard to install twice in one namespace, to review, and to run on hardened clusters:
- Resource names are hard-coded (
mongodbfor the Deployment, Service and PVC;mongo-init-script;app-config) or taken fromcloud_registry.appName, instead of being derived from the release name, so two releases in one namespace collide. - No standard labels (
app.kubernetes.io/name,instance,version,managed-by,helm.sh/chart); selectors use a plainapplabel. securityContext: {}: norunAsNonRoot, dropped capabilities or read-only root filesystem.- The Ingress has no
ingressClassNameand no way to add annotations other than the cert-manager ones. NOTES.txtalways printshttps://URLs, even withingress.https.enabled: false, and printshttps:///...ifhost_nameis empty; the examplecurlsends a token, which reads no longer need after Cloud Registry backend: public read access, service ownership, ECP_CLN:ADMIN admin role #62.- If
ingress.enabledisfalseon a cluster without the OpenShift Route API,cloud-registry-route.yamlrenders nothing, so the app is silently not exposed. - No
values.schema.json, and the chart is not linted or rendered in CI.Chart.yamlhas the default description "A Helm chart for Kubernetes".
How?
- Add
_helpers.tplwithfullname,labelsandselectorLabelshelpers; derive all names from them; reference the MongoDB service name in the app config through the helper (with Helm chart: configure app via values and FOCA overlays #67). - Add a configurable
securityContext/podSecurityContextwith safe defaults that also work on OpenShift. - Ingress:
classNameand free-formannotationsin values. - NOTES: use the right scheme, warn if
host_nameis empty, and warn if neither an Ingress nor a Route is rendered. - Add
values.schema.json; runhelm lintandhelm templatein CI. - Alternatively, implement this in the shared FOCA library chart proposed in Shared Helm library chart for FOCA apps foca#312 and make this chart a thin wrapper.
Changing names and selectors changes immutable fields, so existing releases need a documented migration (reinstall, keeping the MongoDB PVC).
Acceptance criteria
- Two releases can be installed in the same namespace.
-
helm lintandhelm templatewith test values pass in CI. - Pods run as non-root with dropped capabilities.
- NOTES are correct for HTTP, HTTPS, empty host and no-ingress cases.
Dependencies: #67 and #68; possibly superseded by elixir-cloud-aai/foca#312.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: lowLow priorityLow prioritytype: deliveryRelated to packaging, deployment etc.Related to packaging, deployment etc.type: securityRelated to securityRelated to securityworkload: daysLikely takes days to resolveLikely takes days to resolve
Activity
uniqueg commentedon Oct 20, 2026
Update (2026-10-20): this will be done in this repository before this week's redeploy, not via the shared library chart (elixir-cloud-aai/foca#312, which can absorb it later). The redeploy is a fresh install, so renaming resources and changing selectors costs nothing now but would need a migration later.
A semgrep scan of the rendered chart (
p/kubernetes) found that both the app and MongoDB containers run with a writable root filesystem; the security context (step 2) should setreadOnlyRootFilesystem: true, with writableemptyDirvolumes where needed (e.g.,/tmp, MongoDB's data and socket directories).feat!: follow Helm chart conventions (#109)