Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Cloud Native with Kubernetes
Cloud Native with Kubernetes

Cloud Native with Kubernetes: Deploy, configure, and run modern cloud native applications on Kubernetes

eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Cloud Native with Kubernetes

Chapter 1: Communicating with Kubernetes

This chapter contains an explanation of container orchestration, including its benefits, use cases, and popular implementations. We'll also review Kubernetes briefly, including a layout of the architectural components, and a primer on authorization, authentication, and general communication with Kubernetes. By the end of this chapter, you'll know how to authenticate and communicate with the Kubernetes API.

In this chapter, we will cover the following topics:

  • A container orchestration primer
  • Kubernetes' architecture
  • Authentication and authorization on Kubernetes
  • Using kubectl and YAML files

Technical requirements

In order to run the commands detailed in this chapter, you will need a computer running Linux, macOS, or Windows. This chapter will teach you how to install the kubectl command-line tool that you will use in all later chapters.

The code used in this chapter can be found in the book's GitHub repository at the following link:

https://github.com/PacktPublishing/Cloud-Native-with-Kubernetes/tree/master/Chapter1

Introducing container orchestration

We cannot talk about Kubernetes without an introduction of its purpose. Kubernetes is a container orchestration framework, so let's review what that means in the context of this book.

What is container orchestration?

Container orchestration is a popular pattern for running modern applications both in the cloud and the data center. By using containers – preconfigured application units with bundled dependencies – as a base, developers can run many instances of an application in parallel.

Benefits of container orchestration

There are quite a few benefits that container orchestration offers, but we will highlight the main ones. First, it allows developers to easily build high-availability applications. By having multiple instances of an application running, a container orchestration system can be configured in a way that means it will automatically replace any failed instances of the application with new ones.

This...

Kubernetes' architecture

Kubernetes is an orchestration tool that can run on cloud VMs, on VMs running in your data center, or on bare metal servers. In general, Kubernetes runs on a set of nodes, each of which can each be a VM or a physical machine.

Kubernetes node types

Kubernetes nodes can be many different things – from a VM, to a bare metal host, to a Raspberry Pi. Kubernetes nodes are split into two distinct categories: first, the master nodes, which run the Kubernetes control plane applications; second, the worker nodes, which run the applications that you deploy onto Kubernetes.

In general, for high availability, a production deployment of Kubernetes should have a minimum of three master nodes and three worker nodes, though most large deployments have many more workers than masters.

The Kubernetes control plane

The Kubernetes control plane is a suite of applications and services that run on the master nodes. There are several highly specialized services...

Authentication and authorization on Kubernetes

Namespaces are an extremely important concept in Kubernetes, and since they can affect API access as well as authorization, we'll cover them now.

Namespaces

A namespace in Kubernetes is a construct that allows you to group Kubernetes resources in your cluster. They are a method of separation with many possible uses. For instance, you could have a namespace in your cluster for each environment – dev, staging, and production.

By default, Kubernetes will create the default namespace, the kube-system namespace, and the kube-public namespace. Resources created without a specified namespace will be created in the default namespace. kube-system contains the cluster services such as etcd, the scheduler, and any resource created by Kubernetes itself and not users. kube-public is readable by all users by default and can be used for public resources.

Users

There are two types of users in Kubernetes – regular users...

Using kubectl and YAML

kubectl is the officially supported command-line tool for accessing the Kubernetes API. It can be installed on Linux, macOS, or Windows.

Setting up kubectl and kubeconfig

To install the newest release of kubectl, you can use the installation instructions at https://kubernetes.io/docs/tasks/tools/install-kubectl/.

Once kubectl is installed, it needs to be set up to authenticate with one or more clusters. This is done using the kubeconfig file, which looks like this:

Example-kubeconfig

apiVersion: v1
kind: Config
preferences: {}
clusters:
- cluster:
    certificate-authority: fake-ca-file
    server: https://1.2.3.4
  name: development
users:
- name: alex
  user:
    password: mypass
    username: alex
contexts:
- context:
    cluster: development
    namespace: frontend
    user: developer...

Summary

In this chapter, we learned the background behind container orchestration, an architectural overview of a Kubernetes cluster, how a cluster authenticates and authorizes API calls, and how to communicate with the API via imperative and declarative patterns using kubectl, the officially supported command-line tool for Kubernetes.

