Kubernetes Installation

Why during the installation swap is turned off? 
What is flannel networking? Why it is required to be specified during the instalaltion? Please provide more details regarding this in the video.

Thank you
  • post-author-pic
    Will B
    11-14-2018

    Swap is off because turning it off is ultimately good for performance. Kubernetes isn't designed around the philosophy of using swap, instead it uses memory limits, and if there is not enough memory on a node then it will schedule new pods on a different node. As a result, the Kubernetes team hasn't built in support for using swap since they don't think you should be using it. In the end, kubelet won't work if swap is on.


    Flannel networking is a networking plugin for Kubernetes. Essentially, Kubernetes does not come with a networking solution built-in. It only provides a networking standard that involves creating a virtual network that spans across all nodes for all the pods and services in the cluster. There are multiple ways of implementing this, and multiple network plugins available to implement that virtual network. Flannel is one of those plugins. Basically, what flannel and other networking plugins do is allow pods to connect to other pods and services across the whole cluster, even if they are on different nodes.

    Thank you for your feedback, and we'll definitely take this into account as we create new content in the future!

  • post-author-pic
    vinayks
    11-15-2018

    Hi Will,


    Thank you for giving this detailed explaination and clearing the doubt. 
    About the swap space still I have a question. In Linux, if the physical memeory runs out of space then the swap comes into the picture, this is basically OOM (out of memory) situation . If the swap partition itself is turned off   will it not cause any system/server performance issues in case if there is any OOM situation? I am not saying swap partition itself can resolve this problem but to some extent it will resolve this perfomance problem correct? Anyhow one should definitely think of increasing the physical memory if there is a frequent OOM issue. All I want say is swap partition should be there. 

    Also if the swap partition itself is turned off then what will happen to Swap In and Swap Out concept of Linux? 

    This might be a silly question but awaiting for your reply :) :) :)   

    Thank you so much again

  • post-author-pic
    Will B
    11-15-2018

    With swap off, it will definitely be bad if you run out of memory. However, Kubernetes is able to prevent that from happening. It limits the available memory to pods, and won't schedule pods that need more memory than is available on the system. Technically, they could modify Kubernetes to support swapping, but the Kube team decided it wasn't worth it due to higher priorities, and because they want to instead stick to the philosophy of not using swap. Basically, they didn't want to spend a bunch of time supporting something they thought most people shouldn't be doing anyway. Basically, they see it like this: Kubernetes is a tool that gives you the ability to manage your resources effectively enough that you don't need swap, so they don't support it.


    As for swap in and swap out, it just won't happen with swap turned off.

Looking For Team Training?

Learn More