I have traefik running tuning in my kubernetes cluster at a namespace labeled purelb:
$ kubectl get pods -n purelb
NAME READY STATUS RESTARTS AGE
allocator-79f6995c5b-56ngh 1/1 Running 1 (8h ago) 14h
lbnodeagent-6zp75 1/1 Running 1 (8h ago) 14h
lbnodeagent-8s9ml 1/1 Running 1 (8h ago) 14h
traefik-84bfd89fc4-h4xwg 1/1 Running 0 3h10m
whoami-64f6cf779d-bfdrp 1/1 Running 0 7m6s
whoami-64f6cf779d-jm4cq 1/1 Running 0 7m6s
$ kubectl get services -n purelb
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
servicetest LoadBalancer 10.96.26.67 192.168.0.230 80:31357/TCP 10h
traefik LoadBalancer 10.96.141.166 192.168.0.231 80:32525/TCP,443:30543/TCP 60m
whoami ClusterIP 10.96.1.56 <none> 80/TCP 2m2s
I am trying to deploy the whoami example using:
$ cat deploy_whoami.yaml
# whoami.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: purelb
spec:
replicas: 2
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami
ports:
- containerPort: 80
---
# whoami-service.yaml
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: purelb
spec:
ports:
- port: 80
selector:
app: whoami
---
# whoami-ingressroute.yaml
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: whoami
namespace: purelb
spec:
entryPoints:
- websecure
routes:
- match: Host(`kbapache.cn.lan`)
kind: Rule
services:
- name: whoami
port: 80
tls:
secretName: purelb-selfsigned-tls
After applying the yaml using:
$ kubectl create -f deploy_whoami.yaml -n purelb
deployment.apps/whoami created
service/whoami created
ingressroute.traefik.io/whoami created
and:
$ kubectl get services -n purelb
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
servicetest LoadBalancer 10.96.26.67 192.168.0.230 80:31357/TCP 13h
traefik LoadBalancer 10.96.141.166 192.168.0.231 80:32525/TCP,443:30543/TCP 3h24m
whoami ClusterIP 10.96.62.221 <none> 80/TCP 21m
$ kubectl describe service whoami -n purelb
Name: whoami
Namespace: purelb
Labels: <none>
Annotations: <none>
Selector: app=whoami
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.96.62.221
IPs: 10.96.62.221
Port: <unset> 80/TCP
TargetPort: 80/TCP
Endpoints: 10.244.1.39:80,10.244.2.49:80
Session Affinity: None
Internal Traffic Policy: Cluster
Events: <none>
I am getting the error:
2025-07-14T10:04:51Z ERR error="kubernetes service not found: purelb/whoami" ingress=whoami namespace=purelb providerName=kubernetescrd
showing that the whoami service can not be found.
What am I missing? Thanks in advance