MoJo2600 / pihole-kubernetes

PiHole on kubernetes
507 stars 178 forks source link

ServiceWeb not building #230

Open vince-vibin opened 2 years ago

vince-vibin commented 2 years ago

Hey so im deploying this on my raspberry pi cluster with this comand: helm install --version '2.5.8' --namespace pihole --values values.yaml pihole mojo2600/pihole but when i check the pods the ServiceWeb pods are stuck in pending:

NAME                      READY   STATUS    RESTARTS   AGE     IP           NODE          NOMINATED NODE   READINESS GATES
svclb-pihole-web-9nsfv    0/2     Pending   0          3m37s   <none>       <none>        <none>           <none>
svclb-pihole-web-gdllc    0/2     Pending   0          3m37s   <none>       <none>        <none>           <none>
svclb-pihole-web-z2t75    0/2     Pending   0          3m37s   <none>       <none>        <none>           <none>
svclb-pihole-web-xshwc    0/2     Pending   0          3m37s   <none>       <none>        <none>           <none>
svclb-pihole-dhcp-v8gkd   1/1     Running   0          3m37s   10.42.1.9    worker1       <none>           <none>
svclb-pihole-dhcp-5rj2v   1/1     Running   0          3m37s   10.42.0.33   raspberrypi   <none>           <none>
svclb-pihole-dhcp-vnqh5   1/1     Running   0          3m37s   10.42.2.9    worker2       <none>           <none>
svclb-pihole-dhcp-ptmxq   1/1     Running   0          3m37s   10.42.3.9    worker3       <none>           <none>
pihole-5f7b84cfb8-ms4w8   1/1     Running   0          3m37s   10.42.0.35   raspberrypi   <none>           <none>

also this is my values.yaml:

---
persistentVolumeClaim:
  enabled: true

ingress:
  enabled: true

serviceWeb:
  type: ClusterIP
  loadBalancerIP: 192.168.178.210
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  type: LoadBalancer

serviceDNS:
  loadBalancerIP: 192.168.178.211
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  type: LoadBalancer

serviceDhcp:
  loadBalancerIP: 192.168.178.212
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  type: LoadBalancer

podDnsConfig:
  enabled: true
  policy: "None"
  nameservers:
  - 8.8.8.8
  - 8.8.4.4

(Note that loadBalancerIP never is the IP of a node but a random free IP in the network and i dont really know if that is how it is supposed to be 😅) When is describe a pod im getting this error:

0/4 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 3 node(s) didn't match Pod's node affinity/selector.

Do you guys have any idea?

vince-vibin commented 2 years ago

so i think i actually just fixed in by just disabeling traefic. Maybe this is going to cause problems later so im going to keep you updated. To disable i used this command: kubectl delete -n kube-system helmcharts traefik The thing is that i now have multiple adresses for each service and i think that should not be the case

NAME             TYPE           CLUSTER-IP      EXTERNAL-IP                                                       PORT(S)                      AGE
pihole-dhcp      LoadBalancer   10.43.144.208   192.168.178.200,192.168.178.201,192.168.178.202,192.168.178.203   67:32211/UDP                 2m30s
pihole-dns-tcp   LoadBalancer   10.43.186.24    192.168.178.200,192.168.178.201,192.168.178.202,192.168.178.203   53:31398/TCP                 2m30s
pihole-dns-udp   LoadBalancer   10.43.243.170   192.168.178.200,192.168.178.201,192.168.178.202,192.168.178.203   53:31275/UDP                 2m30s
pihole-web       LoadBalancer   10.43.19.61     192.168.178.200,192.168.178.201,192.168.178.202,192.168.178.203   80:30004/TCP,443:30006/TCP   2m30s

Any ideas about that?

MoJo2600 commented 2 years ago

You have defined type twice. Maybe thats the issue?

serviceWeb:
  type: ClusterIP
  loadBalancerIP: 192.168.178.210
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc
  type: LoadBalancer

loadBalancerIP will be removed soon, as it is deprecrated.

I think your Metallb setup is not correct. If you remove the loadBalancerIP setting all the services should be deployed with one external IP.

vince-vibin commented 2 years ago

i'm new to this so maybe i'm not really getting what you want me to do, but i now deployed the service like this

serviceWeb:
  type: LoadBalancer
  annotations:
    metallb.universe.tf/allow-shared-ip: pihole-svc

but its still just pending. is there any documentation about the right metallb config?