Hi everybody,
I’ve been trying to get my listener to attach to my Gateway in kubernetes, and I just can’t get it to work! Here’s what I’ve written till now:
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
namespace: bind9
name: bind9-gatewayclass
spec:
controllerName: haproxy.org/gateway-controller
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: Gateway
metadata:
name: bind9-gateway
namespace: bind9
spec:
gatewayClassName: bind9-gatewayclass
listeners:
- allowedRoutes:
kinds:
- group: gateway.networking.k8s.io
kind: TCPRoute
namespaces:
from: All
name: bind9-dns-listener
port: 53
protocol: TCP
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
name: bind9-dns-route
namespace: bind9
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: bind9-gateway
namespace: bind9
rules:
- backendRefs:
- group: ""
kind: Service
name: bind9-dns-service
port: 53
---
apiVersion: v1
kind: Service
metadata:
namespace: bind9
name: bind9-dns-service
spec:
selector:
app: bind9
ports:
- name: bind9-dns
protocol: TCP
port: 53
targetPort: 53
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: bind9-deployment
namespace: bind9
labels:
app: bind9
spec:
replicas: 1
selector:
matchLabels:
app: bind9
template:
metadata:
labels:
app: bind9
spec:
containers:
- name: bind9
image: ubuntu/bind9:edge # Use a pre-built BIND9 image
ports:
- containerPort: 53
protocol: TCP
args:
- "/usr/sbin/named"
- "-g" # Start BIND9 in the foreground
- "-c"
- "/etc/bind/named.conf"
Sorry to make you go through such a long file, but any help would be greatly appreciated! The error message is:
$ kubectl describe gateway bind9-gateway -n bind9
Listeners:
Attached Routes: 1
Conditions:
Last Transition Time: 2024-08-06T03:42:19Z
Message:
Observed Generation: 1
Reason: ResolvedRefs
Status: True
Type: ResolvedRefs
Last Transition Time: 2024-08-06T03:42:19Z
Message:
Observed Generation: 1
Reason: Attached
Status: False
Type: Detached
Last Transition Time: 2024-08-06T03:42:19Z
Message:
Observed Generation: 1
Reason: Ready
Status: True
Type: Ready
Name: bind9-dns-listener
Thanks!