Skip to content

simulationpoint/Cloud-DevOps-Engineer-Capstone-Project

Repository files navigation

new vm

Step 1. Setup and Configure Linux Virtual Machine

  • First download and install the free VirtualBox software.

  • Seconed downloade and configure an open source operating system Ubuntu OS.

    Ubuntu 20.04 VM configration and installation

    • Go to Settings and configure General, System, Display, Network, and Shared Folders accourding to the following screenshot
Click New

new vm

Give a name you like and choose 
Type: Linux
Version: Ubuntu(64-bit)

new vm

Set the RAM 4GB or more - based on your system spec 

new vm

Choose existing virtual hard disk file and create

new vm

Go to the Settings

new vm

General
Advanced Tab:
Shared Clipboard: Bidirectional
Drag'n'Drop: Bidirectional			

new vm

Motherboard Tab:
Base Memory: 2GB
Extended Feature:  Enable I/O APIC
Processor Tab:
Processors(s): 2 CPU
Extended Features:
Enable PAE/Nx
Acceleration Tab:
Hardware Virtualization:
Enable VT-x/AMD-V
Enable Nested Paging

new vm

Display:
Screen Tab:
Video Memory: 28 MB
Graphic Controller: VMSVGA
Acceleration: Enable 3D Acceleration	 

new vm

Network:
Adapter 1:
Attached to: NAT Network
Advanced:
romiscuous Mode: Allow All
MAC Address: (click generate new MAC)

new vm

Shared Folders 

new vm

Wallah! Click start to fire your VM	

new vm

Last thing to enable drag and drop, copy and paste, and to share folder betweeen the guest and host
macine run the following comands in your terminal once the vm starts.

sudo add-apt-repository multiverse

new vm

sudo apt install virtualbox-guest-dkms virtualbox-guest-x11 new vm

Reboot the VM and enter the following

lsmod | grep vbox new vm

mkdir -p ~/Share new vm

sudo mount -t vboxsf "your Shared folder name" ~/Share new vm

Step 2. Designe, plan, and overview of the project

new vm

Step 3. Install, run, and configure some DevOps tools

  • VirtualBox
  • Linux VM(Ubuntu 20.04)
  • Python Flask App
  • Git, GitHub
  • Webhook
  • Jenkins
  • Docker
  • Docker Hub
  • Kubernetes
  • Minikube
  • Red Hat Ansible
  • AWS Cloud Formation
  • Ansible Tower
  • AWS(S3,EC2)

Install git for Debian/Ubuntu

$ sudo apt install git-all
$ git --version

Install Python3 for Debian/Ubuntu

$ sudo apt-get update
$ sudo apt-get install python3
$ python3 --version
	- - -
$ sudo apt update
$ sudo apt install python3-pip
$ pip3 --version

Install Jenkins for Debian/Ubuntu

$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
$ sudo apt-get update
$ sudo apt-get install jenkins
$ sudo systemctl start jenkins
$ sudo systemctl status jenkins

Install Java for Debian/Ubuntu

$ sudo apt update
$ sudo apt search openjdk
$ sudo apt install openjdk-11-jdk
$ sudo systemctl status jenkins
$ java -version

Install Docker Desktop/Dockercli for Debian/Ubuntu

$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
$(lsb_release -cs) stable"
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io

Install kubclt/minikube for Debian/Ubuntu

$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)
/bin/linux/amd64/kubectl"
$ sucurl -LO https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl
$ curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin
/linux/amd64/kubectl.sha256"
$ echo "$(<kubectl.sha256) kubectl" | sha256sum --check
$ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
$ sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl
$ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
$ echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt
/sources.list.d/kubernetes.list
$ sudo apt-get update
$ sudo apt-get install -y kubectl
$ snap install kubectl --classic
$ kubectl version --client

$ sudo apt-get install curl
$ sudo apt-get install apt-transport-https
$ wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
$ sudo cp minikube-linux-amd64 /usr/local/bin/minikube
$ sudo chmod 755 /usr/local/bin/minikube
$ minikube version
$ minikube start


Install Dockercompose for Debian/Ubuntu

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/
docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
$ docker-compose --version
docker-compose version 1.28.2, build 1110ad01
$ docker-compose migrate-to-labels


Install Ansible/Ansible AWX for Debian/Ubuntu

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible
$ ansible -version

Install ASKCLI/AWSCLI AWX for Debian/Ubuntu

$ sudo apt update
$ sudo apt-get install awscli
$ aws --version
$ pip install awscli --upgrade --user
$ python -m awscli --version
$ aws configure
$ python -m awscli configure

Step 4. Testing, Building, Staging, and Production

Part 1. Create CI/CD pipelines using Jenkins

Jenkinsfile

  • Run the pipeline from Blue Ocean plugin of Jenkins

new vm

jenkins-docker-pipeline JenkinsConsoleOutPut OutPut

Part 2. Dockerize Jenkins Pipeline

Dockerfile

Part 3. Create Kubernetes Cluster

kubernetes.yaml OutPut
OutPut

Part 4. Deploying dockerized web app using Ansible as a configuration management tool

ansible-deploy.yaml

Step 4. Cloud implementation in AWS

Part 1.

  • Import prebuilt VM to AWS S3 bucket

Part 2.

  • Create an EC2 instance of the VM and launch the service

Run it anywhere, anytime, as long as you have able to connect to the internet !!

Summary

  • A key challenge in this project was configuring Ansible. It was installed on my local machine natively. I used Ansible to do all of the CI/CD pipeline, including the CD of the Kubernetes cluster and pulling/pushing of the Docker images to dockerhub, but in the end, I had to switch to Jenkinsfile.
  • After all the challenges, it was so rewarding when I saw my app running on a distributed Kubernetes cluster!
  • I am planning to deploy my web application using Ansible and Amazon Web Services (AWS).

OutPut

OutPut

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors