Book Image

Kubernetes on AWS

By : Ed Robinson
Book Image

Kubernetes on AWS

By: Ed Robinson

Overview of this book

Docker containers promise to radicalize the way developers and operations build, deploy, and manage applications running on the cloud. Kubernetes provides the orchestration tools you need to realize that promise in production. Kubernetes on AWS guides you in deploying a production-ready Kubernetes cluster on the AWS platform. You will then discover how to utilize the power of Kubernetes, which is one of the fastest growing platforms for production-based container orchestration, to manage and update your applications. Kubernetes is becoming the go-to choice for production-grade deployments of cloud-native applications. This book covers Kubernetes from first principles. You will start by learning about Kubernetes' powerful abstractions - Pods and Services - that make managing container deployments easy. This will be followed by a guided tour through setting up a production-ready Kubernetes cluster on AWS, while learning the techniques you need to successfully deploy and manage your own applications. By the end of the book, you will have gained plenty of hands-on experience with Kubernetes on Amazon Web Services. You will also have picked up some tips on deploying and managing applications, keeping your cluster and applications secure, and ensuring that your whole system is reliable and resilient to failure.
Table of Contents (12 chapters)

Running pods directly

Kubernetes doesn't really intend for users to directly submit and launch pods on the cluster. As we discussed previously, pods are designed to be ephemeral, so are not suitable for running workloads where we want to ensure that execution has completed or where we want to ensure that a process remains up and running.

Here, we will start from first principles, launching pods, before moving on to use a controller to help us manage them. Bear in mind that this is a learning exercise; you shouldn't submit pods in this way if you need them to run reliably:

pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: hello-loop
spec:
containers:
- name: loop
image: alpine
command: ["/bin/sh"]
args:
- -c
- while true; do echo "hello world"; sleep 2s; done

This pod launches an infinite loop that prints hello world every 2 seconds....