[Tutorial] Installing Kubernetes Manually



[Tutorial] Installing Kubernetes Manually

1. Letting iptables see bridged traffic

cat 
sudo sysctl --system

2. Allow Required Firewall Ports

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9000 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9090 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9100 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9443 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9796 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8080 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8001 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 2376 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 2379:2380 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 6443 -j ACCEPT  
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 6783:6784 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 9099:9100 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 179 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 30000:32767 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 10250:10258 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 53 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 53 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 5000 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 5080 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 5432 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 111 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8443 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8472 -j ACCEPT 
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 45014 -j ACCEPT 
sudo netfilter-persistent save

or

sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 9090 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 9100 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 9443 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 9796 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 8080 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 8001 -j ACCEPT
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 2376 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 2379:2380 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 6443 -j ACCEPT  
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 6783:6784 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 9099:9100 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 179 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 30000:32767 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 10250:10258 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 53 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p udp --dport 53 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 5000 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 5080 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 5432 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 8443 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 8472 -j ACCEPT 
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 45014 -j ACCEPT 
sudo netfilter-persistent save

3. Installing runtime or Docker Engine

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

sudo apt-get update

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

Add Docker’s official GPG key:

 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Use the following command to set up the stable repository.

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

4. Configure systemd driver

create or edit /etc/docker/daemon.json

{
  "exec-opts": ["native.cgroupdriver=systemd"]
}

restart docker service

sudo systemctl restart docker

5. Installing kubeadm, kubelet and kubectl

Update the apt package index and install packages needed to use the Kubernetes apt repository:

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl

Download the Google Cloud public signing key:

sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

Add the Kubernetes apt repository:

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

Update apt package index, install kubelet, kubeadm and kubectl, and pin their version:

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
CERTKEY=$(kubeadm certs certificate-key)
echo $CERTKEY

Run this ONLY on Control Plane

sudo kubeadm init --apiserver-cert-extra-sans=your.FQDN.COM,your.external.IP --pod-network-cidr=10.32.0.0/12 --control-plane-endpoint=your.FQDN.COM --upload-certs --certificate-key=$CERTKEY

or

kubeadm init

You can now join any number of the control-plane node running the following command on each as root:

kubeadm join your.FQDN.COM:6443 --token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
--discovery-token-ca-cert-hash sha256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
--control-plane --certificate-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The above command will be generated after control plane has successfully initiallized.

To add Worker Nodes

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join your.FQDN.COM:6443 --token XXXXXXXXXXXXXXXXXXXXXXX \
--discovery-token-ca-cert-hash sha256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Use below to reset any Master / Control Plane, or worker nodes

## remove cluster
sudo kubeadm reset
sudo rm -rf /etc/kubernetes
sudo rm -rf /etc/cni/net.d
sudo rm -rf /var/lib/kubelet
sudo rm -rf /var/lib/etcd
sudo rm -rf $HOME/.kube

Relevant FAQs:

What is Kubernetes is used for?

Kubernetes, often abbreviated as “K8s”, orchestrates containerized applications to run on a cluster of hosts. The K8s system automates the deployment and management of cloud native applications using on-premises infrastructure or public cloud platforms. [2]

What is Kubernetes and Docker?

In a nutshell, Docker is a suite of software development tools for creating, sharing and running individual containers; Kubernetes is a system for operating containerized applications at scale. Think of containers as standardized packaging for microservices with all the needed application code and dependencies inside. [3]

What's the difference between Docker and Kubernetes?

The difference between the two is that Docker is about packaging containerized applications on a single node and Kubernetes is meant to run them across a cluster. Since these packages accomplish different things, they are often used in tandem. Of course, Docker and Kubernetes can be used independently. [4]

Is Kubernetes free?

Pure open source Kubernetes is free and can be downloaded from its repository on GitHub. Administrators must build and deploy the Kubernetes release to a local system or cluster -- or to a system or cluster in a public cloud, such as AWS, Google Cloud or Microsoft Azure. [5]

Why is Kubernetes called K8s?

By the way, if you're wondering where the name “Kubernetes” came from, it is a Greek word, meaning helmsman or pilot. The abbreviation K8s is derived by replacing the eight letters of “ubernete” with the digit 8. [6]

References:

[1] https://faun.pub/free-ha-multi-architecture-kubernetes-cluster-from-oracle-c66b8ce7cc37

[2] https://www.vmware.com/topics/glossary/content/kubernetes.html

[3] https://www.dynatrace.com/news/blog/kubernetes-vs-docker/

[4] https://containerjournal.com/editorial-calendar/best-of-2021/whats-the-difference-between-docker-and-kubernetes/

