feat(irc): restrict ingress to gateway and thelounge
Best Practices / Kube-score Analysis (push) Has been cancelled
Best Practices / Polaris Audit (push) Has been cancelled
Best Practices / Resource Usage Analysis (push) Has been cancelled
Best Practices / PR Summary Report (push) Has been cancelled
Best Practices / Polaris PR Review (push) Has been cancelled
Security Scan / Trivy Security Scan (push) Has been cancelled
Security Scan / Trivy PR Review (push) Has been cancelled
Security Scan / Checkov IaC Scan (push) Has been cancelled
Security Scan / Checkov PR Review (push) Has been cancelled
Validate Manifests / Kustomize Build Test (push) Successful in 35s
Validate Manifests / YAML Lint (push) Failing after 35s
Validate Manifests / Kubernetes Schema Validation (push) Successful in 35s

Add CiliumNetworkPolicy ingress rules so thelounge only accepts traffic
from the cilium external gateway in gateway-system, and znc only from
the thelounge pod. Allow host entity on both for kubelet probes.

Switch znc service to ClusterIP and drop the external-dns annotation
since direct external IRC client access is no longer desired.
This commit is contained in:
2026-05-17 08:17:20 -04:00
parent ee93aca3b8
commit 19b175dcf2
3 changed files with 33 additions and 5 deletions
+16 -1
View File
@@ -1,12 +1,27 @@
apiVersion: cilium.io/v2 apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy kind: CiliumNetworkPolicy
metadata: metadata:
name: thelounge-egress name: thelounge
namespace: irc namespace: irc
spec: spec:
endpointSelector: endpointSelector:
matchLabels: matchLabels:
app.kubernetes.io/name: thelounge app.kubernetes.io/name: thelounge
ingress:
- fromEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: gateway-system
k8s:gateway.networking.k8s.io/gateway-name: external
toPorts:
- ports:
- port: "9000"
protocol: TCP
- fromEntities:
- host
toPorts:
- ports:
- port: "9000"
protocol: TCP
egress: egress:
- toEndpoints: - toEndpoints:
- matchLabels: - matchLabels:
+16 -1
View File
@@ -1,12 +1,27 @@
apiVersion: cilium.io/v2 apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy kind: CiliumNetworkPolicy
metadata: metadata:
name: znc-egress name: znc
namespace: irc namespace: irc
spec: spec:
endpointSelector: endpointSelector:
matchLabels: matchLabels:
app.kubernetes.io/name: znc app.kubernetes.io/name: znc
ingress:
- fromEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: irc
k8s:app.kubernetes.io/name: thelounge
toPorts:
- ports:
- port: "6501"
protocol: TCP
- fromEntities:
- host
toPorts:
- ports:
- port: "6501"
protocol: TCP
egress: egress:
- toEndpoints: - toEndpoints:
- matchLabels: - matchLabels:
+1 -3
View File
@@ -6,10 +6,8 @@ metadata:
name: znc name: znc
labels: labels:
app.kubernetes.io/name: znc app.kubernetes.io/name: znc
annotations:
external-dns.alpha.kubernetes.io/hostname: ${ZNC_HOSTNAME}
spec: spec:
type: LoadBalancer type: ClusterIP
ports: ports:
- port: 6501 - port: 6501
selector: selector: