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 a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781838823078
Vendor :
Google
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jan 04, 2021
Length: 446 pages
Edition : 1st
Language : English
ISBN-13 : 9781838823078
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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.