Skip to content

Commit

Permalink
FORMS-1495: Network Policies for NATS protocol (bcgov#1541)
Browse files Browse the repository at this point in the history
* FORMS-1495: Network Poilicies for NATS protocol

Signed-off-by: Jason Sherman <[email protected]>

* remove the smoke test configuration, revert to production like config.

Signed-off-by: Jason Sherman <[email protected]>

---------

Signed-off-by: Jason Sherman <[email protected]>
  • Loading branch information
usingtechnology authored Dec 13, 2024
1 parent 5f75bc9 commit e989383
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-chefs-to-nats
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: nats
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: nats
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
environment: {{ .Values.nsp.chefs.env }}
name: {{ .Values.nsp.chefs.namespace }}
podSelector:
matchLabels:
role: app
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-websocket-ingress-to-nats
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: nats
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: nats
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-nats-to-nats
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: nats
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: nats
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
environment: {{ .Values.nsp.nats.env }}
name: {{ .Values.nsp.nats.namespace }}
podSelector:
matchLabels:
app.kubernetes.io/component: nats
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: nats
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ ess:
ingressPrefix: stream
ingressSuffix: .apps.silver.devops.gov.bc.ca

nsp:
nats:
env: prod
chefs:
env: prod

nats:
config:
jetstream:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ ess:
ingressPrefix: stream-test
ingressSuffix: .apps.silver.devops.gov.bc.ca

nsp:
nats:
env: test
chefs:
env: test

nats:
container:
merge:
Expand Down
8 changes: 8 additions & 0 deletions event-stream-service/charts/event-stream-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ ess:
termination: edge
wildcardPolicy: None

nsp:
nats:
env: dev
namespace: a191b5
chefs:
env: dev
namespace: a12c97

nats:
fullnameOverride: ess-nats
config:
Expand Down

0 comments on commit e989383

Please sign in to comment.