Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Kubernetes docker-for-desktop cluster network ip

I am trying to configure Kubernetes on docker-for-desktops and I want to change the default network assigned to containers.

Example: the default network is 10.1.0.0/16 but I want 172.16.0.0/16.

I changed the docker network section to Subnet address: 172.16.0.0 and netmask 255.255.0.0 but the cluster keeps assigning the network 10.1.0.0/16. Network configuration

The problem I am facing here is that I am in a VPN which has the same network IP of kubernetes default network (10.1.0.0/16) so if I try to ping a host that is under the vpn, the container from which I am doing the ping keeps saying Destination Host Unreachable.

I am running Docker Desktop (under Windows Pro) Version 2.0.0.0-win81 (29211) Channel: stable Build: 4271b9e.

Kubernetes is provided from Docker desktop Kuberbetes

From the official documentation I know that

Kubernetes is available in Docker for Windows 18.02 CE Edge and higher, and 18.06 Stable and higher , this includes a standalone Kubernetes server and client, as well as Docker CLI integration. The Kubernetes server runs locally within your Docker instance, is not configurable, and is a single-node cluster

Said so, should Kubernetes use the underlying docker's configuration (like network, volumes etc.)?

like image 890
Justin Avatar asked Dec 03 '18 08:12

Justin


Video Answer


1 Answers

On Windows, edit this file for a permanent fix:

%AppData%\Docker\cni\10-default.conflist
like image 126
user14137974 Avatar answered Oct 15 '22 05:10

user14137974