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

Add a deployment steps file

parent ceb0f5c7
No related branches found
No related tags found
1 merge request!32Google Cloud Deployment
## Mongo Volumes
### Storage Class
Here we create a storage class that defines what properties the **default-mongo** class should have.
`kubectl apply -f gcloud/mongo-pv/mongo-storage-class.yaml`
You can check the current storage classes:
`kubectl get storageclasses`
### Creating Mongo Persistent Volumes
We need a storage system for the Mongo instances. For this, we use (Persistent Volumes)[https://kubernetes.io/docs/concepts/storage/persistent-volumes/]
- When we make a claim, Kubernetes automatically makes the Persistent Volume for us based on the Storage Class defined.
#### User Mongo Volume
`kubectl apply -f gcloud/user-mongo/user-mongo-pvc.yaml`
### Checking Result
You can check the current Persistent Volumes in our cluster:
`kubectl get pv`
As well as the current Persistent Volume Claims in our cluster:
`kubectl get pvc`
<br />
## Deploying Mongo Services
Now that we have the storage for our Mongo instances, we can deploy the services.
- The deployment defines that the instance should use our created volumes.
#### User Mongo Service
`kubectl apply -f gcloud/user-mongo/user-mongo-deployment.yaml`
<br />
## Deploying Main Services
For our main services, we first define our Horizontal Autoscaler, then we deploy our service.
### Frontend
`kubectl apply -f gcloud/frontend-service/frontend-service-autoscaler.yaml`
`kubectl apply -f gcloud/frontend-service/frontend-service-deployment.yaml`
### User Backend
`kubectl apply -f gcloud/user-service/user-service-autoscaler.yaml`
`kubectl apply -f gcloud/user-service/user-service-deployment.yaml`
<br />
## NGINX Service
Thanks to our smort teammate Matt, we have a NGINX service. We use this service as a reverse proxy. What this means is that none of our services are exposed. Instead, we expose our NGINX service, and it manages our routes to services!
### ConfigMap
In Kubernetes, a ConfigMap is a key-value store that stores configuration data for your application. The ConfigMap can then be mounted as a volume inside a container, allowing the configuration data to be read by the application running inside the container.
So we define the config in the (nginx.conf)[gcloud\nginx-service\nginx.conf] file and deploy it:
`kubectl create configmap nginx-conf --from-file=gcloud/nginx-service/nginx.conf`
### Deploying NGINX Service
Before deploying the NGINX service, we define our Horizontal Autoscaler for it:
`kubectl apply -f gcloud/nginx-service/nginx-service-autoscaler.yaml`
We can now deploy NGINX as a service:
`kubectl apply -f gcloud/nginx-service/nginx-service-deployment.yaml`
What is different about this service, is that it is on a public endpoint!
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