In the next chapter, we'll learn several ways to get started with a test cluster, and master harnessing the kubectl commands you've learned so far.

Questions

  1. What is container orchestration?
  2. What are the constituent parts of the Kubernetes control plane, and what do they do?
  3. How would you start the Kubernetes API server in ABAC authorization mode?
  4. Why is it important to have more than one master node for a production Kubernetes cluster?
  5. What is the difference between kubectl apply and kubectl create?
  6. How would you switch between contexts using kubectl?
  7. What are the downsides of creating a Kubernetes resource declaratively and then editing it imperatively?

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Build and run efficient cloud-native applications on Kubernetes using industry best practices
  • Operate Kubernetes in a production environment, troubleshoot clusters, and address security concerns
  • Deploy cutting-edge Kubernetes patterns such as service mesh and serverless to your cluster

Description

Kubernetes is a modern cloud native container orchestration tool and one of the most popular open source projects worldwide. In addition to the technology being powerful and highly flexible, Kubernetes engineers are in high demand across the industry. This book is a comprehensive guide to deploying, securing, and operating modern cloud native applications on Kubernetes. From the fundamentals to Kubernetes best practices, the book covers essential aspects of configuring applications. You’ll even explore real-world techniques for running clusters in production, tips for setting up observability for cluster resources, and valuable troubleshooting techniques. Finally, you’ll learn how to extend and customize Kubernetes, as well as gaining tips for deploying service meshes, serverless tooling, and more on your cluster. By the end of this Kubernetes book, you’ll be equipped with the tools you need to confidently run and extend modern applications on Kubernetes.

Who is this book for?

This book is for developers, architects, DevOps engineers, or anyone interested in developing and managing cloud-native applications. Those already running cloud applications and looking for a better way to manage their platform or others interested in a career change given the recent popularity of Kubernetes will also find this book helpful. Some familiarity with cloud computing, containers and DevOps is required, but no prior knowledge of building production applications using Kubernetes is needed to get started with this book.

What you will learn

  • Set up Kubernetes and configure its authentication
  • Deploy your applications to Kubernetes
  • Configure and provide storage to Kubernetes applications
  • Expose Kubernetes applications outside the cluster
  • Control where and how applications are run on Kubernetes
  • Set up observability for Kubernetes
  • Build a continuous integration and continuous deployment (CI/CD) pipeline for Kubernetes
  • Extend Kubernetes with service meshes, serverless, and more

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 04, 2021
Length: 446 pages
Edition : 1st
Language : English
ISBN-13 : 9781838820008
Vendor :
Google
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 04, 2021
Length: 446 pages
Edition : 1st
Language : English
ISBN-13 : 9781838820008
Vendor :
Google
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 122.97
Mastering Kubernetes
€59.99
Kubernetes in Production Best Practices
€29.99
Cloud Native with Kubernetes
€32.99
Total 122.97 Stars icon
Banner background image

Table of Contents

21 Chapters
Section 1: Setting Up Kubernetes Chevron down icon Chevron up icon
Chapter 1: Communicating with Kubernetes Chevron down icon Chevron up icon
Chapter 2: Setting Up Your Kubernetes Cluster Chevron down icon Chevron up icon
Chapter 3: Running Application Containers on Kubernetes Chevron down icon Chevron up icon
Section 2: Configuring and Deploying Applications on Kubernetes Chevron down icon Chevron up icon
Chapter 4: Scaling and Deploying Your Application Chevron down icon Chevron up icon
Chapter 5: Services and Ingress – Communicating with the Outside World Chevron down icon Chevron up icon
Chapter 6: Kubernetes Application Configuration Chevron down icon Chevron up icon
Chapter 7: Storage on Kubernetes Chevron down icon Chevron up icon
Chapter 8: Pod Placement Controls Chevron down icon Chevron up icon
Section 3: Running Kubernetes in Production Chevron down icon Chevron up icon
Chapter 9: Observability on Kubernetes Chevron down icon Chevron up icon
Chapter 10: Troubleshooting Kubernetes Chevron down icon Chevron up icon
Chapter 11: Template Code Generation and CI/CD on Kubernetes Chevron down icon Chevron up icon
Chapter 12: Kubernetes Security and Compliance Chevron down icon Chevron up icon
Section 4: Extending Kubernetes Chevron down icon Chevron up icon
Chapter 13: Extending Kubernetes with CRDs Chevron down icon Chevron up icon
Chapter 14: Service Meshes and Serverless Chevron down icon Chevron up icon
Chapter 15: Stateful Workloads on Kubernetes Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(7 Ratings)
5 star 85.7%
4 star 14.3%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




