Difference between revisions of "Setting up Kubernetes cluster"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
m (prevent making links where not necessary)
(Master installation: formatting fixes)
Line 16: Line 16:
 
To install a master node, you need to do the following:
 
To install a master node, you need to do the following:
  
1. Install etcd and kubernetes-master:
+
=== Install etcd and kubernetes-master ===
  
 
  yum -y install etcd kubernetes-master
 
  yum -y install etcd kubernetes-master
  
2. Configure etcd to listen to all IPs.
+
=== Configure etcd ===
  
 
Make sure <code>/etc/etcd/etcd.conf</code> contains this line:
 
Make sure <code>/etc/etcd/etcd.conf</code> contains this line:
Line 26: Line 26:
 
  <nowiki>ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"</nowiki>
 
  <nowiki>ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"</nowiki>
  
3. Configure Kubernetes API server.
+
=== Configure Kubernetes API server ===
  
 
Make sure <code>/etc/kubernetes/apiserver</code> contains this:
 
Make sure <code>/etc/kubernetes/apiserver</code> contains this:
 
  
 
4. Start master node services:
 
4. Start master node services:
  
 
  for S in etcd kube-apiserver kube-controller-manager kube-scheduler; do  
 
  for S in etcd kube-apiserver kube-controller-manager kube-scheduler; do  
    systemctl restart $S
+
  systemctl restart $S
    systemctl enable $S
+
  systemctl enable $S
done
+
done
  
 
== Set nodes (minions) ==
 
== Set nodes (minions) ==

Revision as of 22:23, 13 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 flannel and kubernetes-node:

yum -y install flannel kubernetes-node


See also