Submission - Abdulsalam Abdulrazaq - #7
Open
abdulfrfr wants to merge 91 commits into
Open
Conversation
…ile in the testing stage
…ile in the testing stage
…ile in the testing stage
…ile in the testing stage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Solution Details
Dockerfile & Application Configuration:
Using Multi-staging, i made a Dockerfile to build my vuejs application having Nginx serve as a reverse proxy server for my vuejs application, and i also created a seperate docker image using another Dockerfile for my python proxy application.
I Implemented caching best practice by having the processes which will not be having frequent changing like copying the
package*.jsonfile and installing the dependencies be at the top of the Dockerfile so that my updates during building the docker image would be faster because docker would cache those stages without changes for me, and the copying of other application files is below becuase of the updates taking place in the application configuration files. And i also implement a volume for updates on my image using thedocker-compose.yamlfile, for local development and testing, which i know isn't necessary but i was just flexing my abilities...For the security part, i implemented security best practice by making our environmental variables very well secured, using them as credentials on my jenkins environnment to be integrated inside my application when building my docker image on jenkins environment, and also added them to the
ENVcommand in the Dockerfile but not passing the values directly but instaed getting the values from environ mental variables locally and also my my CO/CD pipeline during build process, so that these environmental variables are going to be within the application and would not be accessed externally. And also to access aws CLI i integrated my AWS access keys as credentials to be able to use aws CLI commands. and i also made use of the .env file for the python application to pass the required variables inot the application.CI/CD Pipeline:
Here i made use of Jenkins, with my jenkins file and integrating my jenkins to my repro using the github webhook to automate the pulling of updates i make to the reprository, i built multiple stages which comprises of, bulding the docker image, testing and running the image and deploying the image to amazon ECR, and also deployng my image to my eks cluster using the kubernetes configuration file that's located inside the
/k8sdirectory if the piple is a success.The first stage is a checkout stage which just basically checks the branch of the reprository my pipeline is working with.
Next, i built and images and using a docker compose file, i ran my docker images out of the application code provided to us, passing the backend endpoint as an environmental variable, because the backend endpoint for my development environment is different from the one on my deployment environment.
The next stage, i testing my running containers locally, sending a get request and getting the status code of the responds to see if my applications are running perfectly fine and good for deployments.
After testing my application locally, the next stage i built the images again passing throught the variable needed for my deployment environment because this next stage my docker image was being pushed to my Amazon ECR reprository, passing my AWS credentails as a credential variable in my jenkins credentials for safe and secure usage of my aws credentials, for further development and testing.
The next step only takes place if the whole pipeline is a sucess, which is a POST stage, which is, deploying my images to my Amazon EKS cluster which is already running and i have provisioned it using an IaC tool from AWS called CloudFormation. here i will pass the current version of my image into my kubernetes deployment vonfiguration file to know the right image to deploy
Infrastructure as Code (IaC):
hostober_challenge_cloudformation.yaml,vpc_stack.yamlandingress-service.yamlwhich creates an EKS cluster and all networking configuration under the VPC automatically. I made configuration files for my EKS deployment and also for nginx ingress crontroler whih help me create an Elastic Load Balancer to help route traffic to my application and deployed my application to my EKS cluster. And also for my k8s Addons for Prometheus and Grafana, which is an EBS CSI Controller.Monitoring Setup (Bonus):
grafana.yamlconfiguration inside of the/k8sdirectory, i have also configured grafana to run for monitoring the running containers.Screenshots/Links (if applicable):
Front-End PNG

Back-End PNG
Link to video for the compulsory part of the challenge
Link to video for the bonus part of the challenge
Testing the Solution
Provide clear instructions on how the evaluators can test and verify your solution. Include steps to:
Additional Information
Include any other relevant information like:
Checklist:
By submitting this pull request, I confirm that my contribution is made under the terms of the challenge’s requirements.