IPv4/IPv6 dual-stack networking

Enabling dual-stack networking in k0s allows your cluster to handle both IPv4 and IPv6 addresses. Follow the configuration examples below to set up dual-stack mode.

Enabling dual-stack using the default CNI (kube-router)

In order to enable dual-stack networking using the default CNI provider, use the following example configuration:

  1. spec:
  2. network:
  3. # kube-router is the default CNI provider
  4. # provider: kube-router
  5. podCIDR: 10.244.0.0/16
  6. serviceCIDR: 10.96.0.0/12
  7. dualStack:
  8. enabled: true
  9. IPv6podCIDR: fd00::/108
  10. IPv6serviceCIDR: fd01::/108

This configuration will set up all Kubernetes components and kube-router accordingly for dual-stack networking.

Using Calico as the CNI provider

Calico does not support IPv6 tunneling in the default vxlan mode, so if you prefer to use Calico as your CNI provider, make sure to select bird mode. Use the following example configuration:

  1. spec:
  2. network:
  3. provider: calico
  4. calico:
  5. mode: bird
  6. podCIDR: 10.244.0.0/16
  7. serviceCIDR: 10.96.0.0/12
  8. dualStack:
  9. enabled: true
  10. IPv6podCIDR: fd00::/108
  11. IPv6serviceCIDR: fd01::/108

Custom CNI providers

While the dual-stack configuration section configures all components managed by k0s for dual-stack operation, the custom CNI provider must also be configured accordingly. Refer to the documentation for your specific CNI provider to ensure a proper dual-stack setup that matches that of k0s.

Additional Resources

For more detailed information and troubleshooting, refer to the following resources: