johscheuer / theforeman-coreos-kubernetes

A small collection of templates used to deploy Kubernets on CoreOS with theforeman
Apache License 2.0
23 stars 8 forks source link

Snippets

You have to create a host parameter cloudconfig and insert the specific snippet name to use the different snippets with the same provisioning template. You can find the default CoreOS templates for foreman at github, which should be already included if you use foreman > 1.8.

Import templates

The easiest way to import these templates into your foreman is using foreman_templates.

I used a rake task for different prefix:

foreman-rake templates:sync repo="https://github.com/johscheuer/theforeman-coreos-kubernetes.git" prefix="k8s_" dirname="/kubernetes"

If you want to use different prefixes you have to adjust the names of the snippets.

Global host Parameters

Adjust the CoreOS Template

Replace the <%= snippet 'coreos_cloudconfig' %> line 41 with this content (the spaces are important) or create a second template for this:

      <%= snippet @host.params['cloudconfig'] %>

Kubernetes

With these snippets you can either deploy a standalone Kubernetes which means that all components of Kubernetes are running on one single node. One the the hand you can deploy a single master node which contains etcd + Kubernetes master components and as many minion nodes as you want.

kubernetes master_cloudconfig

This snippet installs a kubernetes-master which allows you to interact with Kubernetes and deploy your services.

Host parameters:

kubernetes minion_cloudconfig

This snippet installs a kubernetes-minion.

Host parameters:

kubernetes standalone_cloudconfig

This snippet installs the kube-master and a kube-minion on the same node.

Host parameters:

Tools

For the deployment the following tools were used: