Installing Kubernetes with the (certified!) Puppet Kubernetes module
The module installs and configures Kubernetes, allowing the deployment of Kubernetes clusters to be managed using either open source Puppet or Puppet Enterprise. Puppet will maintain the state of your Kubernetes cluster automatically. Using this module will help you deploy Kubernetes quicker, using the Puppet DSL to define the state. It is fully open source and community contributions are welcome. The module uses the kubeadm toolkit to bootstrap the Kubernetes cluster.
Getting started with the module
The module comes with a kubetool which will generate the yaml configuration for your Kubernetes deployment. The files produced for each member of the etcd cluster contain certificate information to bootstrap an initial etcd cluster.
Add the generated configuration files to Hiera. Each cluster can be allocated its own configuration.
Now it's possible to configure the nodes. There can be controller and worker nodes. A node be either controller or worker, but not both.
Add the following code to a manifest to make it a controller:
and the following code will made a node a worker:
Using the module in this way will keep your Kubernetes installation consistently enforced based on the manifests used for its creation — Puppet will prevent any drift. It should be noted that the module does not control any containerized applications deployed to the Kubernetes cluster.
We hope you enjoy using the module and that it simplifies using Puppet and Kubernetes together. If you are new to Kubernetes and want get a basic cluster running with a controller and two workers, try using the Puppet Kubernetes sandbox.
Davin Hanlon is a senior product manager at Puppet.