Giter VIP home page Giter VIP logo

k8s-net-labs's Introduction

k8s-net-labs

Kubernetes networking labs for KubeCon EU 2020 talk

After cloning this repo, to follow along you either need to install:

Or have a working Vagrant + VirtualBox setup -- the Vagrantfile in this repo has the appropriate Docker+Footloose setup already in it.

Running Docker+Footloose natively is prefered for resource consumption reasons.


Once you are either SSH'd in to the Vagrant box (vagrant up && vagrant ssh) or have Docker+Footloose set up, you will probably need to become root to fully support Footloose (sudo -s, su -, or however you prefer). You need to be in the folder for this repo (mounted to /labs/ if you are in the Vagrant box).

Then to start the different environments, you can cd to the directory you want (flannel/ for k3s with Flannel or calico/ for k3s with Calico), then run ./bootstrap.sh (for the Flannel one) or ./bootstrap-calico.sh (for the Calico one) to start the k3s install.

Once the cluster is up, you can SSH in with either footloose ssh root@node0 (or node1, or node2) for the Flannel install or footloose -c footloose-calico.yaml ssh root@calico-node0 (or calico-node1, or calico-node2) for the Calico install.

For the Calico install, you bring up Calico with kubectl apply -f calico-k3s.yaml when on calico-node0.

k8s-net-labs's People

Contributors

korvus81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-net-labs's Issues

[bug] master node is not getting ready

OS: macOS Big Sur 11.6
Docker: 4.1.0 4 vCPU, 6 GB memory

I followed the instruction(docker + footloose) but the master node is not getting ready.

root@node0 ~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node0 NotReady master 8m20s v1.17.3+k3s1
node1 Ready 8m9s v1.17.3+k3s1
node2 Ready 8m9s v1.17.3+k3s1

Not working on Mac (Intel based)

Thank you for the great video and explanation.
I was trying to run the setup on Mac. I have installed Docker Desktop and FootLoose.

When trying with flannel/bootstrap.sh, I got the below error, Could you please suggest on getting through this error?

Anils-MacBook-Pro:flannel root# sh bootstrap.sh
Error response from daemon: network with name footloose-cluster already exists
0.6.3: Pulling from korvus/debian10
Digest: sha256:68f32cedc86d08860857df96a0d1ea2fa238fde9a957160353238afa999cb95d
Status: Image is up to date for korvus/debian10:0.6.3
docker.io/korvus/debian10:0.6.3
INFO[0000] Image: korvus/debian10:0.6.3 present locally
INFO[0000] Creating machine: footloose-k8s-node0 ...
INFO[0000] Connecting footloose-k8s-node0 to the footloose-cluster network...
ERRO[0002] Error response from daemon: Container f92b37e6bd62e6e402dc8d4be8dc0255f473d619cb2c3f81e4421602d8067b4d is not running machine=footloose-k8s-node0
FATA[0002] exit status 1
FATA[0000] hostport: failed to inspect container: exit status 1
FATA[0000] hostport: failed to inspect container: exit status 1
FATA[0000] hostport: failed to inspect container: exit status 1
FATA[0000] hostport: failed to inspect container: exit status 1

=============
Container Log:

Failed to lookup module alias 'autofs4': Function not implemented
systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.

Welcome to Debian GNU/Linux 10 (buster)!

Set hostname to .

Failed to bump fs.file-max, ignoring: Invalid argument

Failed to create /init.scope control group: Read-only file system

Failed to allocate manager object: Read-only file system

[!!!!!!] Failed to allocate manager object.

Exiting PID 1...

k3s not coming up in vagrant setup

I followed your vagrant setup instructions and when I do:

footloose ssh root@note0

and do:

journalctl -u k3s -f

I see that k3s is in a crash/restart cycle:

[SNIP]
Oct 13 01:12:45 node0 k3s[4517]: time="2021-10-13T01:12:45.751326372Z" level=info msg="Running kube-proxy --cluster-cidr=10.42.0.0/16 --healthz-bind-address=127.0.0.1 --hostname-override=node0 --kubeconfig=/var/lib/rancher/k3s/agent/kubeproxy.kubeconfig --proxy-mode=iptables"
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.751482    4517 server.go:213] WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.753323    4517 proxier.go:598] Failed to read file /lib/modules/4.19.0-17-amd64/modules.builtin with error open /lib/modules/4.19.0-17-amd64/modules.builtin: no such file or directory. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.758146    4517 proxier.go:608] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: time="2021-10-13T01:12:45.758782694Z" level=info msg="waiting for node node0 CIDR not assigned yet"
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.758905    4517 proxier.go:608] Failed to load kernel module ip_vs_rr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.759677    4517 proxier.go:608] Failed to load kernel module ip_vs_wrr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.759959    4517 proxier.go:608] Failed to load kernel module ip_vs_sh with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: W1013 01:12:45.760226    4517 proxier.go:608] Failed to load kernel module nf_conntrack with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
Oct 13 01:12:45 node0 k3s[4517]: I1013 01:12:45.764340    4517 server.go:412] Version: v1.17.3+k3s1
Oct 13 01:12:45 node0 k3s[4517]: I1013 01:12:45.768666    4517 node.go:135] Successfully retrieved node IP: 172.19.0.2
Oct 13 01:12:45 node0 k3s[4517]: I1013 01:12:45.769059    4517 server_others.go:146] Using iptables Proxier.
Oct 13 01:12:45 node0 k3s[4517]: I1013 01:12:45.769526    4517 server.go:571] Version: v1.17.3+k3s1
Oct 13 01:12:45 node0 k3s[4517]: I1013 01:12:45.769938    4517 conntrack.go:103] Set sysctl 'net/netfilter/nf_conntrack_max' to 131072
Oct 13 01:12:45 node0 k3s[4517]: F1013 01:12:45.770136    4517 server.go:485] open /proc/sys/net/netfilter/nf_conntrack_max: permission denied
Oct 13 01:12:45 node0 systemd[1]: k3s.service: Main process exited, code=exited, status=1/FAILURE
Oct 13 01:12:45 node0 systemd[1]: k3s.service: Failed with result 'exit-code'.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.