Published on 11 October 2017 by

Kubernetes is gathering a lot of steam in the container ecosystem. Since the project was donated to the CNCF there has been massive adoption from the likes of Microsoft, Oracle and VMware. At Puppet, we’re committed to helping our customers adopt whatever’s next. To that end, we announced Project Blueshift last year and we’re continuing to expand on that promise with our latest set of releases.

We have developed a new set of tools to make your adoption of Kubernetes as efficient as possible, covering your full workflow cycle from development to production. Additionally, we’re happy to announce a new Docker module that includes enhanced support.

In development

Kubernetes development can be done on many levels. If you’re an SRE or Ops Engineer, you may be responsible for testing changes to Kubernetes clusters. If you’re a developer, you may be responsible for testing the latest version of your application on a cluster. To account for both use cases, we’ve developed Kream, a new tool that enables you to install and manage Kubernetes and Helm, and build a local development cluster. Kream gives you the following:

  • A multi-node Kubernetes cluster
  • Helm preinstalled for application deployment
  • Rook for block level storage

Kream uses both the Puppet modules for Kubernetes and Helm to build the cluster. To build a local development cluster you just need to run a single command


$ rake cluster_up

If you prefer AWS, you can use our CloudFormation template.

Now take it to production

Spinning up a production Kubernetes cluster can be a daunting task. With the Kubernetes module we aimed to abstract most of the complexity for you. We built a tool that automates the module's parameters, including SSL certificates into a Hiera file. This tool ships with the module and is located in the tools directory. Just follow the instructions to run the tool. To get the help menu, issue the following command:

./kube_tool.rb 

It will print out the following:

 kube_tool.rb build_hiera FQDN, IP, BOOTSTRAP_CONTROLLER_IP, ETCD_INITIAL_CLUSTER, ETCD_IP, KUBE_API_ADVERTISE_ADDRESS, INSTALL_DASHBOARD  # Pass the cluster params to build your hiera configuration

Then you can generate your Hiera file with:

./kube_tool.rb build_hiera kubernetes 172.17.10.101 172.17.10.101 "etcd-kube-master=http://172.17.10.101:2380,etcd-kube-replica-master-01=http://172.17.10.210:2380,etcd-kube-replica-master-02=http://172.17.10.220:2380"  "%{::ipaddress_enp0s8}"  "%{::ipaddress_enp0s8}" true

Then all you need to do is define your nodes as one of the following: A bootstrap controller

class {'kubernetes':
  controller           => true,
  bootstrap_controller => true,
}

A controller

class {'kubernetes':
  controller => true,
}

Or a worker

class {'kubernetes':
  woker => true,
}

After Puppet runs on all the nodes, your Kubernetes cluster will be up and running. To add Helm to your cluster to deploy custom charts or charts from a public repo add the following class to a controller node:

include helm

Now you have a production-ready Kubernetes cluster that is a replication of Kream with Helm installed and you can easily deploy your application to this cluster. If you are an advanced Kubernetes user and don’t want to use our tool to generate the Hiera file, we’ve left all the parameters as undef, so you have the freedom to make any customizations you need.

We also recently shipped our new Docker module to include support for Puppet Code Manager, Docker Swarm mode and Docker Secrets. Stay tuned for a follow up blog post!

If you’re at PuppetConf, be sure to check out the following Kubernetes sessions:

We hope to see you there! And if you can’t make it, be sure to sign up for the live stream.

Scott Coulton is a principal software engineer at Puppet.

Learn more

Share via:

Add new comment

The content of this field is kept private and will not be shown publicly.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.