Skip to content

Commit

Permalink
feat(HomeAssistant): Dual NAD VLANs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurVardevanyan committed Dec 26, 2024
1 parent 6384d16 commit b163f6a
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kubernetes/ceph/base/ocs-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
severity_level: critical
storage_type: ceph
expr: |
label_replace((up{job="rook-ceph-mgr"} == 0 or absent(up{job="rook-ceph-mgr"})), "namespace", "openshift-storage", "", "")
label_replace((up{job="rook-ceph-mgr"} == 0 or absent(up{job="rook-ceph-mgr"})), "namespace", "rook-ceph", "", "")
for: 5m
labels:
severity: critical
Expand Down
10 changes: 8 additions & 2 deletions kubernetes/homeassistant/base/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ spec:
enable.version-checker.io/homeassistant: "true"
k8s.v1.cni.cncf.io/networks: |
[{
"name": "br1-vlan3",
"namespace": "default",
"mac": "10:01:01:00:30:02",
"ips": ["10.101.3.2/24"],
"default-route": ["10.101.3.1"]
},
{
"name": "br1",
"namespace": "default",
"mac": "10:00:00:00:01:35",
"ips": ["10.0.0.135/24"],
"default-route": ["10.0.0.1"]
"ips": ["10.0.0.135/24"]
}]
spec:
securityContext:
Expand Down
9 changes: 9 additions & 0 deletions kubernetes/homeassistant/overlays/okd/egress-firewall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ spec:
nodeSelector:
matchLabels:
node-role.kubernetes.io/control-plane: ""
- type: Allow
to:
dnsName: mobile-apps.home-assistant.io
- type: Deny
to:
cidrSelector: 151.101.1.195/32
- type: Deny
to:
cidrSelector: 151.101.65.195/32
- type: Allow
to:
dnsName: truenas.arthurvardevanyan.com
Expand Down
7 changes: 7 additions & 0 deletions kubernetes/kubevirt/base/vm/vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ spec:
macAddress: "10:00:00:00:01:33"
model: virtio
name: br1
- bridge: {}
macAddress: "10:01:01:00:30:03"
model: virtio
name: br1-vlan3
networkInterfaceMultiqueue: true
rng: {}
features:
Expand All @@ -97,6 +101,9 @@ spec:
- multus:
networkName: default/br1
name: br1
- multus:
networkName: default/br1-vlan3
name: br1-vlan3
terminationGracePeriodSeconds: 180
volumes:
- dataVolume:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ spec:
generateBucketName: netobserv
storageClassName: rook-ceph-bucket
additionalConfig:
maxSize: "150Gi"
maxSize: "200Gi"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: br1
namespace: default
annotations:
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1
#k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "4"
spec:
Expand All @@ -15,3 +15,21 @@ spec:
"topology":"localnet",
"netAttachDefName": "default/br1"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: br1-vlan3
namespace: default
annotations:
#k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/br1-vlan3
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "4"
spec:
config: '{
"cniVersion": "0.3.1",
"name": "br1.3",
"type": "ovn-k8s-cni-overlay",
"topology":"localnet",
"netAttachDefName": "default/br1-vlan3"
}'
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
dhcp: true
enabled: true
bridge:
allow-extra-patch-ports: true
options:
stp:
enabled: false
Expand Down Expand Up @@ -50,6 +51,7 @@ spec:
dhcp: true
enabled: true
bridge:
allow-extra-patch-ports: true
options:
stp:
enabled: false
Expand Down Expand Up @@ -103,3 +105,89 @@ spec:
dhcp: false
enabled: false
mtu: 9000
---
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: vlan3-enp5s0
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
nodeSelector:
nic: enp5s0
desiredState:
interfaces:
- name: enp5s0.3
description: VLAN using enp5s0
type: vlan
state: up
ipv4:
dhcp: false
enabled: false
vlan:
base-iface: enp5s0
id: 3
mtu: 9000
- name: br1.3
description: OVS bridge with enp5s0.3 as a port
type: ovs-bridge
state: up
ipv4:
dhcp: true
enabled: true
bridge:
allow-extra-patch-ports: true
options:
stp:
enabled: false
port:
- name: enp5s0.3
mtu: 9000
ovn:
bridge-mappings:
- localnet: br1.3
bridge: br1.3
state: present
---
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: vlan3-enp7s0
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
nodeSelector:
nic: enp7s0
desiredState:
interfaces:
- name: enp7s0.3
description: VLAN using enp7s0
type: vlan
state: up
ipv4:
dhcp: false
enabled: false
vlan:
base-iface: enp7s0
id: 3
mtu: 9000
- name: br1.3
description: OVS bridge with enp7s0.3 as a port
type: ovs-bridge
state: up
ipv4:
dhcp: true
enabled: true
bridge:
allow-extra-patch-ports: true
options:
stp:
enabled: false
port:
- name: enp7s0.3
mtu: 9000
ovn:
bridge-mappings:
- localnet: br1.3
bridge: br1.3
state: present
5 changes: 4 additions & 1 deletion kubernetes/unifi-network-application/base/dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ spec:
recordTTL: 60
recordType: A
targets:
- 10.0.0.1 #10.0.0.136
- 10.101.1.1
- dnsName: unifi.arthurvardevanyan.com
recordTTL: 60
recordType: A
targets:
- 10.0.0.1
# - 10.101.1.1
# - 10.101.2.1
# - 10.101.3.1

0 comments on commit b163f6a

Please sign in to comment.