There are many tutorials and guides available for getting started with Kubernetes. Typically, these detail the key concepts and outline the steps for deploying your first Kubernetes cluster. However, when organizations want to roll out Kubernetes at scale or in production, the deployment is much more complex and there are new requirements around both the initial setup and configuration and the ongoing management – often referred to as “Day 1 and Day 2 operations.”
Docker Enterprise 3.0, the leading container platform, includes Docker Kubernetes Service (DKS), a seamless Kubernetes experience from developers’ desktops to production servers. DKS makes it simple for enterprises to secure and manage their Kubernetes environment by abstracting away many of these complexities. With Docker Enterprise, operations teams can easily deploy, scale, backup and restore, and upgrade a certified Kubernetes environment using a set of simple CLI commands. In this blog post, we’ll highlight some of these new features.
A Declarative Kubernetes Cluster Model
A real Kubernetes cluster deployment typically involves design and planning to ensure that the environment integrates with an organization’s preferred infrastructure, storage and networking stacks. The design process usually requires cross-functional expertise to determine the instance size, disk space, load balancer design, and many other factors that are custom to your particular needs.
To help simplify the deployment, Docker has created a CLI plugin for simplified Docker cluster operations. It’s based on Docker Certified Infrastructure that was launched last year for AWS, Azure, and vSphere environments. It’s now an automated tool using a declarative model so you can “source control” your cluster configurations with a cluster YAML file with the following structure:
variable: <name>: provider: <name>: <parameter>: cluster: <component>: <parameter>: resource: <type>: <name>: <parameter>:
The file defines your configuration settings, including the instance types, Docker Enterprise versions that reflect different Kubernetes versions, the OS used, networking setup and more. Once defined, this file can be used with the new ‘docker cluster’ CLI commands:
Create & Inspect
Once a cluster YAML is defined, it can be used to create and clone environments with the same desired configurations. This makes it simple to set up identical staging and production environments and to move between them using the new context switching features of Docker Enterprise. With Docker Enterprise, the Kubernetes managers and workers are automatically installed with all of the necessary components. We also include the built-in “batteries included” CNI plugin with Calico:
You can also inspect the cluster you are looking at to view the settings from which it is deployed.
Simple Day 2 Operations
One of the more challenging facets of managing your own Kubernetes infrastructure is managing upgrades and backups. In a manual deployment, each of the components would need to be upgraded on its own, and you’ll need scripts to help automate this process. With Docker Enterprise, these tasks are incredibly simple.
Changes to your environment are straightforward with ‘docker cluster update’. Using the declarative model, you can now change, for example, a version number in your configuration file. The CLI plugin identifies the change and implements a safe upgrade of that particular component. This helps with upgrading the engine, Universal Control Plane, and Docker Trusted Registry using a single command by utilizing a simple configuration file.
The `docker cluster`command also takes advantage of a new Docker Enterprise 3.0 enhancement that supports upgrading the cluster without any downtime. It uses a blue-green deployment model for worker nodes, so instead of upgrading worker node engines in-place, it joins a new set of worker nodes to the cluster with the latest engine. You can then migrate an application from older “green” nodes to the newer “blue” nodes that have joined the cluster without any downtime.
Backup & Restore
The ‘docker cluster backup’ command stores your cluster environment as a single tarball file that can be stored in your desired location. You can optionally encrypt that backup, then easily restore a cluster from it.
To learn more about Docker Kubernetes Service in Docker Enterprise 3.0, watch the DockerCon talk: Lifecycle Management of Docker Clusters.