-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description <!-- Please reference issue if any. --> <!-- Please include a summary of your changes. --> Fixes FL-1457 ## Companion PR - Substra/substra-backend#875 ## How has this been tested? [CI there](Substra/substra-backend#875) <!-- Please describe the tests that you ran to verify your changes. --> ## Checklist - [ ] [changelog](../CHANGELOG.md) was updated with notable changes - [ ] documentation was updated --------- Signed-off-by: Guilhem Barthés <[email protected]>
- Loading branch information
1 parent
b7e19a9
commit 88d97ff
Showing
8 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ include "orchestrator.name" . }}-database | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
app.kubernetes.io/component: primary | ||
app.kubernetes.io/name: postgresql | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
{{- include "orchestrator.migrations.labels" . | nindent 10 }} | ||
- podSelector: | ||
matchLabels: | ||
{{- include "orchestrator.server.labels" . | nindent 10 }} | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.database.port }} | ||
egress: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: {{ include "orchestrator.name" . }}-deny-all | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{ include "orchestrator.common.selectorLabels" . | nindent 6 }} | ||
ingress: [] | ||
egress: [] |
20 changes: 20 additions & 0 deletions
20
charts/orchestrator/templates/networkpolicy-orchestrator-client.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ include "orchestrator.name" . }}-backend-client-ingress | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{- include "orchestrator.server.labels" . | nindent 10 }} | ||
policyTypes: | ||
- Ingress | ||
ingress: | ||
- from: | ||
- namespaceSelector: {} | ||
podSelector: | ||
matchLabels: | ||
role-orchestrator-client: 'true' | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.service.port }} | ||
|
32 changes: 32 additions & 0 deletions
32
charts/orchestrator/templates/networkpolicy-orchestrator-common.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ include "orchestrator.name" . }}-common | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{- include "orchestrator.common.labels" . | nindent 6 }} | ||
policyTypes: | ||
- Egress | ||
egress: | ||
- to: | ||
# Allow internal DNS reslution | ||
- namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: kube-system | ||
podSelector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
ports: | ||
- protocol: TCP | ||
port: 53 | ||
- protocol: UDP | ||
port: 53 | ||
- to: | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/component: primary | ||
app.kubernetes.io/name: postgresql | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.database.port }} |
25 changes: 25 additions & 0 deletions
25
charts/orchestrator/templates/networkpolicy-orchestrator-server.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ include "orchestrator.name" . }}-server | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{- include "orchestrator.server.labels" . | nindent 10 }} | ||
policyTypes: | ||
- Ingress | ||
ingress: | ||
# Allow communication from internet | ||
- from: | ||
- ipBlock: | ||
cidr: 0.0.0.0/0 | ||
except: | ||
- 10.0.0.0/8 | ||
- 192.168.0.0/16 | ||
- 172.16.0.0/20 | ||
ports: | ||
- protocol: TCP | ||
port: 443 | ||
- protocol: TCP | ||
port: 80 | ||
|