Follow these steps:
- To create an external disk, we'll use the following command:
$ gcloud compute disks create --size 1GB mongo-disk \--zone us-east1-c
- We'll first create the MongoDB deployment because the application expects the database's presence. A deployment object creates the desired number of pods indicated by our replica count. Notice the label given to the pods that are created. The Kubernetes system manages the pods, the deployment, and their linking to their corresponding services via label selectors. Navigate to /Chapter16/mysite-gke/db-deployment.yml:
apiVersion: apps/v1beta1 kind: Deployment metadata: name: mongo-deployment spec: replicas: 1 template: metadata: ...