Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

  1. Blog
  2. Article

Matt Bruzek
on 23 July 2015

Deploy a Kubernetes development cluster with Juju!


Our team has been working to make Kubernetes easy to deploy in a public cloud. In March we created some Juju charms that have the ability to deploy specific releases of Kubernetes on a public cloud. In April we worked to get the charm and bundle code in the Kubernetes project itself. Making it even easier for people to deploy a cluster from the official Kubernetes repository.

We have reached another milestone in the Kubernetes story. We added the ability to deploy a Kubernetes cluster with binaries built from local source! This is important to software engineers because it gives them an easy way to stand up a cluster and see their changes right away.

Development setup

To use this new feature the local environment must be set up for development. Refer to the Development Guide for details on how to set up your environment for development in the Go programming language.

Deploy local binaries

We are calling this deploy from source option “local”. Here is how it works:

  • Clone the Kubernetes project from Github:
    git clone http://github.com/GoogleCloudPlatform/kubernetes.git
    cd kubernetes
  • Set the Kubernetes provider to “juju”:
    export KUBERNETES_PROVIDER=juju
  • Change/edit the source code, and when you are ready, run the kube-up.sh script to deploy a cluster with your locally built binaries:
    cluster/kube-up.sh

The kube-up.sh script will build the required binary files (using make all), copy the binary files to the charm directory and deploy a cluster to the public cloud you have configured with Juju, if you do not have a public cloud configured you will be presented with the opportunity to configure one.

The resulting cluster consists of one kubernetes-master, two kubernetes nodes on different hosts. The etcd and flannel parts are there so the containers on different hosts can communicate with each other.

To get access to the controller node use juju ssh kubernetes-master/0 or the minion nodes with juju ssh kubernetes/0 commands. You will find the kubectl is already installed on the controller node.

When you are done with the cluster running kube-down.sh will destroy the cluster as expected.

cluster/kube-down.sh

Why use Kubernetes with Juju?

Juju provides a way to model deployments in a cloud agnostic language. The same commands can deploy a cluster on the major public clouds Amazon, Google Compute Engine, any OpenStack cloud, Windows Azure and many others. You will need to put your cloud credentials into Juju but that only needs to be done one time. This allows you to deploy a cluster on AWS, juju switch gce and deploy the same cluster on the GCE public cloud using the same kube-up.sh command. Juju reduces the cost of experimentation on other clouds and lets you focus on the Kubernetes development.

Help us improve!

There is a small team working on the Kubernetes story @whitmo, @chuckbutler, and @mbruzek. We are always trying to improve and make something useful for the community. If you find a bug in the code create an issue and reference one or all of us in the issue and we will have a look. If you have any feedback or a use case that we can help with please let us know. You can reach us on IRC in #system-zoo on irc.freenode.net.

Related posts


Gabriel Aguiar Noury
21 November 2024

EdgeIQ and Ubuntu Core; bringing security and scalability to device management 

Internet of Things Article

Today, EdgeIQ and Canonical announced the release of the EdgeIQ Coda snap and official support of Ubuntu Core on the EdgeIQ Symphony platform. EdgeIQ Symphony helps you simplify and scale workflows for device fleet operations, data consumption and delivery, and application orchestration. Distributing EdgeIQ Coda as a snap brings the power ...


Ishani Ghoshal
21 November 2024

Ubuntu 20.04 LTS end of life: standard support is coming to an end. Here’s how to prepare. 

Ubuntu Article

In 2025, Ubuntu 20.04 LTS (Focal Fossa) will reach the end of its standard five-year support window. It’s time to start thinking about your options for upgrading. What is an Ubuntu long-term support (LTS) release?  Ubuntu long-term support releases (LTS) are released every 2 years by Canonical. Canonical provides patching and maintenance ...


Felipe Vanni
20 November 2024

Join Canonical in London at Dell Technologies Forum

AI Storage

Canonical is excited to be partnering with Dell Technologies at the upcoming Dell Technologies Forum – London, taking place on 26th November. This prestigious event brings together industry leaders and technology enthusiasts to explore the latest advancements and solutions shaping the digital landscape. Register to Dell Technologies Forum ...