Skip to content

Commit 0f4562a

Browse files
cyril.croscorneliusludmann
authored andcommitted
allow disabling network policies via installNetworkPolicies
1 parent 3e1a6ca commit 0f4562a

15 files changed

+35
-8
lines changed

chart/templates/blobserve-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

44
{{ $comp := .Values.components.blobserve -}}
5+
{{ if .Values.installNetworkPolicies -}}
56
apiVersion: networking.k8s.io/v1
67
kind: NetworkPolicy
78
metadata:
@@ -31,3 +32,4 @@ spec:
3132
matchLabels:
3233
app: {{ template "gitpod.fullname" . }}
3334
component: ws-proxy
35+
{{- end -}}

chart/templates/content-service-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2021 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -19,3 +20,4 @@ spec:
1920
- Ingress
2021
ingress:
2122
- {}
23+
{{- end -}}

chart/templates/dashboard-deny-all-allow-explicit-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -27,3 +28,4 @@ spec:
2728
matchLabels:
2829
app: {{ template "gitpod.fullname" . }}
2930
component: proxy
31+
{{- end -}}

chart/templates/db-deny-all-allow-explicit-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -56,3 +57,4 @@ spec:
5657
matchLabels:
5758
app: sweeper
5859
{{- end -}}
60+
{{- end -}}

chart/templates/image-builder-networkpolicy.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -32,4 +33,5 @@ spec:
3233
cidr: 0.0.0.0/0
3334
except:
3435
# Google Compute engine special, reserved VM metadata IP
35-
- 169.254.169.254/32
36+
- 169.254.169.254/32
37+
{{- end -}}

chart/templates/messagebus-allow-all-networkpolicy.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -19,4 +20,5 @@ spec:
1920
- Ingress
2021
ingress:
2122
# allow ingress for everyone in the cluster. The workspace pods have an egress limit that prevents them from accessing the messagebus service anyways.
22-
- {}
23+
- {}
24+
{{- end -}}

chart/templates/proxy-deny-all-allow-explicit-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -36,3 +37,4 @@ spec:
3637
matchLabels:
3738
app: prometheus
3839
component: server
40+
{{- end -}}

chart/templates/registry-facade-allow-all-networkpolicy.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -19,4 +20,5 @@ spec:
1920
- Ingress
2021
ingress:
2122
# allow ingress for everyone in the cluster. The workspace pods have an egress limit that prevents them from accessing the registry-facade service anyways.
22-
- {}
23+
- {}
24+
{{- end -}}

chart/templates/server-deny-all-allow-explicit-networkpolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -43,3 +44,4 @@ spec:
4344
matchLabels:
4445
app: {{ template "gitpod.fullname" . }}
4546
component: cerc
47+
{{- end -}}

chart/templates/workspace-networkpolicy-default.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
22
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
33

4+
{{ if .Values.installNetworkPolicies -}}
45
apiVersion: networking.k8s.io/v1
56
kind: NetworkPolicy
67
metadata:
@@ -91,3 +92,4 @@ spec:
9192
matchLabels:
9293
app: gitpod
9394
component: proxy
95+
{{- end -}}

0 commit comments

Comments
 (0)