diff --git a/helm/flowforge/README.md b/helm/flowforge/README.md index c37c8f7c..58e43a3e 100644 --- a/helm/flowforge/README.md +++ b/helm/flowforge/README.md @@ -35,6 +35,7 @@ For other values please refer to the documentation below. - `forge.projectNetworkPolicy.enabled` specified if [Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) should be created for project pods ( default `false`) - `forge.projectNetworkPolicy.ingress` a list of ingress rules for the [Network Policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) applied on project pods ( default `[]`) - `forge.projectNetworkPolicy.egress` a list of egress rules for the [Network Policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) applied in project pods ( default `[]`) + - `forge.projectIngressAnnotations` ingress annotations for project instances (default is `{}`) - `forge.managementSelector` a collection of labels and values to filter nodes the Forge App will run on (default `role: management`) - `forge.affinity` allows to configure [affinity or anti-affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) for the core application pod - `forge.license` FlowForge EE license string (optional, default not set) diff --git a/helm/flowforge/templates/deployment.yaml b/helm/flowforge/templates/deployment.yaml index 326fd02c..d0741c99 100644 --- a/helm/flowforge/templates/deployment.yaml +++ b/helm/flowforge/templates/deployment.yaml @@ -87,7 +87,10 @@ spec: {{ end -}} imagePullPolicy: Always env: - {{- if .Values.ingress.annotations }} + {{- if .Values.forge.projectIngressAnnotations }} + - name: INGRESS_ANNOTATIONS + value: {{ .Values.forge.projectIngressAnnotations | toJson | quote }} + {{- else if .Values.ingress.annotations }} - name: INGRESS_ANNOTATIONS value: {{ .Values.ingress.annotations | toJson | quote }} {{- end }} diff --git a/helm/flowforge/tests/deployment_test.yaml b/helm/flowforge/tests/deployment_test.yaml index dff7e16f..2015d2b1 100644 --- a/helm/flowforge/tests/deployment_test.yaml +++ b/helm/flowforge/tests/deployment_test.yaml @@ -13,6 +13,7 @@ tests: count: 1 - isKind: of: Deployment + - it: should create a deployment with init container template: deployment.yaml asserts: @@ -38,4 +39,37 @@ tests: value: SMTPPASSWORD - equal: path: spec.template.spec.initContainers[0].env[*].valueFrom.secretKeyRef.name - value: flowfuse-secrets \ No newline at end of file + value: flowfuse-secrets + + - it: should create a deployment without INGRESS_ANNOTATIONS environmental variable + template: deployment.yaml + asserts: + - notExists: + path: spec.template.spec.containers[0].env[?(@.name == "INGRESS_ANNOTATIONS")] + + - it: should create container with INGRESS_ANNOTATIONS env and value from `ingress.annotations` + template: deployment.yaml + set: + ingress.annotations: + customIngressAnnotation: "true" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: INGRESS_ANNOTATIONS + value: '{"customIngressAnnotation":"true"}' + + - it: should create container with INGRESS_ANNOTATIONS env and value `forge.projectIngressAnnotations` + template: deployment.yaml + set: + ingress.annotations: + customIngressAnnotation: "false" + forge.projectIngressAnnotations: + customProjectAnnotation: "true" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: INGRESS_ANNOTATIONS + value: '{"customProjectAnnotation":"true"}' + \ No newline at end of file diff --git a/helm/flowforge/values.schema.json b/helm/flowforge/values.schema.json index 5307475f..75de3036 100644 --- a/helm/flowforge/values.schema.json +++ b/helm/flowforge/values.schema.json @@ -142,6 +142,9 @@ }, "default": [] }, + "projectIngressAnnotations": { + "type": "object" + }, "managementSelector": { "type": "object" }, diff --git a/helm/flowforge/values.yaml b/helm/flowforge/values.yaml index e5914282..a3b66d58 100644 --- a/helm/flowforge/values.yaml +++ b/helm/flowforge/values.yaml @@ -8,6 +8,7 @@ forge: projectDeploymentTolerations: [] projectNetworkPolicy: enabled: false + projectIngressAnnotations: {} managementSelector: role: management telemetry: