Skip to content

Commit

Permalink
Merge pull request #38 from benmoss/network-fixes
Browse files Browse the repository at this point in the history
Create first HNS network before Flannel
  • Loading branch information
k8s-ci-robot committed Mar 6, 2020
2 parents ba0b406 + c427b6b commit 0c91a7a
Show file tree
Hide file tree
Showing 5 changed files with 565 additions and 4 deletions.
8 changes: 8 additions & 0 deletions kubeadm/flannel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ARG servercoreTag="ltsc2019"
ARG cniVersion="0.8.5"
ARG golangTag=windowsservercore-1809

FROM golang:${golangTag} as builder
ADD setup.go build/
RUN go build -o build/setup.exe build/setup.go

FROM mcr.microsoft.com/windows/servercore:${servercoreTag}
SHELL ["powershell", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
Expand All @@ -11,6 +16,9 @@ RUN mkdir -force C:\k\flannel; \
pushd C:\k\flannel; \
curl.exe -LO https://github.com/benmoss/flannel/releases/download/v0.12.0-rc1/flanneld.exe

ADD hns.psm1 /k/flannel
COPY --from=builder /gopath/build/setup.exe /k/flannel/setup.exe

RUN mkdir C:\cni; \
pushd C:\cni; \
curl.exe -Lo cni.tgz https://github.com/containernetworking/plugins/releases/download/v${env:cniVersion}/cni-plugins-windows-amd64-v${env:cniVersion}.tgz; \
Expand Down
6 changes: 4 additions & 2 deletions kubeadm/flannel/flannel-host-gw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ data:
cp -force /etc/kube-flannel/net-conf.json /host/etc/kube-flannel
cp -force -recurse /cni/* /host/opt/cni/bin
cp -force /k/flannel/flanneld.exe /host/k/flannel/flanneld.exe
cp -force /k/flannel/* /host/k/flannel/
cp -force /kube-proxy/kubeconfig.conf /host/k/flannel/kubeconfig.yml
cp -force /var/run/secrets/kubernetes.io/serviceaccount/* /host/k/flannel/var/run/secrets/kubernetes.io/serviceaccount/
wins cli process run --path /k/flannel/setup.exe --args "--mode=l2bridge --interface=Ethernet"
wins cli route add --addresses 169.254.169.254
wins cli process run --path /k/flannel/flanneld.exe --args "--kube-subnet-mgr --kubeconfig-file /k/flannel/kubeconfig.yml" --envs "POD_NAME=$env:POD_NAME POD_NAMESPACE=$env:POD_NAMESPACE"
cni-conf.json: |
{
Expand Down Expand Up @@ -111,7 +113,7 @@ spec:
effect: NoSchedule
containers:
- name: kube-flannel
image: sigwindowstools/flannel:0.12.0-rc1
image: sigwindowstools/flannel:0.12.0-rc2
command:
- powershell
args:
Expand Down
6 changes: 4 additions & 2 deletions kubeadm/flannel/flannel-overlay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ data:
cp -force /etc/kube-flannel/net-conf.json /host/etc/kube-flannel
cp -force -recurse /cni/* /host/opt/cni/bin
cp -force /k/flannel/flanneld.exe /host/k/flannel/flanneld.exe
cp -force /k/flannel/* /host/k/flannel/
cp -force /kube-proxy/kubeconfig.conf /host/k/flannel/kubeconfig.yml
cp -force /var/run/secrets/kubernetes.io/serviceaccount/* /host/k/flannel/var/run/secrets/kubernetes.io/serviceaccount/
wins cli process run --path /k/flannel/setup.exe --args "--mode=overlay --interface=Ethernet"
wins cli route add --addresses 169.254.169.254
wins cli process run --path /k/flannel/flanneld.exe --args "--kube-subnet-mgr --kubeconfig-file /k/flannel/kubeconfig.yml" --envs "POD_NAME=$env:POD_NAME POD_NAMESPACE=$env:POD_NAMESPACE"
cni-conf.json: |
{
Expand Down Expand Up @@ -100,7 +102,7 @@ spec:
effect: NoSchedule
containers:
- name: kube-flannel
image: sigwindowstools/flannel:0.12.0-rc1
image: sigwindowstools/flannel:0.12.0-rc2
command:
- powershell
args:
Expand Down
Loading

0 comments on commit 0c91a7a

Please sign in to comment.