
Getting Started with Containerization
Reduce the operational burden on your system by automating and managing your containers
- 736 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Getting Started with Containerization
Reduce the operational burden on your system by automating and managing your containers
About this book
Choose the smarter way to learn about containerizing your applications and running them in production.
Key Features
- Deploy and manage highly scalable, containerized applications with Kubernetes
- Build high-availability Kubernetes clusters
- Secure your applications via encapsulation, networks, and secrets
Book Description
Kubernetes is an open source orchestration platform for managing containers in a cluster environment. This Learning Path introduces you to the world of containerization, in addition to providing you with an overview of Docker fundamentals. As you progress, you will be able to understand how Kubernetes works with containers. Starting with creating Kubernetes clusters and running applications with proper authentication and authorization, you'll learn how to create high-availability Kubernetes clusters on Amazon Web Services (AWS), and also learn how to use kubeconfig to manage different clusters. Whether it is learning about Docker containers and Docker Compose, or building a continuous delivery pipeline for your application, this Learning Path will equip you with all the right tools and techniques to get started with containerization.
By the end of this Learning Path, you will have gained hands-on experience of working with Docker containers and orchestrators, including SwarmKit and Kubernetes.
This Learning Path includes content from the following Packt products:
- Kubernetes Cookbook - Second Edition by Hideto Saito, Hui-Chuan Chloe Lee, and Ke-Jou Carol Hsu
- Learn Docker - Fundamentals of Docker 18.x by Gabriel N. Schenker
What you will learn
- Build your own container cluster
- Run a highly distributed application with Docker Swarm or Kubernetes
- Update or rollback a distributed application with zero downtime
- Containerize your traditional or microservice-based application
- Build a continuous delivery pipeline for your application
- Track metrics and logs for every container in your cluster
- Implement container orchestration to streamline deploying and managing applications
Who this book is for
This beginner-level Learning Path is designed for system administrators, operations engineers, DevOps engineers, and developers who want to get started with Docker and Kubernetes. Although no prior experience with Docker is required, basic knowledge of Kubernetes and containers will be helpful.
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
Walking through Kubernetes Concepts
- Linking Pods and containers
- Managing Pods with ReplicaSets
- Deployment API
- Working with Services
- Working with Volumes
- Working with Secrets
- Working with names
- Working with Namespaces
- Working with labels and selectors
Introduction
An overview of Kubernetes
$ kubectl version --short
Client Version: v1.10.2
Server Version: v1.10.2
kubectl [command] [TYPE] [NAME] [flags]
- command: Specifies the operation that you want to perform on one or more resources.
- TYPE: Specifies the resource type. Resource types are case-sensitive and you can specify the singular, plural, or abbreviated forms.
- NAME: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed.
- flags: Specifies optional flags.
- Use the run command:
$ kubectl run my-first-nginx --image=nginx "my-first-nginx"
- Use the create -f command with the YAML file:
$ cat nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-first-nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
//specify -f (filename)
$ kubectl create -f nginx.yaml
deployment.apps "my-first-nginx" created
- If you want to see the status of the Deployment, type the kubectl get command as follows:
$ kubectl get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
my-first-nginx 1 1 1 1 4s
- If you also want the support abbreviation, type the following:
$ kubectl get deploy
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
my-first-nginx 1 1 1 1 38s
- If you want to delete these resources, type the kubectl delete command as follows:
$ kubectl delete deploy my-first-nginx
deployment.extensions "my-first-nginx" deleted
- The kubectl command supports many kinds of sub-commands; use the -h option to see the details, for example:
//display whole sub command options
$ kubectl -h
//display sub command "get" options
$ kubectl get -h
//display sub command "run" options
$ kubectl run -h
- Setting up a Kubernetes cluster on macOS using minikube and Set up a Kubernetes cluster on Windows using minikube in Chapter 12, Building Your Own Kubernetes Cluster
- Setting up a Kubernetes cluster on Linux using kubeadm in Chapter 12, Building Your Own Kubernetes Cluster
- Setting up a Kubernetes cluster on Linux using kubespray (Ansible) in Chapter 12, Building Your Own Kubernetes Cluster
Linking Pods and containers
- The process ID (PID) namespace
- The network namespace
- The interprocess communication (IPC) namespace
- The unix time sharing (UTS) namespace
Getting ready
Table of contents
- Title Page
- Copyright
- About Packt
- Contributors
- Preface
- What Are Containers and Why Should I Use Them?
- Setting up a Working Environment
- Working with Containers
- Creating and Managing Container Images
- Data Volumes and System Management
- Distributed Application Architecture
- Single-Host Networking
- Docker Compose
- Orchestrators
- Introduction to Docker Swarm
- Zero Downtime Deployments and Secrets
- Building Your Own Kubernetes Cluster
- Walking through Kubernetes Concepts
- Playing with Containers
- Building High-Availability Clusters
- Building Continuous Delivery Pipelines
- Building Kubernetes on AWS
- Advanced Cluster Administration
- Other Books You May Enjoy