7–9 November 2016: Conference & Tutorials
9–10 November 2016: Training
Amsterdam, The Netherlands

Managing applications with Kubernetes

Brian Ketelsen (Microsoft)
9:00–17:00, Wednesday, 9 November–Thursday, 10 November
D202
Average rating: ****.
(4.00, 1 rating)

All training courses takes place 9:00 - 17:00, Wednesday, 9 November-Thursday, 10 November and are limited in size to maintain a high level of hands-on learning and instructor interaction.

Participants should plan to attend both days of training. Training passes do not include access to tutorials on Wednesday.

What you'll learn

  • Learn how to utilize the Kubernetes API to deploy, manage, and upgrade applications.

Description

Kubernetes is all about applications. Brian Ketelsen walks you through utilizing the Kubernetes API to deploy, manage, and upgrade applications. You’ll use an example application called “app” to complete the labs; app is hosted on GitHub and provides an example 12-factor application.

Docker images used in the tutorial:

  • kelseyhightower/monolith: Monolith includes auth and hello services
  • kelseyhightower/auth: Auth microservice—generates JWT tokens for authenticated users
  • kelseyhightower/hello: Hello microservice—greets authenticated users
  • ngnix: Frontend to the auth and hello services

Useful links

Outline

Day 1

Creating and managing Pods
At the core of Kubernetes is the Pod. Pods represent a logical application and hold a collection of one or more containers and volumes. In this lab, you will learn how to:

  • Write a Pod configuration file
  • Create and inspect Pods
  • Interact with Pods remotely using the kubectl command-line tool
  • Create a Pod named monolith and interact with it using kubectl

Monitoring and health checks
Kubernetes supports monitoring applications in the form of readiness and liveness probes. Health checks can be performed on each container in a Pod. Readiness probes indicate when a Pod is “ready” to serve traffic. Liveness probes indicate a container is “alive.” If a liveness probe fails multiple times, the container will be restarted. Liveness probes that continue to fail will cause a Pod to enter a crash loop. If a readiness check fails, the container will be marked as not ready and will be removed from any load balancers. In this lab, you will deploy a new Pod named healthy-monolith, which is largely based on the monolith Pod with the addition of readiness and liveness probes. You will learn how to:

  • Create Pods with readiness and liveness probes
  • Troubleshoot failing readiness and liveness probes

Managing application configurations and secrets
Many applications require configuration settings and secrets such as TLS certificates to run in a production environment. In this lab you will learn how to:

  • Create secrets to store sensitive application data
  • Create configmaps to store application configuration data
  • Expose secrets and configmaps to Pods at runtime
    You will create a new Pod named secure-monolith based on the healthy-monolith Pod. The secure-monolith Pod secures access to the monolith container using nginx, which will serve as a reverse proxy serving HTTPS.

Day 2

Creating and managing services
Services provide stable endpoints for Pods based on a set of labels. In this lab, you will create the monolith service and “expose” the secure-monolith Pod externally. You will learn how to:

  • Create a service
  • Use label selectors to expose a limited set of Pods externally

Creating and managing deployments
Deployments abstract away the low-level details of managing Pods. Pods are tied to the lifetime of the node they are created on. When the node goes away, so does the Pod. ReplicaSets can be used to ensure one or more replicas of a Pod are always running, even when nodes fail. Deployments sit on top of ReplicaSets and add the ability to define how updates to Pods should be rolled out. In this lab, you will combine everything you have learned about Pods and services to break up the monolith application into smaller services. You will create three deployments, one for each service:

  • frontend
  • auth
  • hello

You will also define internal services for the auth and hello deployments and an external service for the frontend deployment.

Rolling out updates
Kubernetes makes it easy to roll out updates to your applications using the built-in rolling update mechanism. In this lab, you will learn how to:

  • Modify deployments to trigger rolling updates
  • Pause and resume an active rolling update
  • Rollback a deployment to a previous revision
Photo of Brian Ketelsen

Brian Ketelsen

Microsoft

Brian Ketelsen is a cloud developer advocate at Microsoft. An experienced leader of technical teams with a strong focus on data warehouses and distributed computing, Brian has been writing software for various platforms since 1993. He has honed his broad technical skills in a variety of roles ranging from DBA to CIO. A prolific open source enthusiast, he has contributed to some of the largest Go projects, including Docker, Kubernetes, etc, SkyDNS, Kong, Go-Kit, and Goa, and coauthored Go in Action from Manning Press. Brian spends much of his free time fostering the Go community; he co-organizes GopherCon, the yearly conference for Go programmers held each summer in Denver and helps organize the Tampa Go meetup. Brian holds a bachelor’s degree in computer science.