To protect TCP connection-based services such as databases, only a legitimate service should be able to connect.
In this section, we will create a new ratings-v2 version and connect it to a MongoDB database service. Our aim is for only the ratings-v2 service to be able to access the MongoDB database:
- Review 19-create-sa-ratings-v2.yaml. Notice the bookinfo-ratings-v2 service account, which we will use to create a ratings-v2 deployment that will use MongoDB:
# Script : 19-create-sa-ratings-v2.yaml apiVersion: v1kind: ServiceAccountmetadata: name: bookinfo-ratings-v2---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: ratings-v2... version: v2 spec: serviceAccountName: bookinfo-ratings-v2 ...