-[Getting started on [CentOS](http://centos.org)](#getting-started-on-centoshttpcentosorg)
-[Contents](#contents)
-[Starting a cluster](#starting-a-cluster)
## Starting a cluster
This is a getting started guide for CentOS. It is a manual configuration so you understand all the underlying packages / services / ports, etc...
This is a getting started guide for CentOS. It is a manual configuration so you understand all the underlying packages / services / ports, etc...
This guide will only get ONE minion working. Multiple minions requires a functional [networking configuration](http://docs.k8s.io/networking.md) done outside of kubernetes. Although the additional kubernetes configuration requirements should be obvious.
This guide will only get ONE minion working. Multiple minions requires a functional [networking configuration](http://docs.k8s.io/networking.md) done outside of kubernetes. Although the additional kubernetes configuration requirements should be obvious.
## Deploying Kubernetes on [CloudStack](http://cloudstack.apache.org)
## Deploying Kubernetes on [CloudStack](http://cloudstack.apache.org)
## Contents
-[Deploying Kubernetes on [CloudStack](http://cloudstack.apache.org)](#deploying-kubernetes-on-cloudstackhttpcloudstackapacheorg)
-[Contents](#contents)
-[Introduction](#introduction)
-[Ansible playbook](#ansible-playbook)
-[Prerequisites](#prerequisites)
-[Clone the playbook](#clone-the-playbook)
-[Create a Kubernetes cluster](#create-a-kubernetes-cluster)
## Introduction
CloudStack is a software to build public and private clouds based on hardware virtualization principles (traditional IaaS). To deploy Kubernetes on CloudStack there are several possibilities depending on the Cloud being used and what images are made available. [Exoscale](http://exoscale.ch) for instance makes a [CoreOS](http://coreos.com) template available, therefore instructions to deploy Kubernetes on coreOS can be used. CloudStack also has a vagrant plugin available, hence Vagrant could be used to deploy Kubernetes either using the existing shell provisioner or using new Salt based recipes.
CloudStack is a software to build public and private clouds based on hardware virtualization principles (traditional IaaS). To deploy Kubernetes on CloudStack there are several possibilities depending on the Cloud being used and what images are made available. [Exoscale](http://exoscale.ch) for instance makes a [CoreOS](http://coreos.com) template available, therefore instructions to deploy Kubernetes on coreOS can be used. CloudStack also has a vagrant plugin available, hence Vagrant could be used to deploy Kubernetes either using the existing shell provisioner or using new Salt based recipes.
[CoreOS](http://coreos.com) templates for CloudStack are built [nightly](http://stable.release.core-os.net/amd64-usr/current/). CloudStack operators need to [register](http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/templates.html) this template in their cloud before proceeding with these Kubernetes deployment instructions.
[CoreOS](http://coreos.com) templates for CloudStack are built [nightly](http://stable.release.core-os.net/amd64-usr/current/). CloudStack operators need to [register](http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/templates.html) this template in their cloud before proceeding with these Kubernetes deployment instructions.
...
@@ -12,12 +24,11 @@ There are currently two deployment techniques.
...
@@ -12,12 +24,11 @@ There are currently two deployment techniques.
This is completely automated, a single playbook deploys Kubernetes based on the coreOS [instructions](http://docs.k8s.io/getting-started-guides/coreos/coreos_multinode_cluster.md).
This is completely automated, a single playbook deploys Kubernetes based on the coreOS [instructions](http://docs.k8s.io/getting-started-guides/coreos/coreos_multinode_cluster.md).
#Ansible playbook
## Ansible playbook
This [Ansible](http://ansibleworks.com) playbook deploys Kubernetes on a CloudStack based Cloud using CoreOS images. The playbook, creates an ssh key pair, creates a security group and associated rules and finally starts coreOS instances configured via cloud-init.
This [Ansible](http://ansibleworks.com) playbook deploys Kubernetes on a CloudStack based Cloud using CoreOS images. The playbook, creates an ssh key pair, creates a security group and associated rules and finally starts coreOS instances configured via cloud-init.
Prerequisites
###Prerequisites
-------------
$ sudo apt-get install -y python-pip
$ sudo apt-get install -y python-pip
$ sudo pip install ansible
$ sudo pip install ansible
...
@@ -39,16 +50,14 @@ Or create a `~/.cloudstack.ini` file:
...
@@ -39,16 +50,14 @@ Or create a `~/.cloudstack.ini` file:
We need to use the http POST method to pass the _large_ userdata to the coreOS instances.
We need to use the http POST method to pass the _large_ userdata to the coreOS instances.
# Kubernetes on Azure with CoreOS and [Weave](http://weave.works)
# Kubernetes on Azure with CoreOS and [Weave](http://weave.works)
## Contents
-[Kubernetes on Azure with CoreOS and [Weave](http://weave.works)](#kubernetes-on-azure-with-coreos-and-weavehttpweaveworks)
-[Contents](#contents)
-[Introduction](#introduction)
-[Let's go!](#lets-go)
-[Deploying the workload](#deploying-the-workload)
-[Scaling](#scaling)
-[Exposing the app to the outside world](#exposing-the-app-to-the-outside-world)
-[Next steps](#next-steps)
-[Tear down...](#tear-down)
## Introduction
## Introduction
In this guide I will demonstrate how to deploy a Kubernetes cluster to Azure cloud. You will be using CoreOS with Weave, which implements simple and secure networking, in a transparent, yet robust way. The purpose of this guide is to provide an out-of-the-box implementation that can ultimately be taken into production with little change. It will demonstrate how to provision a dedicated Kubernetes master and etcd nodes, and show how to scale the cluster with ease.
In this guide I will demonstrate how to deploy a Kubernetes cluster to Azure cloud. You will be using CoreOS with Weave, which implements simple and secure networking, in a transparent, yet robust way. The purpose of this guide is to provide an out-of-the-box implementation that can ultimately be taken into production with little change. It will demonstrate how to provision a dedicated Kubernetes master and etcd nodes, and show how to scale the cluster with ease.
Deploy a CoreOS running Kubernetes environment. This particular guild is made to help those in an OFFLINE system, wither for testing a POC before the real deal, or you are restricted to be totally offline for your applications.
Deploy a CoreOS running Kubernetes environment. This particular guild is made to help those in an OFFLINE system, wither for testing a POC before the real deal, or you are restricted to be totally offline for your applications.
## Contents
-[Bare Metal CoreOS with Kubernetes (OFFLINE)](#bare-metal-coreos-with-kubernetes-offline)
-[Contents](#contents)
-[High Level Design](#high-level-design)
-[Pre-requisites](#pre-requisites)
-[This Guides variables](#this-guides-variables)
-[Setup PXELINUX CentOS](#setup-pxelinux-centos)
-[Adding CoreOS to PXE](#adding-coreos-to-pxe)
-[DHCP configuration](#dhcp-configuration)
-[Kubernetes](#kubernetes)
-[Cloud Configs](#cloud-configs)
-[master.yml](#masteryml)
-[cloud-config](#cloud-config)
-[node.yml](#nodeyml)
-[cloud-config](#cloud-config)
-[New pxelinux.cfg file](#new-pxelinuxcfg-file)
-[Specify the pxelinux targets](#specify-the-pxelinux-targets)
-[Creating test pod](#creating-test-pod)
-[Helping commands for debugging](#helping-commands-for-debugging)
## High Level Design
## High Level Design
1. Manage the tftp directory
1. Manage the tftp directory
...
@@ -159,7 +180,7 @@ This section covers configuring the DHCP server to hand out our new images. In t
...
@@ -159,7 +180,7 @@ This section covers configuring the DHCP server to hand out our new images. In t
We will be specifying the node configuration later in the guide.
We will be specifying the node configuration later in the guide.
# Kubernetes
## Kubernetes
To deploy our configuration we need to create an ```etcd``` master. To do so we want to pxe CoreOS with a specific cloud-config.yml. There are two options we have here.
To deploy our configuration we need to create an ```etcd``` master. To do so we want to pxe CoreOS with a specific cloud-config.yml. There are two options we have here.
1. Is to template the cloud config file and programmatically create new static configs for different cluster setups.
1. Is to template the cloud config file and programmatically create new static configs for different cluster setups.
2. Have a service discovery protocol running in our stack to do auto discovery.
2. Have a service discovery protocol running in our stack to do auto discovery.
Configuring kubernetes on Fedora via Ansible offers a simple way to quickly create a clustered environment with little effort.
Configuring kubernetes on Fedora via Ansible offers a simple way to quickly create a clustered environment with little effort.
Requirements:
## Contents
-[Configuring kubernetes on [Fedora](http://fedoraproject.org) via [Ansible](http://www.ansible.com/home).](#configuring-kubernetes-on-fedorahttpfedoraprojectorg-via-ansiblehttpwwwansiblecomhome)
-[Contents](#contents)
-[Requirements](#requirements)
-[Architecture of the cluster](#architecture-of-the-cluster)
-[Configuring ssh access to the cluster](#configuring-ssh-access-to-the-cluster)
-[Configuring the internal kubernetes network](#configuring-the-internal-kubernetes-network)
-[Setting up the cluster](#setting-up-the-cluster)
-[Testing and using your new cluster](#testing-and-using-your-new-cluster)
##Requirements
1. Host able to run ansible and able to clone the following repo: [kubernetes-ansible](https://github.com/eparis/kubernetes-ansible)
1. Host able to run ansible and able to clone the following repo: [kubernetes-ansible](https://github.com/eparis/kubernetes-ansible)
2. A Fedora 20+ or RHEL7 host to act as cluster master
2. A Fedora 20+ or RHEL7 host to act as cluster master
#**Kubernetes multiple nodes cluster with flannel on Fedora**
#Kubernetes multiple nodes cluster with flannel on Fedora
## Contents
-[Kubernetes multiple nodes cluster with flannel on Fedora](#kubernetes-multiple-nodes-cluster-with-flannel-on-fedora)
-[Contents](#contents)
-[Introduction](#introduction)
-[Master Setup](#master-setup)
-[Node Setup](#node-setup)
-[**Test the cluster and flannel configuration**](#test-the-cluster-and-flannel-configuration)
## Introduction
This document describes how to deploy kubernetes on multiple hosts to set up a multi-node cluster and networking with flannel. Follow fedora [getting started guide](fedora_manual_config.md) to setup 1 master (fed-master) and 2 or more nodes (minions). Make sure that all nodes (minions) have different names (fed-node1, fed-node2 and so on) and labels (fed-node1-label, fed-node2-label, and so on) to avoid any conflict. Also make sure that the kubernetes master host is running etcd, kube-controller-manager, kube-scheduler, and kube-apiserver services, and the nodes (minions) are running docker, kube-proxy and kubelet services. Now install flannel on kubernetes nodes (minions). flannel on each node configures an overlay network that docker uses. flannel runs on each node to setup a unique class-C container network.
This document describes how to deploy kubernetes on multiple hosts to set up a multi-node cluster and networking with flannel. Follow fedora [getting started guide](fedora_manual_config.md) to setup 1 master (fed-master) and 2 or more nodes (minions). Make sure that all nodes (minions) have different names (fed-node1, fed-node2 and so on) and labels (fed-node1-label, fed-node2-label, and so on) to avoid any conflict. Also make sure that the kubernetes master host is running etcd, kube-controller-manager, kube-scheduler, and kube-apiserver services, and the nodes (minions) are running docker, kube-proxy and kubelet services. Now install flannel on kubernetes nodes (minions). flannel on each node configures an overlay network that docker uses. flannel runs on each node to setup a unique class-C container network.
##**Perform following commands on the kubernetes master**
## Master Setup
**Perform following commands on the kubernetes master**
* Configure flannel by creating a `flannel-config.json` in your current directory on fed-master. flannel provides udp and vxlan among other overlay networking backend options. In this guide, we choose kernel based vxlan backend. The contents of the json are:
* Configure flannel by creating a `flannel-config.json` in your current directory on fed-master. flannel provides udp and vxlan among other overlay networking backend options. In this guide, we choose kernel based vxlan backend. The contents of the json are:
...
@@ -30,7 +43,9 @@ This document describes how to deploy kubernetes on multiple hosts to set up a m
...
@@ -30,7 +43,9 @@ This document describes how to deploy kubernetes on multiple hosts to set up a m
# etcdctl get /coreos.com/network/config
# etcdctl get /coreos.com/network/config
```
```
##**Perform following commands on all kubernetes nodes**
## Node Setup
**Perform following commands on all kubernetes nodes**
* Edit the flannel configuration file /etc/sysconfig/flanneld as follows:
* Edit the flannel configuration file /etc/sysconfig/flanneld as follows:
The example below creates a Kubernetes cluster with 4 worker node Virtual Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This cluster is set up and controlled from your workstation (or wherever you find convenient).
The example below creates a Kubernetes cluster with 4 worker node Virtual Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This cluster is set up and controlled from your workstation (or wherever you find convenient).
- [Can't find virsh in PATH, please fix and retry.](#cant-find-virsh-in-path-please-fix-and-retry)
- [error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory](#error-failed-to-connect-socket-to-varrunlibvirtlibvirt-sock-no-such-file-or-directory)
- [error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied](#error-failed-to-connect-socket-to-varrunlibvirtlibvirt-sock-permission-denied)
- [error: Out of memory initializing network (virsh net-create...)](#error-out-of-memory-initializing-network-virsh-net-create)
### Highlights
### Highlights
* Super-fast cluster boot-up (few seconds instead of several minutes for vagrant)
* Super-fast cluster boot-up (few seconds instead of several minutes for vagrant)
-[Getting started locally](#getting-started-locally)
-[Contents](#contents)
-[Requirements](#requirements)
-[Linux](#linux)
-[Docker](#docker)
-[etcd](#etcd)
-[go](#go)
-[Starting the cluster](#starting-the-cluster)
-[Running a container](#running-a-container)
-[introspect kubernetes!](#introspect-kubernetes)
-[Running a user defined pod](#running-a-user-defined-pod)
-[Troubleshooting](#troubleshooting)
-[I cannot reach service IPs on the network.](#i-cannot-reach-service-ips-on-the-network)
-[I cannot create a replication controller with replica size greater than 1! What gives?](#i-cannot-create-a-replication-controller-with-replica-size-greater-than-1--what-gives)
-[I changed Kubernetes code, how do I run it?](#i-changed-kubernetes-code-how-do-i-run-it)
-[kubectl claims to start a container but `get pods` and `docker ps` don't show it.](#kubectl-claims-to-start-a-container-but-get-pods-and-docker-ps-dont-show-it)
-[The pods fail to connect to the services by host names](#the-pods-fail-to-connect-to-the-services-by-host-names)
- [Run the Example Guestbook App](#run-the-example-guestbook-app)
- [Test Guestbook App](#test-guestbook-app)
-[determine the internal port for the frontend service](#determine-the-internal-port-for-the-frontend-service)
-[open up access to the internal port for the frontend service](#open-up-access-to-the-internal-port-for-the-frontend-service)
## About Kubernetes on Mesos
<!-- TODO: Update, clean up. -->
<!-- TODO: Update, clean up. -->
Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [Hadoop][1], [Spark][2], and [Chronos][3].
Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [Hadoop][1], [Spark][2], and [Chronos][3].
oVirt is a virtual datacenter manager that delivers powerful management of multiple virtual machines on multiple hosts. Using KVM and libvirt, oVirt can be installed on Fedora, CentOS, or Red Hat Enterprise Linux hosts to set up and manage your virtual data center.
oVirt is a virtual datacenter manager that delivers powerful management of multiple virtual machines on multiple hosts. Using KVM and libvirt, oVirt can be installed on Fedora, CentOS, or Red Hat Enterprise Linux hosts to set up and manage your virtual data center.
# Kubernetes Deployment On Bare-metal Ubuntu Nodes
## Kubernetes Deployment On Bare-metal Ubuntu Nodes
## Contents
- [Kubernetes Deployment On Bare-metal Ubuntu Nodes](#kubernetes-deployment-on-bare-metal-ubuntu-nodes)
- [Contents](#contents)
- [Introduction](#introduction)
- [**Prerequisites:**](#prerequisites)
- [**Main Steps**](#main-steps)
- [I. Make *kubernetes* , *etcd* and *flanneld* binaries](#i-make-kubernetes--etcd-and-flanneld-binaries)
- [II. Configure and start the kubernetes cluster](#ii-configure-and-start-the-kubernetes-cluster)
- [IV. Deploy addons](#iv-deploy-addons)
- [IV. Trouble Shooting](#iv-trouble-shooting)
## Introduction
This document describes how to deploy kubernetes on ubuntu nodes, including 1 master node and 3 minion nodes, and people uses this approach can scale to **any number of minion nodes** by changing some settings with ease. The original idea was heavily inspired by @jainvipin 's ubuntu single node work, which has been merge into this document.
This document describes how to deploy kubernetes on ubuntu nodes, including 1 master node and 3 minion nodes, and people uses this approach can scale to **any number of minion nodes** by changing some settings with ease. The original idea was heavily inspired by @jainvipin 's ubuntu single node work, which has been merge into this document.