Chapter 17. Best practices for developing apps
This chapter covers
- Understanding which Kubernetes resources appear in a typical application
- Adding post-start and pre-stop pod lifecycle hooks
- Properly terminating an app without breaking client requests
- Making apps easy to manage in Kubernetes
- Using init containers in a pod
- Developing locally with Minikube
We’ve now covered most of what you need to know to run your apps in Kubernetes. We’ve explored what each individual resource does and how it’s used. Now we’ll see how to combine them in a typical application running on Kubernetes. We’ll also look at how to make an application run smoothly. After all, that’s the whole point of using Kubernetes, isn’t it?
Hopefully, this chapter will help to clear up any misunderstandings and explain things that weren’t explained clearly yet. Along the way, we’ll also introduce a few additional concepts that haven’t been mentioned up to this point.
Let’s start by looking at what an actual application consists of. This will also give you a chance to see if you remember everything you’ve learned so far and look at the big picture. Figure 17.1 shows the Kubernetes components used in a typical application.