Jenkins 87f0799f95 Merge "Notify Heat only if kube-apiserver is running" 2016-04-19 00:38:30 +00:00
elements Rename heat-kubernetes, heat-mesos, docker-swarm 2015-11-11 16:29:33 -05:00
fragments Merge "Notify Heat only if kube-apiserver is running" 2016-04-19 00:38:30 +00:00
COPYING Rename heat-kubernetes, heat-mesos, docker-swarm 2015-11-11 16:29:33 -05:00 Add flannel's host-gw backend option 2016-03-18 04:53:24 +00:00
kubecluster-coreos.yaml Update Kube version for latest image 2016-04-09 17:22:05 +00:00
kubecluster-fedora-ironic.yaml Add flannel's host-gw backend option 2016-03-18 04:53:24 +00:00
kubecluster.yaml Merge "Add support for docker registry" 2016-04-17 15:11:32 +00:00
kubemaster-coreos.yaml Format template 2016-04-11 14:59:49 +08:00
kubemaster-fedora-ironic.yaml Format template 2016-04-11 14:59:49 +08:00
kubemaster.yaml Merge "Notify Heat only if kube-apiserver is running" 2016-04-19 00:38:30 +00:00
kubeminion-coreos.yaml Format template 2016-04-11 14:59:49 +08:00
kubeminion-fedora-ironic.yaml Format template 2016-04-11 14:59:49 +08:00
kubeminion.yaml Add support for docker registry 2016-04-13 16:17:20 +08:00

A Kubernetes cluster with Heat

These Heat templates will deploy a Kubernetes cluster that supports automatic scaling based on CPU load.

The cluster uses Flannel to provide an overlay network connecting pods deployed on different minions.



These templates will work with the Kilo version of Heat. They may work with Juno as well as soon as #1402894 is resolved.

Guest image

These templates will work with either CentOS Atomic Host or Fedora 21 Atomic.

You can enable docker registry v2 by setting the "registry_enabled" parameter to "true".

Creating the stack

Creating an environment file local.yaml with parameters specific to your environment:

  ssh_key_name: testkey
  external_network: public
  server_image: centos-7-atomic-20150101
  registry_enabled: true
  registry_username: username
  registry_password: password
  registry_domain: domain
  registry_trust_id: trust_id
  registry_auth_url: auth_url
  registry_region: region
  registry_container: container

And then create the stack, referencing that environment file:

heat stack-create -f kubecluster.yaml -e local.yaml my-kube-cluster

You must provide values for:

  • ssh_key_name
  • server_image

If you enable docker registry v2, you must provide values for:

  • registry_username
  • registry_password
  • registry_domain
  • registry_trust_id
  • registry_auth_url
  • registry_region
  • `registry_container

Interacting with Kubernetes

You can get the ip address of the Kubernetes master using the heat output-show command:

$ heat output-show my-kube-cluster kube_masters

You can ssh into that server as the minion user:

$ ssh minion@

And once logged in you can run kubectl, etc:

$ kubectl get minions
NAME                LABELS       STATUS            <none>       Ready

You can log into your minions using the minion user as well. You can get a list of minion addresses by running:

$ heat output-show my-kube-cluster kube_minions

You can get the docker registry v2 address: $ heat output-show my-kube-cluster registry_address localhost:5000


The templates install an example Pod and Service description into /etc/kubernetes/examples. You can deploy this with the following commands:

$ kubectl create -f /etc/kubernetes/examples/web.service
$ kubectl create -f /etc/kubernetes/examples/web.pod

This will deploy a minimal webserver and a service. You can use kubectl get pods and kubectl get services to see the results of these commands.


Copyright 2014 Lars Kellogg-Stedman

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Please submit bugs and pull requests via the GitHub repository at

When submitting pull requests:

  • Please ensure that each pull request contains a single commit and contains only related changes. Put unrelated changes in multiple pull requests.

  • Please avoid conflating new features with stylistic/formatting/cleanup changes.