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

Define and deploy the feed mongo service

parent 528e5ddd
No related branches found
No related tags found
1 merge request!32Google Cloud Deployment
......@@ -24,6 +24,10 @@ We need a storage system for the Mongo instances. For this, we use (Persistent V
`kubectl apply -f gcloud/friend-mongo/friend-mongo-pvc.yaml`
#### Feed Mongo Volume
`kubectl apply -f gcloud/feed-mongo/feed-mongo-pvc.yaml`
### Checking Result
You can check the current Persistent Volumes in our cluster:
......@@ -48,6 +52,10 @@ Now that we have the storage for our Mongo instances, we can deploy the services
`kubectl apply -f gcloud/friend-mongo/friend-mongo-deployment.yaml`
#### Feed Mongo Service
`kubectl apply -f gcloud/feed-mongo/feed-mongo-deployment.yaml`
<br />
## Deploying Main Services
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: feed-mongo-deployment
spec:
selector:
matchLabels:
app: feed-mongo
replicas: 1
template:
metadata:
labels:
app: feed-mongo
spec:
containers:
- name: feed-mongo
image: mongo
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-data
mountPath: /data/db
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: feed-mongo-volume
---
apiVersion: v1
kind: Service
metadata:
name: feed-mongo-service
spec:
selector:
app: feed-mongo
ports:
- name: mongo-port
protocol: TCP
port: 27017
targetPort: 27017
type: ClusterIP
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: feed-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