Saturday, 3 March 2018

Minikube hello world example

https://medium.com/@claudiopro/getting-started-with-kubernetes-via-minikube-ada8c7a29620

Hyper-V networking

In Hyper-V I had a Virtual Network Switch, 'NAT', which I could not delete.
I found that this was associated with docker.

running docker network list indicated the network:

a1b23ca940cb        Default Switch                 ics                 local
dd38da06ad19        Minikube                       transparent         local
e1f9b2de34f2        Wired Hyper-V Virtual Switch   transparent         local
b927d4e2fab9        nat                            nat                 local
20a4b1e6aec4        none                           null                local

ics is Internet Connection Sharing.

the nat switch is created by Docker For Windows and is used for Windows containers.
Conversely, if you use Linux mode then Docker for Windows creates the DockerNAT switch.

If you create a Hyper-V external switch then a bridge is also required. It connects the
Wireless Network Connection adapter to the MAC Bridge Filter, the LLDP protocol driver and the Hyper-V Extensible Virtual Switch.

This article explains why:
https://blogs.msdn.microsoft.com/virtual_pc_guy/2015/02/02/hyper-v-and-wireless-networking/


This article explains a lot about the Windows networking

Moby Linux VMs use DockerNAT switch with Docker for Windows (a product of Docker CE) instead of HNS internal vSwitch
Docker for Windows (the Windows driver for the Docker CE engine) on Windows 10 will use an Internal vSwitch named 'DockerNAT' to connect Moby Linux VMs to the container host. Developers using Moby Linux VMs on Windows should be aware that their hosts are using the DockerNAT vSwitch rather than the vSwitch that is created by the HNS service (which is the default switch used for Windows containers).

To get the docker container to have access to the network (as if it were a peer to the host)

docker network ls

NETWORK ID          NAME                              DRIVER              SCOPE
acd360485ea3        Wired Hyper-V Virtual Switch      transparent         local
cf9c25350a73        Wireless Hyper-V Virtual Switch   transparent         local
bf621e7722a1        nat                               nat                 local
1655e1f6e86f        none                              null                local

then
docker run --network "Wired Hyper-V Virtual Switch" -ti microsoft/nanoserver ping 8.8.8.8


To set up a good development machine you would expect:

Wireless
Network Bridge - using the Wireless Network Connection adapter and connecting the Hyper-V Extensible Virtual Switch, Microsoft LLDP Protocol Driver and Microsoft MAC Bridge.

Wired


Do not configure the Local Area Network Connection for TCP/IP settings. This should be done at the Hyper-V virtual switch level.


Testing
Test your main wireless and wired host networking.
Test a normal Hyper-V VM's access to the internet, via wireless and wired independently.
Test a Docker containers access to the internet.
Test MiniKubes ability to start up and get an IP address.

Friday, 2 March 2018

Minikube working with Docker for Windows on Windows 10 - avoid the network problems

Turn off IPV6 for the physical network connection (it is believed there is a race condition which if both IPv4 and V6 are on then V6 sometimes wins the race to DHCP. If your network doesn't support IPV6 then you don't get an IP address).


Add the Hyper-V virtual switch called Minikube. Make it an internal network.

Go to the physical network and allow it to be shared with the virtual network.

RegEx for beginning of line and end of line

Regex start of line
^
Regex end of line
(.)$

Thursday, 1 March 2018

Git configuration

 git config credential.helper store
git config --global difftool.prompt false
git config --global diff.tool bc3