This exercise uses a single VM to build a Kubernetes environment having a master node, an etcd database, and a pod network using Calico and Helm. Please refer to the "Further Reading" section if you want to build a multi-node cluster.
You also have the option to just use minikube (https://kubernetes.io/docs/setup/learning-environment/minikube/), though. By going through this exercise, you will learn how to build your own Kubernetes environment.
Begin with these simple steps:
- First, configure iptables for Kubernetes:
# cat <<EOF > /etc/sysctl.d/k8s.conf
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
# sysctl --system
- Now add the Kubernetes repository:
# cat << EOF >/etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
Perfect! Now it's time to install Kubernetes.