diff --git a/src/main/helm/README.md b/src/main/helm/README.md index a7d492581da2e82281cec70ff9843a7dd10c84d5..464d5334986131fe8bed4825744bac397bb9c2e3 100644 --- a/src/main/helm/README.md +++ b/src/main/helm/README.md @@ -81,11 +81,11 @@ routing: ### Benutzung beliebiger environment Werte -In jedem der Projekte kann man beliebige weitere environments setzen. Dazu muss man in der jeweiligen values.yaml unter env.customList ein name value Paar setzen: +In jedem der Projekte kann man beliebige weitere environments setzen. Dazu muss man in der jeweiligen values.yaml unter env.customVarsLocal ein name value Paar setzen: ```yaml env: - customList: + customVarsLocal: - name: Dinge value: true - name: ... diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 89c0a9277df86d7042b64ea75e4c2213e8a21331..207444ad5a8cae49c1afc9211ca274c7274e27d7 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -81,7 +81,10 @@ spec: - name: grpc_client_vorgang-manager-{{ (.Values.routing).targetVorgangManagerName}}_negotiationType value: {{ (.Values.routing).negotiationType | default "PLAINTEXT" }} {{- end }} - {{- with (.Values.env).customList }} + {{- with (.Values.env).customVarsLocal }} +{{ toYaml . | indent 8 }} + {{- end }} + {{- with (.Values.env).customVarsGlobal }} {{ toYaml . | indent 8 }} {{- end }} image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}" diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 11fdeb4ae386e81f51da0db2f35833333c0079f8..118009532b1262af86efb421e2108e41dae7775c 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -29,18 +29,6 @@ image: name: intelliform-adapter # [default: intelliform-adapter] tag: latest # [default: latest] -# env: -# overrideSpringProfiles: "oc,prod" - # customList: # add name value pair for additional environments - # - name: Dinge - # value: true -#resources: -# limits: -# cpu: 1 # [default: 1] -# memory: 1200Mi # [default: 1200Mi] -# requests: -# cpu: 100m # [default: 100m] -# memory: 250Mi # [default: 250Mi] ingress: enabled: true diff --git a/src/test/helm/deployment_env_customList_test.yaml b/src/test/helm/deployment_env_customList_test.yaml index 16022898f61af3474411ceff275c470d1feed81a..8fe0b2beff4d6ae6245b08b2c36efeec432e4c57 100644 --- a/src/test/helm/deployment_env_customList_test.yaml +++ b/src/test/helm/deployment_env_customList_test.yaml @@ -29,9 +29,20 @@ set: ozgcloud.environment: test imagePullSecret: image-pull-secret tests: - - it: check customList + - it: check customVarsLocal set: - env.customList: + env.customVarsLocal: + - name: my_test_environment_name + value: "A test value" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: my_test_environment_name + value: "A test value" + - it: check customVarsGlobal + set: + env.customVarsGlobal: - name: my_test_environment_name value: "A test value" asserts: diff --git a/xta-adapter/src/main/helm/templates/network_policy.yaml b/xta-adapter/src/main/helm/templates/network_policy.yaml index f8261b0885fd73688689a3f6fb873025e1ba0bde..b65e30f07ac0bc4277370f0879bc71c2c9c8adb5 100644 --- a/xta-adapter/src/main/helm/templates/network_policy.yaml +++ b/xta-adapter/src/main/helm/templates/network_policy.yaml @@ -66,7 +66,10 @@ spec: protocol: TCP - port: 9000 protocol: TCP -{{- with (.Values.networkPolicy).additionalEgressConfig }} +{{- with (.Values.networkPolicy).additionalEgressConfigLocal }} +{{ toYaml . | indent 2 }} +{{- end }} +{{- with (.Values.networkPolicy).additionalEgressConfigGlobal }} {{ toYaml . | indent 2 }} {{- end }} diff --git a/xta-adapter/src/test/helm/network_policy_test.yaml b/xta-adapter/src/test/helm/network_policy_test.yaml index 62eac6b1ad08aca179db7207cfd4071d92bc219e..7e725ee8a94e63b8a7156aa15cfad027b7d45575 100644 --- a/xta-adapter/src/test/helm/network_policy_test.yaml +++ b/xta-adapter/src/test/helm/network_policy_test.yaml @@ -89,12 +89,28 @@ tests: - port: 9000 protocol: TCP - - it: add egress rules by values + - it: add egress rules by values local set: networkPolicy: ssoPublicIp: 51.89.117.53/32 dnsServerNamespace: test-dns-namespace - additionalEgressConfig: + additionalEgressConfigLocal: + - to: + - ipBlock: + cidr: 1.2.3.4/32 + asserts: + - contains: + path: spec.egress + content: + to: + - ipBlock: + cidr: 1.2.3.4/32 + - it: add egress rules by values global + set: + networkPolicy: + ssoPublicIp: 51.89.117.53/32 + dnsServerNamespace: test-dns-namespace + additionalEgressConfigGlobal: - to: - ipBlock: cidr: 1.2.3.4/32