Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Kubernetes on Azure

You're reading from  Hands-On Kubernetes on Azure

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789536102
Pages 258 pages
Edition 1st Edition
Languages
Authors (2):
Shivakumar Gopalakrishnan Shivakumar Gopalakrishnan
Profile icon Shivakumar Gopalakrishnan
Gunther Lenz Gunther Lenz
Profile icon Gunther Lenz
View More author details

Table of Contents (16) Chapters

Preface 1. Section 1: The Basics
2. Introduction to Docker and Kubernetes 3. Kubernetes on Azure (AKS) 4. Section 2: Deploying on AKS
5. Application Deployment on AKS 6. Scaling Your Application to Thousands of Deployments 7. Single Sign-On with Azure AD 8. Monitoring the AKS Cluster and the Application 9. Operation and Maintenance of AKS Applications 10. Section 3: Leveraging Advanced Azure PaaS Services in Combination with AKS
11. Connecting an App to an Azure Database - Authorization 12. Connecting to Other Azure Services (Event Hub) 13. Securing AKS Network Connections 14. Serverless Functions 15. Other Books You May Enjoy

Connecting to Other Azure Services (Event Hub)

Event-based integration is a key pattern for implementing microservices. In this chapter, you will learn how to how to implement microservices on AKS, including how to use Event Hub for loosely coupled integration between the applications. The securing of the communications between microservices will also be introduced to the reader. Microservices, when implemented with the correct organization/support in place, help businesses develop a growth mindset in their teams. DevOps maturity is crucial in making the digital transformation of companies a reality. You, as a developer and/or an engineer responsible for site reliability, will learn how to deploy them, and also how to leverage Azure Event Hub to store events. As you will learn in this chapter, events-based integration is one of the key differentiators between monolithic and microservice...

Technical requirements

You will need to use a modern browser, such as Firefox, Chrome, or Edge.

Introducing to microservices

Microservices are an architectural pattern for organizing your application according to business domains. For more information on microservices, please see https://martinfowler.com/articles/microservices.html. Classic examples that are usually provided for microservices are how customer, movies, and recommendation services are implemented. Customer service simply deals with customer details, and has no information about movies. The movies service deals with movie details and nothing more. The recommendation engine service deals with recommendations only, and, given a movie title, will return the movie that are closely related.

One of the main selling points of microservices is strengthen independence. Services are designed to be small enough (hence the name micro) to handle the needs of a business domain. As they are small, they can be made self-contained...

Deploying a set of microservices

We will be deploying a set of microservices called a social network. The service is composed of two main service, users and friends. The users service stores all the users in its own data store. The friends service stores the user's friends. The events of adding a user/adding a friend are sent to a recommendation service backed by a graph database that is then used to query relationships between users. You can query the graph database with questions, such as give me the common friends of user X and user Y.

In the following section, you will do the following:

  • Use Helm to deploy a sample microservice-based application
  • Test the service by sending events and watch objects being created and updated

Deploying Helm

...

Using Azure Event Hubs

Running Kafka locally is OK for demo purposes, but not suitable for production use. The same reasons why you wouldn't want to run your own database server are why you would avoid running and maintaining your own Kafka instance. Azure Event Hub has added support for the Kafka protocol, so with minor modifications, we can update our application from using local Kafka instance to the scalable Azure Event Hub instance.

In the following sections, we will do the following:

  • Create the Azure Event Hub via the portal and gather the required details to connect our microservice-based application.
  • Modify the Helm chart to use the newly created Azure Event Hub.

Creating the Azure Event Hub

Perform the following...

Summary

We started this chapter by covering microservices, their benefits and their trade-offs. Following this, we went on to deploy a set of microservices called social network, where we used Helm to deploy a sample microservice-based application. We were able to test the service by sending events and watching objects being created and updated. Finally, we covered the storing of events in Azure Event Hub using Kafka support, and we were able to gather the required details to connect our microservice-based application and modify the Helm chart. The next chapter will cover cluster and port security using secret objects provided by Kubernetes.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Hands-On Kubernetes on Azure
Published in: Mar 2019 Publisher: Packt ISBN-13: 9781789536102
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}