You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use MacOS as your daily driver and need a functional IPv6 enabled Kubernetes cluster for local development/testing this article is meant for you! I have been using [orbstack](https://orbstack.dev) for a few years now as a drop in replacement for Docker desktop and I have to say it's beyond impressive in terms of performance and features. My main motivation to move away from Docker desktop was the lack of support IPv6 on a MacOS and the horrendous performance. The next thing I tried was Colima which is quite flexible but still [lacks IPv6 support on MacOS](https://news.ycombinator.com/item?id=41422931).
9
+
10
+
While there are multiple kubernetes distributions such as [minikube](https://github.com/kubernetes/minikube/issues/8535), [k3d](https://github.com/k3d-io/k3d/issues/833) which work quite well on a MacOS, neither of those support IPv6 😭 Eventually I ended up trying [KIND](https://kind.sigs.k8s.io) and turns out, it works perfectly fine with IPv6 and is fully customizable 🎉
11
+
12
+
If you look under the hood, Kubernetes is an API server which relies on composable set of components to build a distributed system. Kubernetes by itself does not handle networking just as it does not handle managing container lifecycle, it relies on a container runtime such as containerd. Similarly, k8s relies on a container network interface [CNI] (https://cni.dev) which is the component that manages cluster networking and routing network traffic in and out of the cluster. I will write more about CNI's in a separate blog post ;) But to make a Kubernetes cluster IPv6 capable, we need to install a CNI which supports IPv6. Cilium is my CNI of choice as it support IPv6, has a large community around it and is a CNCF graduate project which speaks for it's maturity.
13
+
14
+
**To get a functional IPv6 capable kubernetes cluster on a MacOS we need the following**
2
15
3
-
I have been using [orbstack](https://orbstack.dev) for over two years now as a drop in replacement for Docker desktop and I have to say it's beyond impressive in terms of performance and feature set. My main motivation to move away from Docker desktop was because it does not support IPv6 on a MacOS. The next thing I tried was Colima but that doesn't support IPv6 either.
16
+
-[orbstack](https://orbstack.dev)
17
+
-[KIND](https://kind.sigs.k8s.io)
18
+
-[Cilium] (https://cilium.io)
4
19
5
20
### Orbstack supports IPv6 containers on MacOS
21
+
22
+
After installing [orbstack](https://orbstack.dev) make sure your docker context is pointing to Orbstack. You may have to explicitly switch the docker context to orbstack if you have Docker desktop installed. In my case, I uninstalled Docker desktop.
23
+
6
24
```bash
7
25
~
8
26
❯ docker context ls
9
27
NAME DESCRIPTION DOCKER ENDPOINT ERROR
10
28
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
Enable IPv6 in Docker daemon with the following config.
34
+
```sh
15
35
❯ cat .orbstack/config/docker.json
16
36
{
17
37
"ip6tables": false,
18
38
"ipv6":true
19
39
}
20
40
```
21
41
42
+
Create a file named `kind-config.yaml` to pre-configure KIND with the following config options. Notice that I am disabling the default CNI (flannel) so I can install Cilium 😋
43
+
22
44
#### kind-config.yaml
23
45
```YAML
24
46
---
@@ -32,23 +54,108 @@ networking:
32
54
ipFamily: dual
33
55
disableDefaultCNI: true
34
56
# IPv6 prefix must be specified first
35
-
serviceSubnet: fd00:10:96::/112,10.96.0.0/12
57
+
serviceSubnet: fd00:10:96::/112,10.96.0.0/16
36
58
nodes:
37
59
- role: control-plane
38
60
- role: worker
39
61
- role: worker
40
62
```
41
63
42
-
#### IPv6 enabled #KIND cluster
64
+
### Create KIND cluster
65
+
66
+
The following snippet assumes that you already have the following already installed on your Mac. If not, you can install them using homebrew.
External IP shows as none but that is expected since we created a service of type `NodePort` which is exposed over port `30368`. To access a NodePort service we can send a http GET request to any of the cluster nodes over this port.
<p>If you see this page, the nginx web server is successfully installed and
146
+
working. Further configuration is required.</p>
147
+
148
+
<p>For online documentation and support please refer to
149
+
<a href="http://nginx.org/">nginx.org</a>.<br/>
150
+
Commercial support is available at
151
+
<a href="http://nginx.com/">nginx.com</a>.</p>
152
+
153
+
<p><em>Thank you for using nginx.</em></p>
154
+
</body>
155
+
</html>
156
+
```
157
+
158
+
Voila!🍾 our application is running on Kubernetes and is accessible over IPv6!
159
+
160
+
### Conclusion
161
+
Running an IPv6 capable Kubernetes cluster is absolutely possible on a MacOS and developers can leverage this setup to develop and test their applications in a IPv6 native environment.
0 commit comments