alexsm86 Aug 02, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Interesting and informative. Definitely recommend.
Amazon Verified review Amazon
samy kamkar Mar 24, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book. Got me started from level zero on Kubernetes, and even digs into details that are particularly interesting to me like runtime security.
Amazon Verified review Amazon
D Mar 31, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book goes into everything from Kubernetes fundamentals to best practices and modern patterns in production. A very in-depth resource for anyone that is interested in using Kubernetes!
Amazon Verified review Amazon
Dustin Apr 13, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I wish this book were around a few years ago when I was first using Kubernetes. The first part of this book organizes the firehose of information when first learning Kubernetes while providing invaluable debugging examples of kubelet, unhealthy nodes, container errors, and service communication failures. The second part of the book covers helpful considerations for devs deploying their applications in a Kubernetes cluster. The last part then dives into Istio. This book has something to offer for anyone regardless of their Kubernetes experience. The first part will be my go-to recommendation for folks new to Kubernetes.
Amazon Verified review Amazon
Walter Lee Jan 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Summary: A very “COMPLETE and WIDE” k8s book with many examples/tutorials on many Kubernetes “Parts/Add-ons”, e.g. Rook/Ceph, Falco, Jaeger, EFK, Prometheus, Grafana, Helm, Kustomize, AWS Codebuild, FluxCD, CRDs/Operators for cloud-controller-manager, cluster-autoscaler, Sidecar proxies (Nginx and Envoy), Istio, Serverless (Knative and OpenFaaS), Stateful workloads (Minio, Cockroach DB, RabbitMQ). It is very wide in terms of coverage. However, do not expect very DEEP in some of the topics due to pages limitations. It will be a good starting point to learn all the basics and know many of the important parts/add-ons commonly used in a production k8s env.There are 4 sections. The first two are basics to me (CKA already), but will be good for any beginners. I like more in section 3 and 4 with their examples/detail steps. I read more seriously starting from chap 8 till the end.I like the following topics:1/ ch 8 – node/pod affinity and anti-affinity2/ ch 9 – observability on k8s: Metrics/Logging/Tracing/Alerts. You will learn how to install/use Prometheus, Grafana, Jaeger (and its CRD operator) and alerts manager.3/ ch 10 – troubleshooting k8s: good discussions/case studies, e.g. placement failures, service not responding, etc.…4/ ch 11 – CI/CD with Helm/Kustomize, in and out of cluster CI/CD, e.g. AWS Codebuild, FluxCD.5/ ch 12 – k8s security and compliance: review CVEs, admission controllers, PSP, Network Policies (my favorite), Falco install/config/rules/use cases.6/ ch 13 – extend k8s with CRDs: k8s operators, cloud-controller-manager, cluster-autoscaler (this is also called Vertical Auto Scaler), intro to CNCF.7/ ch 14 – sidecar proxies, service meshes, serverless: Nginx/Envoy (important proxies!), Istio, Knative and OpenFaaS.8/ ch 15 – Stateful workloads on k8s: Minio, Cockroach DB, RabbitMQ. It will help you understand the important points running stateful workloads and then you can apply the same concepts in others, e.g. Couchbase DB, MySQL, etc. in your env.Suggestions:1/ can add more graphs all over the book, e.g. Istio components, e.g. Pilot, Citadel, Gallery, etc. See Istio official page for Architecture diagrams. Similar suggestions for EFK, Jaeger, etc. so new readers can understand the set up better.2/ p.244 has a bug in the yaml file and I filed a PR#1 already in their code github.3/ p.191 has a typo - should be "millicpu"4/ p.203 missing a "-c" in the command k logs <pod name> -c <container name>5/ p.267 has a typo - should be "ls" instead of "Ls"
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.