travisghansen / kubernetes-pfsense-controller

Integrate Kubernetes and pfSense
Apache License 2.0
197 stars 22 forks source link

Errors and warnings in logs, no domains added to DNS Resolver #3

Closed toxuin closed 4 years ago

toxuin commented 4 years ago

Using version 0.1.8, just updated from 0.1.5 and all my cluster domain names are gone from DNS resolver settings. I am seeing warnings and errors in logs of the controller:

PHP Warning: Illegal string offset 'host' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/Utils.php on line 136`
...
11/16/2019 10:43:03 PM 2019-11-17T05:43:03+00:00 plugin (pfsense-dns-ingresses): failed saving unbound config: Read timed out after 10 seconds (1000)
11/16/2019 10:43:03 PM 2019-11-17T05:43:03+00:00 plugin (pfsense-dns-ingresses): failed update/reload: Read timed out after 10 seconds (1000)
11/16/2019 10:43:17 PM PHP Warning: Invalid argument supplied for foreach() in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/DNSResourceTrait.php on line 31
...
2019-11-17T05:43:17+00:00 plugin (pfsense-dns-ingresses): deleting hostname entry for host: domain1.example.com
11/16/2019 10:43:17 PM PHP Warning: Illegal string offset 'host' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/Utils.php on line 136

ConfigMap kubernetes-pfsense-controller-store has {"managed_hosts":[]} for both pfsense-dns-ingresses as well as pfsense-dns-services.

Running kubernetes version 1.15.5

travisghansen commented 4 years ago

Sorry to hear that :( if you revert to the earlier version do they come back?

toxuin commented 4 years ago

Yes, that is what I did for now.

travisghansen commented 4 years ago

Interesting, I'll have a look and see what I can see.

travisghansen commented 4 years ago

What about 1.7? Just trying to narrow down the code diff.

toxuin commented 4 years ago

Version 0.1.7 seems to work fine!

travisghansen commented 4 years ago

I'm guessing it has something to do with k8s version checking to determine new endpoints or related. I use the service plugin without issue however on a 1.15 cluster without issue so that's a bit strange. I may have you send me the output of the same resource using the 2 different endpoints and see what we get.

toxuin commented 4 years ago

You mean ingress resources /apis/extensions/v1beta1/ingresses vs /apis/extensions/v1beta1/ingresses? Then here you go 😄

Update: silly me, I have accessed both resources with a cluster admin account. Impersonating service account shows different picture: 403 on /apis/networking.k8s.io/v1beta1/ingresses. I should've noticed it sooner! D'oh!

travisghansen commented 4 years ago

Yeah nice find. I didn't see it because I run out of cluster with admin config :(

toxuin commented 4 years ago

0.1.8 with change in ClusterRole does fix most of the error messages, but one persists:

2019-11-20T23:23:03+00:00 plugin (pfsense-dns-ingresses): failed saving dnsmasq config: Read timed out after 10 seconds (1000)
11/20/2019 4:23:03 PM 2019-11-20T23:23:03+00:00 plugin (pfsense-dns-ingresses): failed update/reload: Read timed out after 10 seconds (1000)

Just tried to delete a service with a hostname and had another one:

PHP Warning: Illegal string offset 'host' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/Utils.php on line 136
11/20/2019 4:30:22 PM PHP Warning: Illegal string offset 'host' in phar:///usr/local/bin/kubernetes-pfsense-controller/src/KubernetesPfSenseController/Plugin/Utils.php on line 136
travisghansen commented 4 years ago

Do you use dnsmasq?

toxuin commented 4 years ago

I use unbound. It actually worked (delete service with hostname = remove alias in unbound), despite all the errors in logs. I have noticed that recent update had some more logging functionality, so maybe it was always like that, just never visible? 😄

travisghansen commented 4 years ago

Turn off dnsmasq in your configmap.

travisghansen commented 4 years ago

That clear everything up?

toxuin commented 4 years ago

Seems to be the case!