Here are some sample answers to the questions presented in this chapter:
- Assuming we have a Docker image in a registry for the two application services, the web API and Mongo DB, we then need to do the following:
- Define a deployment for Mongo DB using a StatefulSet; let's call this deployment db-deployment. The StatefulSet should have one replica (replicating Mongo DB is a bit more involved and is outside the scope of this book).
- Define a Kubernetes service called db of the ClusterIP type for db-deployment.
- Define a deployment for the web API; let's call it web-deployment. Let's scale this service to three instances.
- Define a Kubernetes service called api of the NodePort type for web-deployment.
- If we use secrets, then define those secrets directly in the cluster using kubectl...