Skip to content
Snippets Groups Projects
Commit 32289dae authored by Felipe D'Abrantes's avatar Felipe D'Abrantes
Browse files

Define and deploy the comment mongo service

parent 28e25de1
No related branches found
No related tags found
1 merge request!32Google Cloud Deployment
...@@ -28,6 +28,10 @@ We need a storage system for the Mongo instances. For this, we use (Persistent V ...@@ -28,6 +28,10 @@ We need a storage system for the Mongo instances. For this, we use (Persistent V
`kubectl apply -f gcloud/feed-mongo/feed-mongo-pvc.yaml` `kubectl apply -f gcloud/feed-mongo/feed-mongo-pvc.yaml`
#### Comment Mongo Volume
`kubectl apply -f gcloud/comment-mongo/comment-mongo-pvc.yaml`
### Checking Result ### Checking Result
You can check the current Persistent Volumes in our cluster: You can check the current Persistent Volumes in our cluster:
...@@ -56,6 +60,10 @@ Now that we have the storage for our Mongo instances, we can deploy the services ...@@ -56,6 +60,10 @@ Now that we have the storage for our Mongo instances, we can deploy the services
`kubectl apply -f gcloud/feed-mongo/feed-mongo-deployment.yaml` `kubectl apply -f gcloud/feed-mongo/feed-mongo-deployment.yaml`
#### Comment Mongo Service
`kubectl apply -f gcloud/comment-mongo/comment-mongo-deployment.yaml`
<br /> <br />
## Deploying Main Services ## Deploying Main Services
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: comment-mongo-deployment
spec:
selector:
matchLabels:
app: comment-mongo
replicas: 1
template:
metadata:
labels:
app: comment-mongo
spec:
containers:
- name: comment-mongo
image: mongo
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-data
mountPath: /data/db
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: comment-mongo-volume
---
apiVersion: v1
kind: Service
metadata:
name: comment-mongo-service
spec:
selector:
app: comment-mongo
ports:
- name: mongo-port
protocol: TCP
port: 27020
targetPort: 27017
type: ClusterIP
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: comment-mongo-volume
spec:
storageClassName: default-mongo
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment