Difference between revisions of "Setting up Kubernetes cluster"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(Master installation: formatting fixes)
(Set nodes (minions): some more steps)
Line 39: Line 39:
 
== Set nodes (minions) ==
 
== Set nodes (minions) ==
  
1. Install flannel and kubernetes-node:
+
1. Install vzkernel:
 +
rpm -ihv https://download.openvz.org/virtuozzo/factory/x86_64/os/Packages/v/vzkernel-3.10.0-229.7.2.vz7.6.9.x86_64.rpm
 +
 
 +
2. Enable docker-ploop repo:
 +
 
 +
cd /etc/yum.repos.d/
 +
wget https://copr.fedoraproject.org/coprs/kir/docker-ploop/repo/epel-7/kir-docker-ploop-epel-7.repo
 +
echo "priority=60" >> kir-docker-ploop-epel-7.repo
 +
yum install ploop docker
 +
 
 +
3. Set ploop driver to be default for docker.
 +
 
 +
Make sure <code>/etc/sysconfig/docker-storage</code> contains:
 +
 
 +
DOCKER_STORAGE_OPTIONS="-s ploop"
 +
 
 +
4. Install flannel and kubernetes-node:
  
 
  yum -y install flannel kubernetes-node
 
  yum -y install flannel kubernetes-node
 
  
 
== See also ==
 
== See also ==
  
 
* [https://github.com/coreos/etcd/blob/master/Documentation/configuration.md etcd configuration]
 
* [https://github.com/coreos/etcd/blob/master/Documentation/configuration.md etcd configuration]

Revision as of 19:20, 14 September 2015

This article describes a way to deploy a Kubernetes cluster on a few CentOS 7 machines.

Prerequisites

Every system should have:

  • CentOS 7 minimal installed
  • firewalld stopped
systemctl stop firewalld; systemctl disable firewalld
  • ntpd installed and running:
yum -y install ntpd && systemctl start ntpd && systemctl enable ntpd

Master installation

To install a master node, you need to do the following:

Install etcd and kubernetes-master

yum -y install etcd kubernetes-master

Configure etcd

Make sure /etc/etcd/etcd.conf contains this line:

ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"

Configure Kubernetes API server

Make sure /etc/kubernetes/apiserver contains this:

4. Start master node services:

for S in etcd kube-apiserver kube-controller-manager kube-scheduler; do 
  systemctl restart $S
  systemctl enable $S
done

Set nodes (minions)

1. Install vzkernel:

rpm -ihv https://download.openvz.org/virtuozzo/factory/x86_64/os/Packages/v/vzkernel-3.10.0-229.7.2.vz7.6.9.x86_64.rpm

2. Enable docker-ploop repo:

cd /etc/yum.repos.d/
wget https://copr.fedoraproject.org/coprs/kir/docker-ploop/repo/epel-7/kir-docker-ploop-epel-7.repo
echo "priority=60" >> kir-docker-ploop-epel-7.repo
yum install ploop docker

3. Set ploop driver to be default for docker.

Make sure /etc/sysconfig/docker-storage contains:

DOCKER_STORAGE_OPTIONS="-s ploop"

4. Install flannel and kubernetes-node:

yum -y install flannel kubernetes-node

See also