[5] https://www.techtarget.com/searchitoperations/answer/Is-Kubernetes-free-as-an-open-source-software

[6] https://www.bmc.com/blogs/what-is-kubernetes/

[7] https://engineer.org.pk/2024/06/05/waste-management-ai/

Posted in Technical Solutions on May 01, 2022



[SOLVED / FIXED ] ModuleNotFoundError: No module named 'setuptools_rust'

Posted in Technical Solutions on Apr 09, 2022

[SOLVED / FIXED ] ModuleNotFoundError: No module named 'setuptools_rust' Error: While installing docker-compose the following error can come up: ModuleNotFoundError: No module named 'setuptools_rust'



[SOLVED / FIXED ] Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause. Error in Maria DB

Posted in Technical Solutions on Feb 01, 2021

[SOLVED] Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause. Error in Maria DB



[SOLVED / FIXED] Django error 400 bad request

Posted in Technical Solutions on Jul 04, 2021

[SOLEVED] Django error 400 bad request



Domain Name: Your Gateway to Online Success

Posted in Uncategorized on Jul 03, 2024

A domain name is more than just an address on the internet; it's a crucial part of your online identity. This comprehensive guide covers everything you need to know about domain names, from choosing the right one to understanding its impact on your branding and SEO. Learn about different types of domains, how to register and protect them, and the future trends in the domain landscape. Discover the secrets to selecting a memorable and relevant domain name that will set you up for online success.



[Tips] Change Python Django Superuser password

Posted in Technical Solutions on May 06, 2022

[Tips] Change Python Django Superuser password



IBM Develops AI Agents to Automate Software Engineering Tasks

Posted in News on Nov 08, 2024

Get ready to revolutionize software development with AI! IBM's latest innovation uses AI agents to automate tasks, improve code quality, and streamline development. Discover how AI-driven software development can transform industries and change the game



Apple's New AirPods are Also Hearing Aids

Posted in News on Sep 10, 2024

Apple's latest AirPods Pro 2 aren’t just wireless headphones—they now double as clinical-grade hearing aids. This innovation could revolutionize how people with mild to moderate hearing loss access care. With a built-in hearing test and machine learning technology, these AirPods can adjust sound frequencies in real-time, making conversations clearer and enhancing the overall listening experience. At $249, they’re also a much more affordable option compared to traditional hearing aids, making hearing assistance accessible to a broader audience. However, they do have limitations, including shorter battery life and unsuitability for severe hearing loss.



How to Protect Your Website from Malware and Viruses

Posted in News on Oct 07, 2024

In today's digital world, protecting your website from malware and viruses is crucial to maintaining its performance, security, and user trust. This guide covers essential strategies such as using strong passwords, enabling two-factor authentication, installing web application firewalls (WAF), and securing your site with SSL certificates. Regular updates, backups, and security audits are also key to preventing cyberattacks. Whether you're running a small blog or a large e-commerce site, these best practices will help you safeguard your website and keep it secure from malicious threats.



25 AI Tips to Boost Your Programming Productivity with ChatGPT

Posted in News on Nov 19, 2024

In today’s fast-paced programming environment, efficiency is key. With tools like ChatGPT, coding can become faster, smoother, and more effective. Think of AI as a trusty power tool in your development toolkit—it doesn’t build the project for you, but it makes the process much easier. Below, I’ll share 25 actionable tips to leverage ChatGPT and significantly enhance your programming productivity.



Gmail Users at Risk from AI-Powered Cyberattacks

Posted in News on Oct 14, 2024

In a rapidly evolving digital landscape, Gmail users are facing a new and alarming threat: AI-powered cyberattacks. These sophisticated scams leverage advanced technology to create realistic impersonations of Google support calls, tricking unsuspecting individuals into revealing personal information. This blog delves into the details of these AI-driven scams, sharing real-life accounts of victims and expert insights on how these tactics work. Through engaging narratives and practical advice, the blog aims to raise awareness about the importance of cybersecurity in the age of AI. Readers will learn how to identify suspicious communications, the significance of enabling robust security features, and essential steps to protect their accounts from phishing attempts. As cybercriminals continue to refine their techniques, staying informed and vigilant is more crucial than ever.



Ubuntu 18.04.6 LTS (Bionic Beaver) / Ubuntu 20.04.3 LTS (Focal Fossa) - Common Commands

Posted in Technical Solutions on Nov 04, 2021

Ubuntu 18.04.6 LTS (Bionic Beaver) / Ubuntu 20.04.3 LTS (Focal Fossa) - Common Commands & Frequent Tasks Disabling the firewall - iptables if you need to disable the firewall temporarily, you can flush all the rules using



