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

ipv6 support for the aggregator handler. #542

Closed
mauilion opened this issue Oct 12, 2018 · 5 comments · Fixed by #545
Closed

ipv6 support for the aggregator handler. #542

mauilion opened this issue Oct 12, 2018 · 5 comments · Fixed by #545
Labels
kind/bug Behavior isn't as expected or intended p1-important

Comments

@mauilion
Copy link

What steps did you take and what happened:
When running sonobuoy on a pure ipv6 cluster the systemd plugin doesn't work correctly we see errors like:

time="2018-10-12T21:17:47Z" level=error msg="error encountered dialing master at https://fd00:40::3:0:0:3:8080/api/v1/results/by-node/kube-node-2/systemd_logs: Put https://fd00:40::3:0:0:3:8080/api/v1/results/by-node/kube-node-2/systemd_logs: invalid URL port \"40::3:0:0:3:8080\""

where fd00:40::3:0:0:3 not in brackets like https://[fd00:40::3:0:0:3]:8080.
Keeping the call from working.

What did you expect to happen:
That the code would bracket all ips so that this works. You can bracket ipv4 or ipv6 addresses and things work well.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Sonobuoy version:
  • Kubernetes version: (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Sonobuoy tarball (which contains * below)
@timothysc
Copy link
Contributor

/assign @liztio

@mauilion
Copy link
Author

mauilion commented Oct 12, 2018

to test this you can use kubeadm-dind like:

wget https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.11.sh
$ chmod +x dind-cluster-v1.11.sh
$ export IP_MODE=ipv6
$ ./dind-cluster-v1.11.sh up
## drink coffee waiting for cluster up to finish
$ sonobuoy run

cleanup is

$ ./dind-cluster-v1.11.sh down
$ ./dind-cluster-v1.11.sh clean

@mauilion mauilion changed the title ipv6 support for the systemd plugin ipv6 support for the aggregator hander. Oct 12, 2018
@mauilion
Copy link
Author

mauilion commented Oct 12, 2018

pretty sure the bug is here:
https://github.com/heptio/sonobuoy/blob/master/pkg/plugin/aggregation/handler.go#L88-L123

path.host needs to be split into

path.hostname and path.port and hostname needs wrapped in [ ] if it's an ip.

@timothysc
Copy link
Contributor

@liztio this seems like an easy patch to the client/dialer code, could you enqueue this one for this week?

@timothysc timothysc added kind/bug Behavior isn't as expected or intended p1-important labels Oct 15, 2018
@mauilion mauilion changed the title ipv6 support for the aggregator hander. ipv6 support for the aggregator handler. Oct 15, 2018
@mauilion
Copy link
Author

I'm wrong actually the baseurl needs to be bracketed before passing to the handler

mauilion pushed a commit to mauilion/sonobuoy that referenced this issue Oct 16, 2018
This change adds brackets around the ip address when it is learned. This
is compatible with ipv4 and ipv6 setups.

Before this change if you ran sonobuoy in an ipv6 cluster the
aggregation mechanism would break with logs like:
```
13:10 $ sonobuoy e2e ipv4_with_ipv6_fix.tar.gz --show passed
passed tests
[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]
```

preventing the sonbuoy pod from marking any plugin complete.

After this change the url passed to the aggregator handler will have the
ip address bracketed.

This was tested with kubeadm-dind in both ipv4 and ipv6 configurations.

An example sonobuoy container with this fix is located here:
quay.io/mauilion/sonobuoy:ipv6_fix

You can test this locally with:
```
wget https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.11.sh
$ chmod +x dind-cluster-v1.11.sh
$ export IP_MODE=ipv6
$ ./dind-cluster-v1.11.sh up
$ sonobuoy run -m Quick --sonobuoy-image=quay.io/mauilion/sonobuoy:ipv6_fix
```

Signed-off-by: Duffie Cooley <dcooley@heptio.com>
timothysc pushed a commit that referenced this issue Oct 16, 2018
This change adds brackets around the ip address when it is learned. This
is compatible with ipv4 and ipv6 setups.

Before this change if you ran sonobuoy in an ipv6 cluster the
aggregation mechanism would break with logs like:
```
13:10 $ sonobuoy e2e ipv4_with_ipv6_fix.tar.gz --show passed
passed tests
[k8s.io] Pods should be submitted and removed [NodeConformance] [Conformance]
```

preventing the sonbuoy pod from marking any plugin complete.

After this change the url passed to the aggregator handler will have the
ip address bracketed.

This was tested with kubeadm-dind in both ipv4 and ipv6 configurations.

An example sonobuoy container with this fix is located here:
quay.io/mauilion/sonobuoy:ipv6_fix

You can test this locally with:
```
wget https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.11.sh
$ chmod +x dind-cluster-v1.11.sh
$ export IP_MODE=ipv6
$ ./dind-cluster-v1.11.sh up
$ sonobuoy run -m Quick --sonobuoy-image=quay.io/mauilion/sonobuoy:ipv6_fix
```

Signed-off-by: Duffie Cooley <dcooley@heptio.com>
@timh timh unassigned liztio Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Behavior isn't as expected or intended p1-important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants