diff --git a/src/main/helm/templates/network_policy.yaml b/src/main/helm/templates/network_policy.yaml index 3778b7b196e89717c5cfa420998738753774ffc7..21b59c44dd0553347054efdae402b5e70d3a2227 100644 --- a/src/main/helm/templates/network_policy.yaml +++ b/src/main/helm/templates/network_policy.yaml @@ -69,6 +69,13 @@ spec: ports: - port: 27017 protocol: TCP + - to: + - podSelector: + matchLabels: + component: alfa + ports: + - port: 8080 + protocol: TCP # public keycloak ip - to: - ipBlock: diff --git a/src/test/helm/network_policy_test.yaml b/src/test/helm/network_policy_test.yaml index 7eb27b3aab600e905d719312b843bd82d0b8a077..34c0d4b31a0ad2a81647edb7badbc2998e92ef22 100644 --- a/src/test/helm/network_policy_test.yaml +++ b/src/test/helm/network_policy_test.yaml @@ -76,12 +76,12 @@ tests: - ports: - port: 8080 - from: - - namespaceSelector: - matchLabels: - name: "openshift-user-workload-monitoring" + - namespaceSelector: + matchLabels: + name: "openshift-user-workload-monitoring" ports: - - protocol: TCP - port: 8081 + - protocol: TCP + port: 8081 egress: - to: - namespaceSelector: @@ -100,6 +100,13 @@ tests: ports: - port: 27017 protocol: TCP + - to: + - podSelector: + matchLabels: + component: "alfa" + ports: + - port: 8080 + protocol: TCP # public keycloak ip - to: - ipBlock: @@ -124,18 +131,18 @@ tests: ssoPublicIp: 51.89.117.53/32 dnsServerNamespace: test-namespace-dns additionalIngressConfigLocal: - - from: - - podSelector: - matchLabels: - component: client2 + - from: + - podSelector: + matchLabels: + component: client2 asserts: - contains: path: spec.ingress content: from: - - podSelector: - matchLabels: - component: client2 + - podSelector: + matchLabels: + component: client2 - it: set ingress monitoring namespace rule set: @@ -148,30 +155,30 @@ tests: path: spec.ingress content: from: - - namespaceSelector: - matchLabels: - name: "monitoring" + - namespaceSelector: + matchLabels: + name: "monitoring" ports: - - protocol: TCP - port: 8081 + - protocol: TCP + port: 8081 - it: add ingress rule by values global set: networkPolicy: ssoPublicIp: 51.89.117.53/32 dnsServerNamespace: test-namespace-dns additionalIngressConfigGlobal: - - from: - - podSelector: - matchLabels: - component: client2 + - from: + - podSelector: + matchLabels: + component: client2 asserts: - contains: path: spec.ingress content: from: - - podSelector: - matchLabels: - component: client2 + - podSelector: + matchLabels: + component: client2 - it: add egress rules by values local set: @@ -179,32 +186,32 @@ tests: ssoPublicIp: 51.89.117.53/32 dnsServerNamespace: test-dns-namespace additionalEgressConfigLocal: - - to: - - ipBlock: - cidr: 1.2.3.4/32 + - to: + - ipBlock: + cidr: 1.2.3.4/32 asserts: - - contains: - path: spec.egress - content: - to: - - ipBlock: - cidr: 1.2.3.4/32 + - 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 + - to: + - ipBlock: + cidr: 1.2.3.4/32 asserts: - - contains: - path: spec.egress - content: - to: - - ipBlock: - cidr: 1.2.3.4/32 + - contains: + path: spec.egress + content: + to: + - ipBlock: + cidr: 1.2.3.4/32 - it: test network policy disabled set: @@ -247,4 +254,4 @@ tests: ssoPublicIp: 1.1.1.1 asserts: - hasDocuments: - count: 1 \ No newline at end of file + count: 1