1

I have deployed pihole on my k3s cluster using this helm chart https://github.com/MoJo2600/pihole-kubernetes.
(I used this tutorial)
I now have my services but they dont have external IPs:

NAME             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
pihole-web       ClusterIP   10.43.58.197    <none>        80/TCP,443/TCP   11h
pihole-dns-udp   NodePort    10.43.248.252   <none>        53:30451/UDP     11h
pihole-dns-tcp   NodePort    10.43.248.144   <none>        53:32260/TCP     11h
pihole-dhcp      NodePort    10.43.96.49     <none>        67:30979/UDP     11h

I have tried to assing the IPs manually with this command:

kubectl patch svc pihole-dns-tcp -p '{"spec":{"externalIPs":["192.168.178.210"]}}'

But when executing the command i'm getting this error:

Error from server (NotFound): services "pihole-dns-tcp" not found

Any Ideas for a fix?
Thank you in advance :)

vince
  • 765
  • 3
  • 14
  • That "external IP" column doesn't actually do anything. It's only usually set if you have a LoadBalancer-type service and there's a controller that creates an out-of-cluster load balancer; there's no practical effect whether it's set or not. I'd skip this command entirely. (It'd be better to configure your application via Helm chart parameters than to manually `kubectl patch` or `kubectl edit` it in any case.) – David Maze Jun 06 '22 at 10:55
  • @DavidMaze thx for the answer. But just out of curiosity do you have an idea why i cant find the services? – vince Jun 06 '22 at 12:24

1 Answers1

1
  • Looks Like "pihole-dns-tcp" is in a different namespace to the namespace where patch command is being ran.

  • As per the article you have shared , it seems like service pihole-dns-tcp is in pihole . So the command should be

kubectl patch svc pihole-dns-tcp -n pihole -p '{"spec":{"externalIPs":["192.168.178.210"]}}'

confused genius
  • 2,876
  • 2
  • 16
  • 29