Skip to content

Commit

Permalink
helm: add network policy
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Jul 22, 2024
1 parent 9458650 commit 79bcd06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ spec:
value: "{{ .Values.TIMEZONE }}"
- name: UPDATE_NEXTCLOUD_APPS
value: "{{ .Values.UPDATE_NEXTCLOUD_APPS }}"
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.NEXTCLOUD_IMAGE_ORG }}/aio-nextcloud:20240718_063028"
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.NEXTCLOUD_IMAGE_ORG }}/aio-nextcloud:20240718_06302"
name: nextcloud-aio-nextcloud
ports:
- containerPort: 9000
Expand Down
15 changes: 15 additions & 0 deletions nextcloud-aio-helm-chart/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@ find ./ -name '*talk-deployment.yaml' -exec sed -i "/^.*\- env:/r /tmp/additiona
# shellcheck disable=SC1083
find ./ -name '*deployment.yaml' -exec sed -i '/image: nextcloud/s/$/"/;s|image: nextcloud/|image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.NEXTCLOUD_IMAGE_ORG }}/|;' \{} \;

cat << EOL > templates/nextcloud-aio-networkpolicy.yaml
# https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
namespace: "{{ .Values.NAMESPACE }}"
name: nextcloud-aio-deny-from-other-namespaces
spec:
podSelector:
matchLabels:
ingress:
- from:
- podSelector: {}
EOL

cd ../
mkdir -p ../helm-chart/
rm latest/Chart.yaml
Expand Down

0 comments on commit 79bcd06

Please sign in to comment.