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

tink-stack nginx can't handle IPv6 adresses #99

Open
sepauli opened this issue Jun 3, 2024 · 0 comments · May be fixed by #106
Open

tink-stack nginx can't handle IPv6 adresses #99

sepauli opened this issue Jun 3, 2024 · 0 comments · May be fixed by #106

Comments

@sepauli
Copy link
Contributor

sepauli commented Jun 3, 2024

Description

We have an RKE2 cluster running in IPv6 only mode.
During the deployment via the helm chart the tink-stack pod does not start due to the following error message

:~# kubectl logs -n tink-system tink-stack-6bbc556dd-znd6j
Defaulted container "tink-stack" out of: tink-stack, dhcp-relay
++ awk '/nameserver/ {print $2}' /etc/resolv.conf
+ POD_NAMESERVER=fd05:0000:0000::a
+ envsubst '$POD_NAMESERVER'
+ exec nginx -g 'daemon off;'
2024/06/03 16:23:37 [emerg] 3210953#3210953: invalid port in resolver "fd05:0000:0000::a" in /etc/nginx/nginx.conf:13
nginx: [emerg] invalid port in resolver "fd05:0000:0000::a" in /etc/nginx/nginx.conf:13

The reason is that the following bash command cannot handle IPv6 addresses.

        args:
        - |
          POD_NAMESERVER=$(awk '/nameserver/ {print $2}' /etc/resolv.conf) \
            envsubst '$POD_NAMESERVER' \
            </tmp/nginx.conf.template \
            >/etc/nginx/nginx.conf
          exec nginx -g 'daemon off;'

I changed the command to the following one, which works for me

        - export POD_NAMESERVER=$(awk 'NR==2 {print $2}' /etc/resolv.conf);
          [[ $POD_NAMESERVER == *.* ]] || POD_NAMESERVER="[$POD_NAMESERVER]";
          envsubst '$POD_NAMESERVER' < /tmp/nginx.conf.template > /etc/nginx/nginx.conf;
          nginx -g 'daemon off;'

I can open a PR if you want

To Reproduce

Deploy an RKE2 Cluster in IPv6 only mode and try to deploy the helm-chart

@sepauli sepauli linked a pull request Jun 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant