linkerd2/pkg
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
..
addr Fix `linkerd dg endpoints` to work with IPv6 (#12541) 2024-05-02 14:39:43 -05:00
admin Readiness checks fail until caches are synced (#10166) 2023-01-25 11:43:09 -08:00
charts Only bind to IPv6 addresses when disableIPv6=false (#12938) 2024-08-05 13:29:55 -05:00
cmd Add json output to install and related commands (#12641) 2024-06-04 12:43:23 -07:00
config Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
filesonly Enable lint check for comments (#2023) 2019-01-02 14:03:59 -08:00
flags Improve klog (client-go logs) handling (#11632) 2023-11-28 09:25:13 -05:00
healthcheck feat(helm): default proxy-init resource requests to proxy values (#12741) 2024-06-24 12:37:47 +01:00
identity identity: tweak token validation log levels (#12187) 2024-03-05 09:30:16 +02:00
inject New "audit" value for default inbound policy (#12844) 2024-07-17 15:54:27 -05:00
issuercerts Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
k8s Add `accessPolicy` field to Server CRD (#12845) 2024-07-22 09:01:09 -05:00
multicluster Add remote-discovery service mirroring (#11201) 2023-08-08 12:51:14 -07:00
profiles Add json output to install and related commands (#12641) 2024-06-04 12:43:23 -07:00
prometheus chore(controller): Remove stream concurrency limits (#12598) 2024-05-15 18:07:15 +01:00
protohttp Replace usage of io/ioutil package (#9613) 2022-10-13 12:10:58 -05:00
servicemirror Add support for service-mirror selectors (#4795) 2020-07-30 10:07:14 -07:00
tls Removed dupe imports (#10049) 2023-01-10 14:34:56 -05:00
trace Trace Control plane Components with OC (#3495) 2019-10-18 12:19:13 -07:00
tree Remove namespace from charts and split them into `linkerd-crd` and `linkerd-control-plane` (#6635) 2021-12-10 15:53:08 -05:00
util Change injector overriding logic to be more generic (#12405) 2024-04-10 15:51:58 +01:00
version Bump proxy-init to v2.4.1 and cni-plugin to v1.5.1 (#12711) 2024-06-13 17:15:41 -05:00