canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.
https://microk8s.io
Apache License 2.0
8.5k stars 772 forks source link

enable IPv6 cidr in microk8s #1343

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi Recently we have started testing our apps in IPv6 env . We require our microk8s dev stations to support Dual Stack or IPv6 . I couldn't find any documentation or reference online . Need some guidance whether adding IPv6 support to existing microk8s or scratch installing it .

Thanks, Leon

ktsakalozos commented 4 years ago

Hi Leon. We haven't looked into IPv6 on MicroK8s yet. If you give me a set of steps/questions you need help with to enable IPv6 I might be able to guide you through. @johnsca knows more on what IPv6 needs.

ghost commented 4 years ago

Basically , how to add create the microk8s with IPv6 CIDR . if possible .

jeanlucmongrain commented 4 years ago

how to add create the microk8s with IPv6 CIDR

I'm looking to run microk8s with IPv6. And if possible with no IPv4

BenjaminEHowe commented 3 years ago

I'm looking to run microk8s with IPv6. And if possible with no IPv4

This is also my use-case; I'm not aware of a technical reason for needing to use IPv4 (for my use case!) and solely using IPv6 has certain advantages (public addresses everywhere with access controlled by firewalls, no risk of RFC1918 clashes, etc.).

I'm surprised that IPv6 isn't something that's been looked into - the first IPv6 RFC was published 25 years ago this month so it's not exactly a new technology!

vifino commented 3 years ago

I concur with the other people. It's 2021, 90s tech should be implemented by now.

Kubernetes supports it, as does Calico. Now just microk8s needs to set the options. https://docs.projectcalico.org/networking/ipv6

mmulqueen commented 3 years ago

I don't know whether this is useful to anyone, I didn't take this further because I ran into other problems:

You can enable dual stack editing the arguments in /var/snap/microk8s/current/args/ e.g. /var/snap/microk8s/current/args/kube-proxy:

--feature-gates="IPv6DualStack=true"
--service-cluster-ip-range=10.152.183.0/24,fd41:7f05:4867:9983::/108

Required arguments: https://kubernetes.io/docs/concepts/services-networking/dual-stack/


You can edit the settings for Calico in the kube-system namespace, there's daemonset/calico-node and configmaps/calico-config.

Details: https://docs.projectcalico.org/networking/ipv6#enable-dual-stack

I was able to get MicroK8S to start up and IPs were allocated when configuring a service with this included in the spec.

spec:
  ipFamilies:
  - IPv4
  - IPv6
  ipFamilyPolicy: RequireDualStack

I was unable to reach the service via IPv6 though. I didn't get to the bottom of this, but it could be the host's peculiar IPv6 settings (no default route for IPv6 and Calico says it requires a default route). Despite IPv6 not working, IPv4 continued to work fine.

mmulqueen commented 3 years ago

Not strictly related to this bug, but may be a suitable workaround for anyone that needs dual stack for external clients but not inside the cluster itself.

On daemonset/nginx-ingress-microk8s-controller in the ingress namespace, you can set .spec.template.spec.hostNetwork to true.

I'm unsure whether there are any other considerations, but may be worth exploring further.

Idea from https://github.com/leblancd/kube-v6/tree/master/dual-stack-ingress

reingart commented 3 years ago

Hi, I could configure microk8s with IPv6 dual stack and it works great!

Here are the detailed instructions: https://discuss.kubernetes.io/t/microk8s-ipv6-dualstack-how-to/14507

The steps are similar to @mmulqueen comments and other docs, with the following additions:

Working on Ubuntu desktop 16.04, 18.04 and Ubuntu server 20.04 (AWS EC2)

Could you confirm these are the correct steps?

BTW, it would be great if calicoctl could be added to the snap (it could event be used as a kubectl plugin) I could help to enhance the docs and/or provide more testing about this topic. If this has a chance to get included in microk8s, let me know and I can work in a PR.

Thanks for microk8s!

ktsakalozos commented 3 years ago

Very nice work @reingart, thank you!

@evilnick @chris-sanders should we promote this?

krichter722 commented 3 years ago

@reingart I think your contributions on a microk8s feature/addon to enable IPv6 would be very welcome.

mnj commented 2 years ago

Any news on this? Missing IPv6 support makes this unusable for my use cases.

xyzroller commented 2 years ago

Any news on this? I've tried implementing the details linked to in https://github.com/canonical/microk8s/issues/1343#issuecomment-762630371 in my Ansible playbooks, but just crashing against a wall every time. It would be good to have microk8s just start with dual-stack activated and no need to mess around in the configuration.

ahnberg commented 2 years ago

Would be lovely to finally get IPv6 natively in microk8s without manual hacking. Can this one please be escalated in the team somewhere?

midnight-wonderer commented 1 year ago

Hey, I got this banner today when I logged into my Ubuntu server via SSH:

Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
just raised the bar for easy, resilient and secure K8s cluster deployment.

https://ubuntu.com/engage/secure-kubernetes-at-the-edge

Could you raise the bar in this area too? Can it be as easy as:

microk8s enable ipv6

Or simply enable them by default for new installs.

I try not to be annoying, but the IPv4 situations are worst now than the year this issue was created; the auction price skyrocketed.

I deployed microk8s on IPv6-only hosts; I know we can't even download microk8s from the snap store via IPv6, we can't microk8s join over IPv6, and the cluster won't setup without outgoing IPv4 connections. Basically, microk8s can't officially support IPv6 for now, but this (issue) is the area that can be done first.

I can release IPv4 addresses for some of my servers that only access IPv6-enabled API. (Not the ingress ones) And by deploying IPv6-enabled APIs myself, I hope to enable some people out there to do the same.
It will ease the situation, despite we still need Dual Stack ingress for the foreseeable future.

It's been three years, and we only get a hackish solution with no official support. Let me nag you guys a little; the issue needs more attention and prioritization.

neoaggelos commented 1 year ago

Hi all, people still subscribed to this thread will be interested to hear we are adding IPv6 support in 1.28, see #4058

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BenjaminEHowe commented 5 months ago

Hello, writing a comment to remove the "stale" tag as I don't believe this issue has been resolved by the team.