Chapter 2. First steps with Docker and Kubernetes
This chapter covers
- Creating, running, and sharing a container image with Docker
- Running a single-node Kubernetes cluster locally
- Setting up a Kubernetes cluster on Google Kubernetes Engine
- Setting up and using the kubectl command-line client
- Deploying an app on Kubernetes and scaling it horizontally
Before you start learning about Kubernetes concepts in detail, let’s see how to create a simple application, package it into a container image, and run it in a managed Kubernetes cluster (in Google Kubernetes Engine) or in a local single-node cluster. This should give you a slightly better overview of the whole Kubernetes system and will make it easier to follow the next few chapters, where we’ll go over the basic building blocks and concepts in Kubernetes.
As you’ve already learned in the previous chapter, running applications in Kubernetes requires them to be packaged into container images. We’ll do a basic introduction to using Docker in case you haven’t used it yet. In the next few sections you’ll
- Install Docker and run your first “Hello world” container
- Create a trivial Node.js app that you’ll later deploy in Kubernetes
- Package the app into a container image so you can then run it as an isolated container
- Run a container based on the image
- Push the image to Docker Hub so that anyone anywhere can run it