Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pihole-FTL: no process found on hostNetwork #271

Open
Rahulsharma0810 opened this issue Nov 1, 2023 · 9 comments
Open

pihole-FTL: no process found on hostNetwork #271

Rahulsharma0810 opened this issue Nov 1, 2023 · 9 comments

Comments

@Rahulsharma0810
Copy link

Yet Another "pihole-FTL: no process found"

I tried pihole/ftl-build:v2.3-alpine Image, but it's just entering to crashbackLoop, without even starting the container.

replicaCount: 1
nodeSelector:
  kubernetes.io/hostname: kube-node-1-01

image:
  # -- the repostory to pull the image from
  repository: "pihole/pihole"
  # -- the docker tag, if left empty it will get it from the chart's appVersion
  tag: ""
  # -- the pull policy
  pullPolicy: Always

dnsHostPort:
  # -- set this to true to enable dnsHostPort
  enabled: true
  # -- default port for this pod
  port: 53

# -- Configuration for the DNS service on port 53
serviceDns:
  # -- deploys a mixed (TCP + UDP) Service instead of separate ones
  mixedService: true

  # -- `spec.type` for the DNS Service
  type: LoadBalancer

serviceDhcp:
  # -- Generate a Service resource for DHCP traffic
  enabled: true

  # -- `spec.type` for the DHCP Service
  type: LoadBalancer


persistentVolumeClaim:
  # -- set to true to use pvc
  enabled: true

# -- should the container use host network
hostNetwork: "true"

# -- should container run in privileged mode
privileged: "true"
extraEnvVars: { DNSMASQ_USER: "root" }
capabilities:
  add:
    - NET_ADMIN
    - CAP_NET_RAW
    - CAP_NET_ADMIN
    - CAP_SYS_NICE
    - CAP_CHOWN

Degrading versions doesn't help. Any guidance is highly appreciated.

@Rahulsharma0810 Rahulsharma0810 changed the title pihole-FTL: no process found pihole-FTL: no process found on hostNetwork Nov 1, 2023
@Rahulsharma0810
Copy link
Author

I found enabling

hostNetwork: true

Results pihole-FTL: no process found

I am trying to make DHCP work by following #18 (comment)

@madic-creates
Copy link

madic-creates commented Dec 20, 2023

You get the error because there is already some process listening on udp port 57, so pihole can't use it. But I got it working with dhcp enabled. Though it requires the help of a dhcphelper (or dhcp relay).

Basically I'm running pihole as a normal pod, not with host networking enabled. But the dhcphelper is configured with host networking enabled and forwards the dhcp requests as unicast frames to pihole.

The important values for this chart:

      serviceDhcp:
        loadBalancerIP: 192.168.1.232
        type: LoadBalancer
      customSettings:
        - dhcp-option=6,192.168.1.232,192.168.1.1 # DNS dhcp option
      capabilities:
        add:
          - NET_ADMIN

This exposes the dhcp service on 192.168.1.232. The following dhcphelper kubernetes deployment forwards the dhcp broadcasts to the exposed 192.168.1.232:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: dhcphelper
  name: dhcphelper
  namespace: dns
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: dhcphelper
  replicas: 1
  revisionHistoryLimit: 3
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dhcphelper
    spec:
      containers:
        - name: dhcphelper
          image: homeall/dhcphelper:latest
          env:
            - name: IP
              value: "192.168.1.232"
            - name: TZ
              value: "Europe/Berlin"
          securityContext:
            capabilities:
              add:
                - NET_ADMIN
          resources:
            limits:
              cpu: 100m
              memory: 32Mi
            requests:
              cpu: 100m
              memory: 32Mi
      hostNetwork: true
  strategy:
    type: Recreate

@MoJo2600
Copy link
Owner

Thanks @Madic- for this variant. There are a lot of kubernetes beginner questions on how to setup the ports and some misunderstanding why something is not working. It would be great to have the different setup options documented somewhere to make life easier for beginners.

@MoJo2600
Copy link
Owner

@Rahulsharma0810 you could also use some form of loadbalancer (e.g. MetalLB) to expose the port to the network. Then it does not interfere with the cluster nodes.

@madic-creates
Copy link

I had that (not MetalLB but Kube-VIP), but it was not working because DHCP is working at OSI Layer 2 and not 3. DHCP Requests are Arp Broadcasts and not IP Traffic. The dhcphelper captures the Broadcasts and "converts" it into IP by forwarding it to a specific IP/Port.

@MoJo2600
Copy link
Owner

Ah yes you are right... DHCP

@Rahulsharma0810
Copy link
Author

Right Madic, I tried it already with MetalLB. I stopped using the Pihole because of that.

@irjohn
Copy link

irjohn commented May 12, 2024

You get the error because there is already some process listening on udp port 57, so pihole can't use it. But I got it working with dhcp enabled. Though it requires the help of a dhcphelper (or dhcp relay).

Basically I'm running pihole as a normal pod, not with host networking enabled. But the dhcphelper is configured with host networking enabled and forwards the dhcp requests as unicast frames to pihole.

The important values for this chart:

      serviceDhcp:
        loadBalancerIP: 192.168.1.232
        type: LoadBalancer
      customSettings:
        - dhcp-option=6,192.168.1.232,192.168.1.1 # DNS dhcp option
      capabilities:
        add:
          - NET_ADMIN

This exposes the dhcp service on 192.168.1.232. The following dhcphelper kubernetes deployment forwards the dhcp broadcasts to the exposed 192.168.1.232:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: dhcphelper
  name: dhcphelper
  namespace: dns
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: dhcphelper
  replicas: 1
  revisionHistoryLimit: 3
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dhcphelper
    spec:
      containers:
        - name: dhcphelper
          image: homeall/dhcphelper:latest
          env:
            - name: IP
              value: "192.168.1.232"
            - name: TZ
              value: "Europe/Berlin"
          securityContext:
            capabilities:
              add:
                - NET_ADMIN
          resources:
            limits:
              cpu: 100m
              memory: 32Mi
            requests:
              cpu: 100m
              memory: 32Mi
      hostNetwork: true
  strategy:
    type: Recreate

Can you share your dhcphelper image? I would like to try that as well, Im using MetalLB and im running into port 57 already being used when I set hostNetwork to true when trying to create a DHCP server on pihole

@madic-creates
Copy link

What do you need? The image can be found as part of the kubernetes manifest: image: homeall/dhcphelper

A search engine leads me to the following github repo: https://github.com/homeall/dhcphelper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants