Reader small image

You're reading from  Hands-On Kubernetes on Azure

Product typeBook
Published inMar 2019
PublisherPackt
ISBN-139781789536102
Edition1st Edition
Right arrow
Authors (2):
Shivakumar Gopalakrishnan
Shivakumar Gopalakrishnan
author image
Shivakumar Gopalakrishnan

Shivakumar Gopalakrishnan is DevOps architect at Varian Medical Systems. He has introduced Docker, Kubernetes, and other cloud-native tools to Varian product development to enable "Everything as Code". He has years of software development experience in a wide variety of fields, including networking, storage, medical imaging, and currently, DevOps. He has worked to develop scalable storage appliances specifically tuned for medical imaging needs and has helped architect cloud-native solutions for delivering modular AngularJS applications backed by microservices. He has spoken at multiple events on incorporating AI and machine learning in DevOps to enable a culture of learning in large enterprises. He has helped teams in highly regulated large medical enterprises adopt modern agile/DevOps methodologies, including the "You build it, you run it" model. He has defined and leads the implementation of a DevOps roadmap that transforms traditional teams to teams that seamlessly adopt security- and quality-first approaches using CI/CD tools. He holds a bachelor of engineering degree from College of Engineering, Guindy, and a Master of Science degree from University of Maryland, College Park.
Read more about Shivakumar Gopalakrishnan

Gunther Lenz
Gunther Lenz
author image
Gunther Lenz

Gunther Lenz is senior director of the technology office at Varian. He is an innovative software R&D leader, architect, MBA, published author, public speaker, and strategic technology visionary with more than 20 years of experience. He has a proven track record of successfully leading large, innovative, and transformational software development and DevOps teams of more than 50 people, with a focus on continuous improvement. He has defined and lead distributed teams throughout the entire software product lifecycle by leveraging groundbreaking processes, tools, and technologies such as the cloud, DevOps, lean/agile, microservices architecture, digital transformation, software platforms, AI, and distributed machine learning. He was awarded Microsoft Most Valuable Professional for Software Architecture (2005-2008). Gunther has published two books, .NET – A Complete Development Cycle and Practical Software Factories in .NET.
Read more about Gunther Lenz

View More author details
Right arrow

Application Deployment on AKS

In this chapter, we will look at the details of deploying an application on the Azure Kubernetes Service (AKS). An application consists of multiple parts, and we will build an application one step at a time, while explaining the conceptual model behind it. You will be able to easily adapt the steps in this chapter to deploy any other application on AKS. The sample guestbook application will be deployed on AKS. The reader will understand the usefulness of various Kubernetes concepts, such as Pods, Replication Controllers (RCs), services, ConfigMaps, Namespaces, and Deployments. We will introduce deployment helpers, such as Helm, to streamline the deployment process.

The following topics will be covered in this chapter:

  • Deploying the sample guestbook application
  • Full deployment of the sample guestbook application
  • The helm way of installing complex...

Technical requirements

You'll need a modern browser, such as Chrome, Firefox, Safari, or Edge.

Deploying the sample guestbook application

In this chapter, we will deploy the classic guestbook sample Kubernetes application. We will be mostly following the steps from https://Kubernetes.io/docs/tutorials/stateless-application/guestbook/ with some modifications. We employ these modifications to do the following:

  • Make the solution more AKS friendly
  • Show additional concepts, such as ConfigMaps, that are not present in the original sample

As mentioned in the Kubernetes documentation, you will be deploying a simple, multi-tier web application. You know it is a good sign for a platform when the documentation says it is a simple application that has master/slave backends and a scalable fronted. The guest book solution is also categorized as a stateless application because the frontend doesn't store any state. It is stateful for the single instance of Redis master, which stores...

Fully deploying of the sample guestbook application

After taking a detour to get our feet wet on dynamically configuring applications using ConfigMap, we will return to our regularly-scheduled program by deploying the rest of the guestbook application. You will see the concepts of Deployment, Replica Sets, and Pods repeated again for the backends and frontends. We will introduce another key concept called Service. You might have also noticed the power of protocols and Docker images. Even though we switched to a different image for redis-master, we have an expectation that the rest of the implementation should go through without any hitches.

Exposing the Redis master service

With plain Docker, the exposed port is constrained...

The helm way of installing complex applications

As you went along the previous sections, you might have thought, This is pretty repetitive and boring. I wonder if there is a way to package everything and run it in one shot. That is a valid question, and a need when deploying complex applications in production. Helm charts is becoming the de-facto standard for packaging applications.

We are going to up the game by installing a complex WordPress site complete with persistence storage. We are going to do so with just one command (not counting the helm init command).

The helm init command

On your cloud shell, type the following:

helm init

After a couple of minutes, helm should be ready.

...

Summary

This chapter was the big one. We went from a simple Docker container mapped to a Pod, to Pods running as ReplicaSet, to ReplicaSets under Deployment, to StatefulSets managing Persistent Volume Claims (PVCs). We went from launching using raw Kubernetes yaml files to installing complex applications using Helm charts.

In the next chapter, you will learn how to perform cool tricks, such as scaling your application, and what to do when things go wrong. The power of the Kubernetes declarative engine, which lets you specify the desired state and let the machine figure out how to achieve it, will be realized. Without having advanced Network certification or knowledge, you will be able to diagnose common network errors while troubleshooting Kubernetes applications.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Kubernetes on Azure
Published in: Mar 2019Publisher: PacktISBN-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.
undefined
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

Authors (2)

author image
Shivakumar Gopalakrishnan

Shivakumar Gopalakrishnan is DevOps architect at Varian Medical Systems. He has introduced Docker, Kubernetes, and other cloud-native tools to Varian product development to enable "Everything as Code". He has years of software development experience in a wide variety of fields, including networking, storage, medical imaging, and currently, DevOps. He has worked to develop scalable storage appliances specifically tuned for medical imaging needs and has helped architect cloud-native solutions for delivering modular AngularJS applications backed by microservices. He has spoken at multiple events on incorporating AI and machine learning in DevOps to enable a culture of learning in large enterprises. He has helped teams in highly regulated large medical enterprises adopt modern agile/DevOps methodologies, including the "You build it, you run it" model. He has defined and leads the implementation of a DevOps roadmap that transforms traditional teams to teams that seamlessly adopt security- and quality-first approaches using CI/CD tools. He holds a bachelor of engineering degree from College of Engineering, Guindy, and a Master of Science degree from University of Maryland, College Park.
Read more about Shivakumar Gopalakrishnan

author image
Gunther Lenz

Gunther Lenz is senior director of the technology office at Varian. He is an innovative software R&D leader, architect, MBA, published author, public speaker, and strategic technology visionary with more than 20 years of experience. He has a proven track record of successfully leading large, innovative, and transformational software development and DevOps teams of more than 50 people, with a focus on continuous improvement. He has defined and lead distributed teams throughout the entire software product lifecycle by leveraging groundbreaking processes, tools, and technologies such as the cloud, DevOps, lean/agile, microservices architecture, digital transformation, software platforms, AI, and distributed machine learning. He was awarded Microsoft Most Valuable Professional for Software Architecture (2005-2008). Gunther has published two books, .NET – A Complete Development Cycle and Practical Software Factories in .NET.
Read more about Gunther Lenz