Last active
July 22, 2021 04:13
-
-
Save zhangguanzhang/1c3382f965107d072d68be6e4341b275 to your computer and use it in GitHub Desktop.
Revisions
-
zhangguanzhang revised this gist
Jun 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ docker run --privileged -ti --rm --name flannel --net host -e GOARCH=amd64 \ -v $PWD/dist:/go/src/github.com/coreos/flannel/dist \ -v /run:/run \ --workdir=/go/src/github.com/coreos/flannel \ golang:1.16.5 /bin/bash go install github.com/go-delve/delve/cmd/dlv@latest CGO_ENABLED=1 GO111MODULE=off go build -o dist/flanneld \ -gcflags="all=-trimpath=$PWD -N -l" \ -
zhangguanzhang created this gist
May 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ ``` wget https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-x86_64-static.tar.gz docker run --privileged -ti --rm --name flannel --net host -e GOARCH=amd64 \ --cap-add=NET_ADMIN --cap-add=SYS_ADMIN \ -u $( id -u):$( id -g) \ -v $PWD/dist/qemu-amd64-static:/usr/bin/qemu-amd64-static \ -v $PWD:/go/src/github.com/coreos/flannel:ro \ -v $PWD/dist:/go/src/github.com/coreos/flannel/dist \ -v /run:/run \ --workdir=/go/src/github.com/coreos/flannel \ golang:1.16.3 /bin/bash go install github.com/go-delve/delve/cmd/dlv@latest CGO_ENABLED=1 GO111MODULE=off go build -o dist/flanneld \ -gcflags="all=-trimpath=$PWD -N -l" \ -asmflags "all=-trimpath=$PWD" \ -ldflags '-X github.com/coreos/flannel/version.Version=v0.11.0-go1.16.3 -extldflags "-static"' main.go mkdir -p /etc/cni/net.d/ cat <<EOF > /etc/cni/net.d/10-flannel.conflist { "name": "cbr0", "cniVersion": "0.3.1", "plugins": [ { "type": "flannel", "delegate": { "hairpinMode": true, "isDefaultGateway": true } }, { "type": "portmap", "capabilities": { "portMappings": true } } ] } EOF mkdir -p /etc/kube-flannel cat <<EOF > /etc/kube-flannel/net-conf.json { "Network": "10.187.0.0/16", "Backend": { "Type": "vxlan" } } EOF export NODE_NAME=10.13.4.78 dlv exec ./dist/flanneld -- --kube-subnet-mgr --kubeconfig-file=./dist/kubeconfig --ip-masq -v=4 ```