Skip to content
Snippets Groups Projects
Commit b89aa52f authored by Krzysztof Witukiewicz's avatar Krzysztof Witukiewicz
Browse files

Merge branch 'OZG-7811-landesebene-helm' into 'main'

Ozg 7811 landesebene helm

See merge request !24
parents df40778e 5861ca88
No related branches found
No related tags found
1 merge request!24Ozg 7811 landesebene helm
Showing
with 134 additions and 14 deletions
...@@ -79,8 +79,8 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -79,8 +79,8 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}} {{- end -}}
{{- define "app.grpcClientVorgangManagerAddress" -}} {{- define "app.grpcClientVorgangManagerAddress" -}}
{{- if (.Values.env).grpcClientVorgangManagerAddress -}} {{- if ((.Values.ozgcloud).vorgangManager).address -}}
{{ printf "%s" (.Values.env).grpcClientVorgangManagerAddress }} {{ printf "%s" ((.Values.ozgcloud).vorgangManager).address }}
{{- else -}} {{- else -}}
{{ printf "dns:///%s.%s:9090" ( coalesce .Values.vorgangManagerName "vorgang-manager" ) (include "app.namespace" . ) }} {{ printf "dns:///%s.%s:9090" ( coalesce .Values.vorgangManagerName "vorgang-manager" ) (include "app.namespace" . ) }}
{{- end -}} {{- end -}}
......
...@@ -62,7 +62,13 @@ spec: ...@@ -62,7 +62,13 @@ spec:
- name: grpc_client_vorgang-manager_address - name: grpc_client_vorgang-manager_address
value: {{ include "app.grpcClientVorgangManagerAddress" . }} value: {{ include "app.grpcClientVorgangManagerAddress" . }}
- name: grpc_client_vorgang-manager_negotiationType - name: grpc_client_vorgang-manager_negotiationType
value: {{ (.Values.vorgangManager).grpcClientNegotiationType }} value: {{ ((.Values.ozgcloud).vorgangManager).negotiationType }}
{{- if ((.Values.ozgcloud).aggregationManagerServer).address }}
- name: grpc_client_aggregation-manager-server_address
value: {{ ((.Values.ozgcloud).aggregationManagerServer).address }}
- name: grpc_client_aggregation-manager-server_negotiationType
value: {{ ((.Values.ozgcloud).aggregationManagerServer).negotiationType | default "TLS" }}
{{- end }}
{{- if not (.Values.database).useExternal }} {{- if not (.Values.database).useExternal }}
- name: spring_data_mongodb_uri - name: spring_data_mongodb_uri
valueFrom: valueFrom:
...@@ -75,6 +81,8 @@ spec: ...@@ -75,6 +81,8 @@ spec:
- name: ozgcloud_administration_address - name: ozgcloud_administration_address
value: {{ include "app.getOzgcloudAdministrationAddress" . }} value: {{ include "app.getOzgcloudAdministrationAddress" . }}
{{- end }} {{- end }}
- name: ozgcloud_mandant
value: {{ (.Values.ozgcloud).bezeichner }}
{{- with include "app.getCustomList" . }} {{- with include "app.getCustomList" . }}
{{ . | indent 14 }} {{ . | indent 14 }}
{{- end }} {{- end }}
......
...@@ -84,6 +84,18 @@ spec: ...@@ -84,6 +84,18 @@ spec:
protocol: UDP protocol: UDP
- port: 5353 - port: 5353
protocol: TCP protocol: TCP
{{- if ((.Values.ozgcloud).aggregationManagerServer).namespace }}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ ((.Values.ozgcloud).aggregationManagerServer).namespace }}
podSelector:
matchLabels:
component: aggregation-manager-server
ports:
- port: 9090
protocol: TCP
{{- end }}
{{- with (.Values.networkPolicy).additionalEgressConfigLocal }} {{- with (.Values.networkPolicy).additionalEgressConfigLocal }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }} {{- end }}
......
...@@ -29,6 +29,8 @@ image: ...@@ -29,6 +29,8 @@ image:
ozgcloud: ozgcloud:
environment: environment:
vorgangManager:
negotiationType: PLAINTEXT
database: database:
useExternal: false useExternal: false
...@@ -38,9 +40,6 @@ database: ...@@ -38,9 +40,6 @@ database:
enabled: false enabled: false
secretName: ozg-mongodb-tls-cert secretName: ozg-mongodb-tls-cert
vorgangManager:
grpcClientNegotiationType: PLAINTEXT
cronjob: cronjob:
schedule: "0 0 * * *" schedule: "0 0 * * *"
successfulJobsHistoryLimit: 3 successfulJobsHistoryLimit: 3
......
...@@ -58,7 +58,7 @@ public class AggregationManagerGrpcConfiguration { ...@@ -58,7 +58,7 @@ public class AggregationManagerGrpcConfiguration {
} }
@Bean @Bean
@ConditionalOnProperty("grpc.client.aggregation-manager.address") @ConditionalOnProperty("grpc.client.aggregation-manager-server.address")
AggregationDataRemoteService aggregationDataRemoteService(AggregationManagerProperties properties, GrpcAggregationDataMapper grpcAggregationDataMapper) { AggregationDataRemoteService aggregationDataRemoteService(AggregationManagerProperties properties, GrpcAggregationDataMapper grpcAggregationDataMapper) {
return new AggregationDataRemoteService(aggregationDataServiceStub, properties, grpcAggregationDataMapper); return new AggregationDataRemoteService(aggregationDataServiceStub, properties, grpcAggregationDataMapper);
} }
......
...@@ -36,7 +36,7 @@ import lombok.RequiredArgsConstructor; ...@@ -36,7 +36,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
@Component @Component
@ConditionalOnProperty("grpc.client.aggregation-manager.address") @ConditionalOnProperty("grpc.client.aggregation-manager-server.address")
@RequiredArgsConstructor @RequiredArgsConstructor
@Log4j2 @Log4j2
public class AggregationDataRemoteLoader implements AggregationDataLoader { public class AggregationDataRemoteLoader implements AggregationDataLoader {
......
...@@ -45,7 +45,7 @@ import net.devh.boot.grpc.client.inject.GrpcClient; ...@@ -45,7 +45,7 @@ import net.devh.boot.grpc.client.inject.GrpcClient;
@RequiredArgsConstructor @RequiredArgsConstructor
public class AggregationDataRemoteService { public class AggregationDataRemoteService {
@GrpcClient("aggregation-manager") @GrpcClient("aggregation-manager-server")
private final AggregationDataServiceGrpc.AggregationDataServiceStub serviceStub; private final AggregationDataServiceGrpc.AggregationDataServiceStub serviceStub;
private final AggregationManagerProperties properties; private final AggregationManagerProperties properties;
private final GrpcAggregationDataMapper grpcAggregationDataMapper; private final GrpcAggregationDataMapper grpcAggregationDataMapper;
......
...@@ -93,11 +93,22 @@ tests: ...@@ -93,11 +93,22 @@ tests:
content: content:
name: grpc_client_vorgang-manager_address name: grpc_client_vorgang-manager_address
value: "dns:///vorgang-manager.sh-helm-test:9090" value: "dns:///vorgang-manager.sh-helm-test:9090"
- notContains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_aggregation-manager-server_address
any: true
- notContains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_aggregation-manager-server_negotiationType
any: true
- it: should set grpc_client_vorgang-manager_address - it: should set grpc_client_vorgang-manager_address
set: set:
env:
grpcClientVorgangManagerAddress: dns:///vorgang-manager.de:9090
ozgcloud: ozgcloud:
vorgangManager:
address: dns:///vorgang-manager.de:9090
environment: dev environment: dev
asserts: asserts:
- contains: - contains:
...@@ -129,6 +140,58 @@ tests: ...@@ -129,6 +140,58 @@ tests:
name: ozgcloud_administration_address name: ozgcloud_administration_address
value: http://test-administration:8080 value: http://test-administration:8080
- it: should set grpc_client_aggregation-manager-server_address
set:
ozgcloud:
aggregationManagerServer:
address: dns:///aggregation-manager-server.de:9090
environment: dev
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_aggregation-manager-server_address
value: dns:///aggregation-manager-server.de:9090
- it: should set grpc_client_aggregation-manager-server_negotiationType
set:
ozgcloud:
aggregationManagerServer:
address: dns:///aggregation-manager-server.de:9090
negotiationType: PLAINTEXT
environment: dev
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_aggregation-manager-server_negotiationType
value: PLAINTEXT
- it: should set grpc_client_aggregation-manager-server_negotiationType to default value
set:
ozgcloud:
aggregationManagerServer:
address: dns:///aggregation-manager-server.de:9090
environment: dev
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: grpc_client_aggregation-manager-server_negotiationType
value: TLS
- it: should set mandant to value of bezeichner
set:
ozgcloud:
bezeichner: helmtest-kiel.dev
environment: dev
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: ozgcloud_mandant
value: helmtest-kiel.dev
- it: should fail template when env not set - it: should fail template when env not set
set: set:
asserts: asserts:
......
...@@ -112,6 +112,28 @@ tests: ...@@ -112,6 +112,28 @@ tests:
- Ingress - Ingress
- Egress - Egress
- it: add egress rule for aggregation-manager-server
set:
ozgcloud:
aggregationManagerServer:
namespace: test-aggregation-dns
networkPolicy:
dnsServerNamespace: kube-system
asserts:
- contains:
path: spec.egress
content:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: test-aggregation-dns
podSelector:
matchLabels:
component: aggregation-manager-server
ports:
- port: 9090
protocol: TCP
- it: add ingress rule by values local - it: add ingress rule by values local
set: set:
networkPolicy: networkPolicy:
......
...@@ -41,7 +41,7 @@ class SpringContextITCase { ...@@ -41,7 +41,7 @@ class SpringContextITCase {
@Nested @Nested
@ITCase @ITCase
@TestPropertySource(properties = { "grpc.client.aggregation-manager.address=static://127.0.0.1:9090" }) @TestPropertySource(properties = { "grpc.client.aggregation-manager-server.address=static://127.0.0.1:9090" })
class OnAggregationManagerAddressSet { class OnAggregationManagerAddressSet {
@Autowired @Autowired
......
...@@ -43,6 +43,14 @@ spec: ...@@ -43,6 +43,14 @@ spec:
ports: ports:
- protocol: TCP - protocol: TCP
port: 8081 port: 8081
- from:
- namespaceSelector: { }
podSelector:
matchLabels:
component: aggregation-manager-job
ports:
- port: 9090
protocol: TCP
{{- with (.Values.networkPolicy).additionalIngressConfigLocal }} {{- with (.Values.networkPolicy).additionalIngressConfigLocal }}
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }} {{- end }}
......
...@@ -91,6 +91,14 @@ tests: ...@@ -91,6 +91,14 @@ tests:
ports: ports:
- port: 8081 - port: 8081
protocol: TCP protocol: TCP
- from:
- namespaceSelector: { }
podSelector:
matchLabels:
component: aggregation-manager-job
ports:
- port: 9090
protocol: TCP
podSelector: podSelector:
matchLabels: matchLabels:
component: aggregation-manager-server component: aggregation-manager-server
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment