Category: Software, Kubernetes, Ubuntu, Docker, firewall, ansible

Kubespray is a collection of Ansible playbooks, inventory, provisioning tools, and domain knowledge f or generic OS/Kubernetes cluster configuration management tasks.PrerequisitesHardware5 Nodes: Virtual or Physical MachinesMemory: 8GBCPU: 4CoreHard disk: 120GB availableSoftwareKubernetes nodesUbuntu 20.04PythonSSH ServerPrivileged userKubespray machineAnsible 2.9+Jinja 2.9+Node Networking requirementsInternet access to download docker images and install softwareIPv4 Forwarding should be enabledDisable firewall to avoid any issues during deployment.Preparing the nodes**Follow these instructions on all nodes**Install PythonAnsible needs python to be installed on all the machines. Ubuntu 18.04 already has Python3. So you need to create symbolic link.ubuntu@k8s-master-1:~$ sudo ln -s /usr/bin/python3 /usr/bin/pythonDisable Swapubuntu@k8s-master-1:~$ sudo swapoff -aubuntu@k8s-master-1:~$ sudo sed -i ā€˜/ swap /dā€™ /etc/fstab**Follow these instructions on just the Ansible controller machine**Setup SSH using key-based authenticationGenerate an RSA key pair by executing this command on the Ansible controller machine.ubuntu@ansibledev:~$ ssh-keygen -t rsaCopy the public key to all nodes. Replace the IPs with your actual cluster IPs)ubuntu@ansibledev:~$ ssh-copy-id ubuntu@192.168.2.11ubuntu@ansibledev:~$ ssh-copy-id ubuntu@192.168.2.12ubuntu@ansibledev:~$ ssh-copy-id ubuntu@192.168.2.13ubuntu@ansibledev:~$ ssh-copy-id ubuntu@192.168.2.14 Written by

Related Articles