简体   繁体   English

未找到 kubectl 补丁返回服务

[英]kubectl patch returning service not found

I have deployed pihole on my k3s cluster using this helm chart https://github.com/MoJo2600/pihole-kubernetes .我已经使用这个掌舵图https://github.com/MoJo2600/pihole-kubernetes在我的 k3s 集群上部署了 pihole。
(I used this tutorial ) (我使用了本教程
I now have my services but they dont have external IPs:我现在有我的服务,但他们没有外部 IP:

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:我尝试使用以下命令手动分配 IP:

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 :)先感谢您 :)

  • Looks Like "pihole-dns-tcp" is in a different namespace to the namespace where patch command is being ran.看起来“pihole-dns-tcp”与正在运行补丁命令的命名空间位于不同的命名空间中。

  • As per the article you have shared , it seems like service pihole-dns-tcp is in pihole .根据您分享的文章,服务pihole-dns-tcp似乎在pihole中。 So the command should be所以命令应该是

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM