diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8862969 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# https://docs.docker.com/engine/reference/builder/ + +# base this image on the PHP image that comes with Apache https://hub.docker.com/_/php/ +FROM httpd:latest + +# Run Apache +ADD test-app/ /usr/local/apache2/htdocs/ diff --git a/README.md b/README.md index de3b0a2..d51040e 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,42 @@ -# webdeploy -The purpose of this repo is to house the Code to be used for technical screen of SRE candidates +# Steps to Re-produce stateless application deployment and rolling updates. # -## -1. Demonstrate three instances of this website running -2. Demonstrate procedures for deploying an updated change to the instances from #1 -3. Provide code as a pull request to this repo -4. Solutions can be in the language of your choice -5. Technology of your choice +## Create a Dockerfile to add the frontend assets and build the image from root directory ## + docker build . +## Create a docker private or local registry to push the image updates ## -### Some Suggestions +## Login to docker registry to authenticate yourself ## -We are looking to see what you are doing, We are not going to do anything to trick you but put your best foot forward. Demonstrate a working demo, feel free to exhibit your skills. +docker login (prompts for username and password) +## Tag and push the image to the registry ## -### +docker tag $IMAGEID repo/image:tag +docker push repo/image:tag +sadxacacaddc +## To run a kubernetes cluster with the container pushed to local or private registry ## -[How to submit a pull request](https://help.github.com/articles/creating-a-pull-request) +kubectl run $container --image=repo/image:tag --port=80 + +## To Expose as a service ## + +kubectl expose deployment $container --type=NodePort + +## To open the exposed endpoint in the browser ## + + minikube service $container + (This will open the html page on the browser) + +## View the kubernetes dashboard via ## + +minikube dashboard + +## For any rolling updates, Update the image to latest version and push it to registry again ## +kubectl set image deployment/$container $container =repo/image:tag +(Leveraging rolling updates will benefit in Zero downtime) + +## To achieve a multi instance pod, we can scale the deployment to the number desired. ## + +![alt text](https://github.com/chandrakothapally/webdeploy/blob/master/scale_deployment.png) diff --git a/ml-common/test.yml b/ml-common/test.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ml-common/test.yml @@ -0,0 +1 @@ + diff --git a/scale_deployment.png b/scale_deployment.png new file mode 100644 index 0000000..00a2778 Binary files /dev/null and b/scale_deployment.png differ diff --git a/test-app/index.html b/test-app/index.html index f3bfea8..159b74a 100644 --- a/test-app/index.html +++ b/test-app/index.html @@ -6,7 +6,8 @@