Book Image

Hands-On Kubernetes on Azure - Second Edition

By : Nills Franssens, Shivakumar Gopalakrishnan, Gunther Lenz
Book Image

Hands-On Kubernetes on Azure - Second Edition

By: Nills Franssens, Shivakumar Gopalakrishnan, Gunther Lenz

Overview of this book

From managing versioning efficiently to improving security and portability, technologies such as Kubernetes and Docker have greatly helped cloud deployments and application development. Starting with an introduction to Docker, Kubernetes, and Azure Kubernetes Service (AKS), this book will guide you through deploying an AKS cluster in different ways. You’ll then explore the Azure portal by deploying a sample guestbook application on AKS and installing complex Kubernetes apps using Helm. With the help of real-world examples, you'll also get to grips with scaling your application and cluster. As you advance, you'll understand how to overcome common challenges in AKS and secure your application with HTTPS and Azure AD (Active Directory). Finally, you’ll explore serverless functions such as HTTP triggered Azure functions and queue triggered functions. By the end of this Kubernetes book, you’ll be well-versed with the fundamentals of Azure Kubernetes Service and be able to deploy containerized workloads on Microsoft Azure with minimal management overhead.
Table of Contents (16 chapters)
1
Section 1: The Basics
4
Section 2: Deploying on AKS
10
Section 3: Leveraging advanced Azure PaaS services
15
Index

8. Connecting an app to an Azure database

In previous chapters, we stored the state of our application in our cluster, either on a Redis cluster or on MariaDB. You might remember that both had some issues when it came to high availability. This chapter will take you through the process of connecting to a MySQL database managed by Azure.

We will discuss the benefits of using a hosted database versus running StatefulSets on Kubernetes itself. To create this hosted and managed database, we will make use of Open Service Broker for Azure (OSBA). OSBA is a way to create Azure resources, such as a managed MySQL database, from within a Kubernetes cluster. In this chapter, we will explain more details about the OSBA project and we will set up and configure OSBA on our cluster.

We will then make use of OSBA to create a MySQL database in Azure. We will use this managed database as part of a WordPress application. This will show you how you can connect an application to a managed database...