fix(kubevirt): netpols, auto resource limits

This commit is contained in:
JJGadgets
2023-12-27 03:04:13 +08:00
parent 196e7a44c0
commit aebdbda8ac
4 changed files with 39 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ spec:
developerConfiguration:
featureGates:
- VMPersistentState
- AutoResourceLimitsGate
target:
group: kubevirt.io
kind: KubeVirt

View File

@@ -0,0 +1,28 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/cilium.io/ciliumnetworkpolicy_v2.json
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: &app vm-ad
namespace: *app
spec:
endpointSelector: {}
ingress:
# same namespace
- fromEntities:
- cluster
- world
toPorts:
- ports:
- port: "45678"
protocol: UDP
- port: "41641"
protocol: UDP
egress:
# same namespace
- toEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: *app
# TODO: egress to everything
- toEntities:
- world

View File

@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Service
metadata:
name: "vm-ad"
spec:
type: ClusterIP
clusterIP: None
selector:
vm.home.arpa/windows: "ad"

View File

@@ -33,8 +33,6 @@ spec:
devices:
disks:
- name: "c-drive"
disk:
bus: "sata"
interfaces:
- name: "main"
masquerade: {}
@@ -50,13 +48,6 @@ spec:
bootloader:
efi:
persistent: true
resources:
# requests:
# cpu: "100m"
# memory: "8192Mi"
limits:
cpu: "2000m"
memory: "12Gi"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"