Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viveksinghggits/cluster-setup
Basic commands that can be run to create a three node kubeadm kubernetes cluster.
https://github.com/viveksinghggits/cluster-setup
kubeadm kubeadm-cluster kubernetes
Last synced: 13 days ago
JSON representation
Basic commands that can be run to create a three node kubeadm kubernetes cluster.
- Host: GitHub
- URL: https://github.com/viveksinghggits/cluster-setup
- Owner: viveksinghggits
- Created: 2021-03-14T16:40:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-28T21:11:01.000Z (about 2 years ago)
- Last Synced: 2024-11-01T02:51:40.530Z (20 days ago)
- Topics: kubeadm, kubeadm-cluster, kubernetes
- Homepage:
- Size: 131 KB
- Stars: 23
- Watchers: 4
- Forks: 67
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> :warning: **This document would not work on Lastest Ubuntu 22.04**: We get into https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues
## Setting up three node Kubernetes cluster
First of all, we should have three instances created that can connect over the public network. It doesn't matter how those instances are created, for example, they can either be Digital Ocean `droplets` or `AWS EC2` instances.
### SSH into all the instances
Once you are into those instances, the commands that are mentioned below should be run on all the instances
#### Commands to run on all the nodes
```
# Get sudo working
sudo -l# update packages and their version
sudo apt-get update && sudo apt-get upgrade -y# install curl and apt-transport-https
sudo apt-get update && sudo apt-get install -y apt-transport-https curl# add key to verify releases
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -# add kubernetes apt repo
cat <
kubeadm init --apiserver-advertise-address=${MASTER_IP} --pod-network-cidr=10.244.0.0/16
```#### Join worker nodes to the Leader node
Once the command `kubeadm init` is completed on the leader node, below we would get a command like below in the output of `kubeadm init` that can be run on worker nodes to make them join the leader node.
```
kubeadm join 206.189.134.39:6443 --token dxxfoj.a2zzwbfrjejzir4h \
--discovery-token-ca-cert-hash sha256:110e853989c2401b1e54aef6e8ff0393e05f18d531a75ed107cf6c05ca4170eb
```### Install CNI plugin
The below command can be run on the leader node to install the CNI plugin
```
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
```### Setting up Kubeconfig file
After successful completion of `kubeadm init` command, like we got the `kubeadm join` command, we would also get details about how we can set up `kubeconfig` file.