Best Prices Now

Posted in Hosting Promotions on Sep 08, 2022

At HostingbyAliTech, you get low cost web hosting services with the power of Cloud. CyberPanel and LiteSpeed provide customers the best experience and optimized site performances. Along with best prices, you get most optimized performance. AliTech is serving since 2020 and it is a first choice of the clients who are after quality and speedy web hosting..



[SOLVED / FIXED ] Kubernetes / Docker could not create directory. wordpress

Posted in Technical Solutions on Apr 30, 2022

[SOLVED / FIXED ] Kubernetes / Docker could not create directory. wordpress ERROR: could not create directory SOLUTION / FIX: chown -R www-data:www-data /var/www



The Impact of Server Location on Website Speed and SEO

Posted in Uncategorized on Jul 24, 2024

Choosing the right server location is crucial for optimizing website speed and improving SEO rankings. This article explores how server location affects load times, the benefits of using CDNs, and best practices for selecting the optimal server location to enhance both global and local website performance. Discover the impact of latency, data transfer rates, and regional targeting on your site's user experience and search engine visibility.



[SOLVED / FIXED] Kubesphere request to http //ks-apiserver/oauth/token failed

Posted in Technical Solutions on Jul 17, 2022

[SOLVED / FIXED] Kubesphere request to http //ks-apiserver/oauth/token failed



Meta's Fight Against Celebrity Investment Scam Ads with Facial Recognition Technology

Posted in News on Oct 23, 2024

Meta, the parent company of Facebook and Instagram, has taken significant steps in its ongoing battle against celebrity investment scam ads by leveraging facial recognition technology. These scam ads often involve deepfake images of celebrities like Gina Rinehart and Guy Sebastian, tricking users into believing false endorsements. This new initiative aims to quickly and accurately detect these fraudulent ads and remove them before they reach unsuspecting users.



80% of Software Engineers Could Lose Jobs to AI if They Don’t Upskill, Gartner Analysts Warn

Posted in News on Oct 15, 2024

Artificial Intelligence (AI) is reshaping the software engineering landscape, with Gartner predicting that 80% of software engineers will need to upskill by 2027 to stay relevant. AI tools are automating repetitive tasks, allowing engineers to focus on more creative work. However, as AI becomes more advanced, it will take over many coding tasks, making it essential for engineers to learn new skills in AI, machine learning, and data engineering. Those who adapt will thrive, while those who don’t risk being left behind in this rapidly changing industry.



Now hiring Wordpress PHP Developer (Remote / Office) - 2022

Posted in Jobs on Feb 28, 2022

Now hiring Wordpress PHP Developer (Remote / Office): Required Wordpress CSS, HTML, Javascript, PHP




Other Blogs


[SOLVED / FIXED] Django error 400 bad request

Posted in Technical Solutions on Jul 04, 2021 and updated on Jul 28, 2021

Domain Name: Your Gateway to Online Success

Posted in Uncategorized on Jul 03, 2024 and updated on Jul 03, 2024

[Tips] Change Python Django Superuser password

Posted in Technical Solutions on May 06, 2022 and updated on May 07, 2022

IBM Develops AI Agents to Automate Software Engineering Tasks

Posted in News on Nov 08, 2024 and updated on Nov 08, 2024

Apple's New AirPods are Also Hearing Aids

Posted in News on Sep 10, 2024 and updated on Sep 10, 2024

How to Protect Your Website from Malware and Viruses

Posted in News on Oct 07, 2024 and updated on Oct 07, 2024

25 AI Tips to Boost Your Programming Productivity with ChatGPT

Posted in News on Nov 19, 2024 and updated on Nov 19, 2024

Gmail Users at Risk from AI-Powered Cyberattacks

Posted in News on Oct 14, 2024 and updated on Oct 14, 2024

Best Prices Now

Posted in Hosting Promotions on Sep 08, 2022 and updated on Nov 27, 2023

The Impact of Server Location on Website Speed and SEO

Posted in Uncategorized on Jul 24, 2024 and updated on Jul 24, 2024

Now hiring Wordpress PHP Developer (Remote / Office) - 2022

Posted in Jobs on Feb 28, 2022 and updated on Feb 28, 2022

Best Prices Now

Posted in Hosting Promotions on Sep 08, 2022

Best Prices Now

Posted in Hosting Promotions on Sep 08, 2022







Comments

Please sign in to comment!






Subscribe To Our Newsletter

Stay in touch with us to get latest news and discount coupons