Hi,
I'm using k3s on my home server. It runs a few server and use traefik 2.4.8 as default.
I've also a Raspberry Pi runs with Pihole. I want to use it behind traefik. I can't figure out how?
I'm using following yaml file;
error: unable to recognize “app-pihole.yaml”: no matches for kind “Ingress services pihole-svc loadBalancer servers - url ‘http://192.168.1.32:80’ passHostHeader true” in version “[networking.k8s.io/v1](http://networking.k8s.io/v1)”
How can I serve pihole server with traefik?
Thanks in advance.
There is no need to create the ingress resource to do that - the configuration for Ingress object that has been shared is not correct. See more details at this link to see how the Ingress object should be configured.
However, in order to add legacy routing you need to create a dynamic configuration in file as follows:
Basically speaking you have to create a router and service manually - use my example as a reference. Here are some links that might be helpful while creating the final configuration:
The configuration should be mounted as a config map into your Traefik instance.
kubectl apply -f pihole.yaml
error: error validating "pihole.yaml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
kubectl apply -f pihole.yaml --validate=false
error: unable to decode "pihole.yaml": Object 'Kind' is missing in '{"http":{"routers":{"my-router":{"rule":"Host(pihole.domain.ltd)","service":"service-pihole"}},"services":{"service-pihole":{"loadBalancer":{"servers":[{"url":"[http://192.168.xxx.xxx:80/]"}]}}}}}'
And then mount the configmap to your deployment, and tell traefik about this dynamic configuration (like --providers.file.filename=/traefik-dynamic.toml).