Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

[Nginx Ingress Controller] fails if IPv6 addresses are used for DNS #2188

Closed
rutsky opened this issue Dec 20, 2016 · 0 comments · Fixed by kubernetes/ingress-nginx#77
Closed

Comments

@rutsky
Copy link
Contributor

rutsky commented Dec 20, 2016

I'm running trying to deploy K8s cluster on Ubuntu 16.04 on DigitalOcean with enabled IPv6.

When I'm trying to deploy nginx-ingress-controller (using this config) I'm getting crashing nginx-ingress-controller:

$ kubectl --kubeconfig admin.conf get pods
NAME                             READY     STATUS             RESTARTS   AGE
default-http-backend-mlr35       1/1       Running            0          16m
nginx-ingress-controller-c9vtm   0/1       CrashLoopBackOff   6          10m

With error about incorrect configuration of nginx:

$ kubectl --kubeconfig admin.conf logs nginx-ingress-controller-c9vtm
I1220 21:46:42.046335       1 main.go:94] Using build: https://github.com/bprashanth/contrib.git - git-92b2bac
I1220 21:46:42.186986       1 main.go:123] Validated default/default-http-backend as the default backend
W1220 21:46:42.187975       1 ssl.go:132] no file dhparam.pem found in secrets
I1220 21:46:42.193668       1 controller.go:1126] starting NGINX loadbalancer controller
I1220 21:46:42.194230       1 command.go:35] Starting NGINX process...
W1220 21:46:43.235862       1 utils.go:91] requeuing default/kubernetes, err deferring sync till endpoints controller has synced
E1220 21:46:43.405212       1 command.go:87] failed to execute nginx -s reload: 2016/12/20 21:46:43 [emerg] 17#17: invalid port in resolver "2001:4860:4860::8844" in /etc/nginx/nginx.conf:76
nginx: [emerg] invalid port in resolver "2001:4860:4860::8844" in /etc/nginx/nginx.conf:76
W1220 21:46:43.405682       1 utils.go:91] requeuing kube-system/kube-controller-manager, err error reloading nginx: exit status 1
I1220 21:46:59.545275       1 main.go:187] Received SIGTERM, shutting down
I1220 21:46:59.545402       1 controller.go:1074] removing IP address 82.196.1.53 from ingress rules
I1220 21:46:59.545424       1 controller.go:1091] updating 0 Ingress rule/s
I1220 21:46:59.545433       1 controller.go:1077] Shutting down controller queues.
I1220 21:46:59.545495       1 main.go:145] Handled quit, awaiting pod deletion
I1220 21:47:29.545682       1 main.go:145] Handled quit, awaiting pod deletion
I1220 21:47:52.189014       1 main.go:195] Exiting with 0

Specifically nginx is not happy about this line in /etc/nginx/nginx.conf:

    # Custom dns resolver.
    resolver 2001:4860:4860::8844 2001:4860:4860::8888 8.8.8.8 valid=30s;

Host's /etc/resolv.conf contains:

# cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 2001:4860:4860::8844
nameserver 2001:4860:4860::8888
nameserver 8.8.8.8

which probably leads to generation of that incorrect config.

nginx-ingress-controller should check IP address type and properly wrap IPv6 address before pasting to config (I think it should be like resolver [2001:4860:4860::8844] [2001:4860:4860::8888] 8.8.8.8 valid=30s;, but I haven't checked that).

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

Successfully merging a pull request may close this issue.

1 participant