GithubHelp home page GithubHelp logo

kubernetes-installations's Introduction

Setting up a Kubernetes Cluster with WeaveNet Addon

This guide will walk you through the process of setting up a Kubernetes cluster using kubeadm and installing the WeaveNet network addon.

Prerequisites

Before you begin, make sure you have the following prerequisites:

  • Two or more Ubuntu servers (Master and Slaves) with a fresh installation.
  • SSH access to the servers.
  • Root or sudo privileges.

Installation Steps

On Both Master and Slave Nodes

  1. Update the package list and upgrade installed packages:

    sudo apt update
  2. Disable swap to ensure Kubernetes can manage memory efficiently:

    sudo swapoff -a
  3. Comment out any existing swap entries in the /etc/fstab file:

    sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
  4. Update the package list again:

    sudo apt-get update
  5. Install required packages:

    sudo apt-get install -y apt-transport-https ca-certificates curl
  6. Create a directory for keyrings:

    sudo mkdir -m 755 /etc/apt/keyrings
  7. Add Kubernetes repository keyring:

    curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
  8. Add Kubernetes repository to the sources list:

    echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
  9. Update the package list again:

    sudo apt-get update
  10. To check available versions of kubectl:

    apt list -a kubectl
  11. To check available versions of kubeadm:

    apt list -a kubeadm
  12. To check available versions of kubelet:

    apt list -a kubelet
  13. Install Kubernetes components (kubelet, kubeadm, containerd) and kubectl (only on Master):

    sudo apt-get install -y kubelet kubeadm containerd kubectl -y
  14. Verify the Kubernetes and kubeadm versions:

    kubectl version
    kubeadm version
  15. Load necessary kernel modules:

    modprobe overlay
    modprobe br_netfilter
  16. Configure sysctl settings for Kubernetes:

    cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
    net.bridge.bridge-nf-call-iptables = 1
    net.bridge.bridge-nf-call-ip6tables = 1
    net.ipv4.ip_forward = 1
    EOF
    sysctl --system
  17. Create a containerd configuration file:

    mkdir -p /etc/containerd
    containerd config default | sudo tee /etc/containerd/config.toml
  18. Restart the containerd service:

    systemctl restart containerd
  19. Reload systemd to recognize new units:

    systemctl daemon-reload
  20. Start and enable the kubelet service:

    systemctl start kubelet
    systemctl enable kubelet.service
  21. Check the status of the kubelet service:

    systemctl status kubelet

On the Master Node

  1. Initialize the Kubernetes cluster:

    kubeadm init
  2. To start using your cluster, run the following commands as a regular user (replace <master-node-IP> with your Master Node's IP address):

    mkdir -p $HOME/.kube
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    sudo chown $(id -u):$(id -g) $HOME/.kube/config
  3. Create a token for nodes to join the cluster (use the provided command):

    kubeadm token create --print-join-command
  4. Install the WeaveNet network addon by applying the following YAML file:

    kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml

Now your Kubernetes cluster is set up with the WeaveNet network addon.

For more information on Kubernetes network addons, refer to the official documentation.

kubernetes-installations's People

Contributors

dineshfsspersonal avatar

Watchers

 avatar

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.