Skip to content

Commit 8904349

Browse files
authored
Merge pull request #5831 from nextcloud/enh/noid/remove-nbs-if-not-need
helm: remove NET_BIND_SERVICE if not needed
2 parents 8613079 + ca4386b commit 8904349

10 files changed

+5
-17
lines changed

nextcloud-aio-helm-chart/templates/nextcloud-aio-clamav-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ spec:
5353
{{- else }}
5454
drop: ["NET_RAW"]
5555
{{- end }}
56-
add: ["NET_BIND_SERVICE"]
5756
containers:
5857
- env:
5958
- name: CLAMD_STARTUP_TIMEOUT
@@ -92,7 +91,6 @@ spec:
9291
{{- else }}
9392
drop: ["NET_RAW"]
9493
{{- end }}
95-
add: ["NET_BIND_SERVICE"]
9694
volumeMounts:
9795
- mountPath: /var/lib/clamav
9896
subPath: data

nextcloud-aio-helm-chart/templates/nextcloud-aio-database-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ spec:
5252
{{- else }}
5353
drop: ["NET_RAW"]
5454
{{- end }}
55-
add: ["NET_BIND_SERVICE"]
5655
containers:
5756
- env:
5857
- name: PGTZ
@@ -93,7 +92,6 @@ spec:
9392
{{- else }}
9493
drop: ["NET_RAW"]
9594
{{- end }}
96-
add: ["NET_BIND_SERVICE"]
9795
volumeMounts:
9896
- mountPath: /var/lib/postgresql/data
9997
subPath: data

nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,4 @@ spec:
6666
{{- else }}
6767
drop: ["NET_RAW"]
6868
{{- end }}
69-
add:
70-
- NET_BIND_SERVICE
7169
{{- end }}

nextcloud-aio-helm-chart/templates/nextcloud-aio-nextcloud-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ spec:
191191
{{- else }}
192192
drop: ["NET_RAW"]
193193
{{- end }}
194-
add: ["NET_BIND_SERVICE"]
195194
{{- end }} # AIO-config - do not change this comment!
196195
readinessProbe:
197196
exec:

nextcloud-aio-helm-chart/templates/nextcloud-aio-notify-push-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ spec:
8181
{{- else }}
8282
drop: ["NET_RAW"]
8383
{{- end }}
84-
add: ["NET_BIND_SERVICE"]
8584
volumeMounts:
8685
- mountPath: /nextcloud
8786
name: nextcloud-aio-nextcloud

nextcloud-aio-helm-chart/templates/nextcloud-aio-redis-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ spec:
6767
{{- else }}
6868
drop: ["NET_RAW"]
6969
{{- end }}
70-
add: ["NET_BIND_SERVICE"]
7170
volumeMounts:
7271
- mountPath: /data
7372
name: nextcloud-aio-redis

nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,4 @@ spec:
8484
{{- else }}
8585
drop: ["NET_RAW"]
8686
{{- end }}
87-
add: ["NET_BIND_SERVICE"]
8887
{{- end }}

nextcloud-aio-helm-chart/templates/nextcloud-aio-talk-recording-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ spec:
7272
{{- else }}
7373
drop: ["NET_RAW"]
7474
{{- end }}
75-
add: ["NET_BIND_SERVICE"]
7675
volumeMounts:
7776
- mountPath: /tmp
7877
name: nextcloud-aio-talk-recording

nextcloud-aio-helm-chart/templates/nextcloud-aio-whiteboard-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,4 @@ spec:
7474
{{- else }}
7575
drop: ["NET_RAW"]
7676
{{- end }}
77-
add: ["NET_BIND_SERVICE"]
7877
{{- end }}

nextcloud-aio-helm-chart/update-helm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ yq -i 'del(.services.[].tmpfs)' latest.yml
5555
# Remove cap_drop in order to add it later again easier
5656
yq -i 'del(.services.[].cap_drop)' latest.yml
5757
# Remove SYS_NICE for imaginary as it is not supported with RPSS
58-
sed -i "s|- SYS_NICE$|- NET_BIND_SERVICE|" latest.yml
58+
yq -i 'del(.services."nextcloud-aio-imaginary".cap_add)' latest.yml
5959
# cap SYS_ADMIN is called CAP_SYS_ADMIN in k8s
6060
sed -i "s|- SYS_ADMIN$|- CAP_SYS_ADMIN|" latest.yml
6161

@@ -461,10 +461,9 @@ cat << EOL > /tmp/security.conf
461461
{{- else }}
462462
drop: ["NET_RAW"]
463463
{{- end }}
464-
add: ["NET_BIND_SERVICE"]
465464
EOL
466465
# shellcheck disable=SC1083
467-
find ./ \( -not -name '*collabora-deployment.yaml*' -not -name '*imaginary-deployment.yaml*' -not -name '*onlyoffice-deployment.yaml*' -name "*deployment.yaml" \) -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \;
466+
find ./ \( -not -name '*collabora-deployment.yaml*' -not -name '*apache-deployment.yaml*' -not -name '*onlyoffice-deployment.yaml*' -name "*deployment.yaml" \) -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \;
468467

469468
cat << EOL > /tmp/security.conf
470469
# The items below only work in container context
@@ -475,9 +474,11 @@ cat << EOL > /tmp/security.conf
475474
{{- else }}
476475
drop: ["NET_RAW"]
477476
{{- end }}
477+
add: ["NET_BIND_SERVICE"]
478478
EOL
479+
479480
# shellcheck disable=SC1083
480-
find ./ -name '*imaginary-deployment.yaml*' -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \;
481+
find ./ -name '*apache-deployment.yaml*' -exec sed -i "/^ securityContext:$/r /tmp/security.conf" \{} \;
481482

482483
cat << EOL > /tmp/security.conf
483484
{{- if eq (.Values.RPSS_ENABLED | default "no") "yes" }} # AIO-config - do not change this comment!
@@ -490,7 +491,6 @@ cat << EOL > /tmp/security.conf
490491
{{- else }}
491492
drop: ["NET_RAW"]
492493
{{- end }}
493-
add: ["NET_BIND_SERVICE"]
494494
{{- end }} # AIO-config - do not change this comment!
495495
EOL
496496
# shellcheck disable=SC1083

0 commit comments

Comments
 (0)