Udagram is a images application used to understand microservices architecture and clud development.
You will need to have an AWS account as we will use it to create our infraestructure.
- To create the infraestructure, we are going to use Kubeone and Terraform. Please follow the following guide: https://github.com/kubermatic/kubeone/blob/master/docs/quickstart-aws.md .
-
Create the following environment variables as thery are going to be used thought the project. Also, your AWS credentials must already be set in the
~.aws/credentials
file.export POSTGRESS_USERNAME=yourusername; export POSTGRESS_PASSWORD=yourpassword; export POSTGRESS_DB=postgresdbname; export POSTGRESS_HOST=postgreshost; export AWS_REGION=awsregion; export AWS_PROFILE=default; export AWS_BUCKET=udagramdemo; export JWT_SECRET=helloworld;
-
Create a CREDENTIALS environment variable with the output of running the following command:
cat ~/.aws/credentials | base64
export CREDENTIALS=output from the previous command
-
cd into the
udacity-cr-deployment/k8s
-
Define the kubernetes services:
kubectl apply -f backend-feed-service.yaml kubectl apply -f backend-user-service.yaml kubectl apply -f frontend-service.yaml kubectl apply -f reverseproxy-service.yaml
-
Carry out the deployments:
kubectl apply -f backend-user-deployment.yaml kubectl apply -f backend-user-deployment.yaml kubectl apply -f frontend-deployment.yaml kubectl apply -f reverseproxy-deployment.yaml
-
Check that all the pods are running:
kubectl get pod
-
To test locally run:
kubectl port-forward service/frontend 8100:8100 kubectl port-forward service/reverseproxy 8080:8080
-
Open
http://localhost:8100/
to see the application running