linkerd2/controller
Alejandro Pedraza 332c4efa8c
Only bind to IPv6 addresses when disableIPv6=false (#12938)
## Problem

When the IPv6 stack in Linux is disabled, the proxy will crash at startup.

## Repro

In a Linux machine, disable IPv6 networking through the `net.ipv6.conf.*` sysctl kernel tunables, and restart the system:

- In /etc/sysctl.conf add:
```
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
```

- In /etc/default/grub set:
```
GRUB_CMDLINE_LINUX="ipv6.disable=1"
```

- Don't forget to update grub before rebooting:
```
sudo update-grub
```

In a default k3d cluster, install Linkerd. You should see the following error in any proxy log:

```
thread 'main' panicked at /__w/linkerd2-proxy/linkerd2-proxy/linkerd/app/src/lib.rs:245:14:
Failed to bind inbound listener: Os { code: 97, kind: Uncategorized, message: "Address family not supported by protocol" }
```

## Cause

Even if a k8s cluster didn't support IPv6, we were counting on the nodes having an IPv6 stack, which allowed us to bind to the inbound proxy to [::] (although not to [::1] for the outbound proxy, as seen in GKE). This was the case in the major cloud providers we tested, but it turns out there are folks running nodes with IPv6 disabled and so we have to cater that case as well.

## Fix

The current change undoes some of the changes from 7cbe2f5ca6 (for the proxy config), 7cbe2f5ca6 (for the policy controller) and 66034099d9 (for linkerd-cni), binding back again to 0.0.0.0 unless `disableIPv6` is false.
2024-08-05 13:29:55 -05:00
..
api Add `accessPolicy` field to Server CRD (#12845) 2024-07-22 09:01:09 -05:00
cmd chore(controller): Remove stream concurrency limits (#12598) 2024-05-15 18:07:15 +01:00
gen Add `accessPolicy` field to Server CRD (#12845) 2024-07-22 09:01:09 -05:00
heartbeat build(deps): bump linkerd/dev from 39 to 40 (#10825) 2023-05-09 10:57:19 -07:00
identity core: use serviceAccountToken volume for pod authentication (#7117) 2021-11-03 02:03:39 +05:30
k8s Add `accessPolicy` field to Server CRD (#12845) 2024-07-22 09:01:09 -05:00
proxy-injector Only bind to IPv6 addresses when disableIPv6=false (#12938) 2024-08-05 13:29:55 -05:00
script Add `accessPolicy` field to Server CRD (#12845) 2024-07-22 09:01:09 -05:00
sp-validator Use metadata API in the proxy and tap injectors (#9650) 2022-11-16 09:21:39 -05:00
webhook Add ability to configure client-go's `QPS` and `Burst` settings (#11644) 2023-11-28 15:25:05 -05:00
Dockerfile dev: Update Go to v1.22 (#12114) 2024-02-22 09:39:33 -05:00