Skip to content

Commit

Permalink
Add static IP address pool for MetalLB and update Pi-hole configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasDeHondt committed Dec 18, 2024
1 parent 0d1bb4f commit e1f2a7f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Supercluster/Cluster01/Metallb/IPAddressPool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ metadata:
spec:
addresses:
- 192.168.1.160-192.168.1.169
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: static-ip-1
namespace: metallb-system
spec:
addresses:
- 192.168.1.120-192.168.1.120
---
1 change: 1 addition & 0 deletions Supercluster/Cluster01/Metallb/L2Advertisement.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ metadata:
spec:
ipAddressPools:
- address-pool-1
- static-ip-1
---
7 changes: 5 additions & 2 deletions Supercluster/Cluster01/PiHole/Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ spec:
image: pihole/pihole:latest
ports:
- containerPort: 53
protocol: UDP
- containerPort: 53
protocol: TCP
- containerPort: 80
- containerPort: 443
env:
- name: ServerIP
value: "0.0.0.0"
- name: PIHOLE_PASSWORD
- name: WEBPASSWORD
valueFrom:
secretKeyRef:
name: pihole-secret
key: PIHOLE_PASSWORD
key: WEBPASSWORD
volumeMounts:
- name: pihole1-storage
mountPath: /etc/pihole
Expand Down
9 changes: 8 additions & 1 deletion Supercluster/Cluster01/PiHole/Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ kind: Service
metadata:
name: pihole-service
namespace: pihole
annotations:
metallb.universe.tf/address-pool: static-ip-1
spec:
selector:
app: pihole
ports:
- name: dns
- name: dns-tcp
protocol: TCP
port: 53
targetPort: 53
- name: dns-udp
protocol: UDP
port: 53
targetPort: 53
- name: http
protocol: TCP
port: 80
Expand All @@ -26,4 +32,5 @@ spec:
port: 443
targetPort: 443
type: LoadBalancer
loadBalancerIP: 192.168.1.120 # Static IP from the Metallb IPAddressPool (static-ip-1)
---

0 comments on commit e1f2a7f

Please sign in to comment.