Skip to content

Commit 4cbf562

Browse files
committed
[virtual-machine] Revert per-vm network policies (#1611)
Signed-off-by: Andrei Kvapil <[email protected]> <!-- Thank you for making a contribution! Here are some tips for you: - Start the PR title with the [label] of Cozystack component: - For system components: [platform], [system], [linstor], [cilium], [kube-ovn], [dashboard], [cluster-api], etc. - For managed apps: [apps], [tenant], [kubernetes], [postgres], [virtual-machine] etc. - For development and maintenance: [tests], [ci], [docs], [maintenance]. - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `backport` if it's a bugfix that needs to be backported to a previous version. --> ## What this PR does Revert per-vm network policies functionality introduced by #1611 As it is not working as expected any way. This is temporary solution before implementing full-fledged security groups in Cozystack fixes #1601 alternative solution: #1602 ### Release note <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same [label] as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note [virtual-machine] Revert per-vm network policies ```
1 parent d8c45db commit 4cbf562

5 files changed

Lines changed: 1 addition & 55 deletions

File tree

‎packages/apps/tenant/templates/networkpolicy.yaml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ metadata:
2020
name: allow-external-communication
2121
namespace: {{ include "tenant.name" . }}
2222
spec:
23-
endpointSelector:
24-
matchExpressions:
25-
- key: policy.cozystack.io/allow-external-communication
26-
operator: NotIn
27-
values: ["false"]
23+
endpointSelector: {}
2824
ingress:
2925
- fromEntities:
3026
- world

‎packages/apps/virtual-machine/templates/service.yaml‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,3 @@ spec:
2828
{{- end }}
2929
{{- end }}
3030
{{- end }}
31-
---
32-
apiVersion: cilium.io/v2
33-
kind: CiliumNetworkPolicy
34-
metadata:
35-
name: {{ include "virtual-machine.fullname" . }}
36-
spec:
37-
endpointSelector:
38-
matchLabels:
39-
{{- include "virtual-machine.selectorLabels" . | nindent 6 }}
40-
ingress:
41-
- fromEntities:
42-
- cluster
43-
- fromEntities:
44-
- world
45-
{{- if eq .Values.externalMethod "PortList" }}
46-
toPorts:
47-
- ports:
48-
{{- range .Values.externalPorts }}
49-
- port: {{ quote . }}
50-
{{- end }}
51-
{{- end }}
52-
egress:
53-
- toEntities:
54-
- world

‎packages/apps/virtual-machine/templates/vm.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ spec:
6262
template:
6363
metadata:
6464
annotations:
65-
policy.cozystack.io/allow-external-communication: "false"
6665
kubevirt.io/allow-pod-bridge-network-live-migration: "true"
6766
labels:
6867
{{- include "virtual-machine.labels" . | nindent 8 }}

‎packages/apps/vm-instance/templates/service.yaml‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,3 @@ spec:
2828
{{- end }}
2929
{{- end }}
3030
{{- end }}
31-
---
32-
apiVersion: cilium.io/v2
33-
kind: CiliumNetworkPolicy
34-
metadata:
35-
name: {{ include "virtual-machine.fullname" . }}
36-
spec:
37-
endpointSelector:
38-
matchLabels:
39-
{{- include "virtual-machine.selectorLabels" . | nindent 6 }}
40-
ingress:
41-
- fromEntities:
42-
- cluster
43-
- fromEntities:
44-
- world
45-
{{- if eq .Values.externalMethod "PortList" }}
46-
toPorts:
47-
- ports:
48-
{{- range .Values.externalPorts }}
49-
- port: {{ quote . }}
50-
{{- end }}
51-
{{- end }}
52-
egress:
53-
- toEntities:
54-
- world

‎packages/apps/vm-instance/templates/vm.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ spec:
2626
template:
2727
metadata:
2828
annotations:
29-
policy.cozystack.io/allow-external-communication: "false"
3029
kubevirt.io/allow-pod-bridge-network-live-migration: "true"
3130
labels:
3231
{{- include "virtual-machine.labels" . | nindent 8 }}

0 commit comments

Comments
 (0)