nagateja-dharam / 90Days_DevOps_Subham_Answers

A documentation of my DevOps learnings - 90 days of devops answers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevOps_learnings

Jenkins CI/CD Project with GitHub Integration using GitHub Webhook

An AWS instance is created and Jenkins is installed on that server. On the AWS management console, in the security section, the security group permissions are accessed and the port 8080 (port in which Jenkins server runs) is given anywhere or private IPv4 access using inbound rules. The server private IP is then used to access the port 8080. When the Jenkins dashboard appears, we must make sure to install the GitHub Integration plugin. A new job is created is created as Pipeline project of deployment. A suitable description is written, the project url from the github, the repository url is added and the branch name is also specified. GitHub hook trigger for GITScm polling is selected as the build trigger.

 docker-compose down
 docker-compose up -d

The following code is used for running the container of the todo-app and this code is written in the Execute Shell and changes are applied.

In the project GitHub repo settings, webhooks options is selected and a new webhook is added. A url is added in the following format

http://<private -ip>:8080//github-webhook/ 

The content type is selected as application/json and it is saved.

The purpose of webhook is that, every time a new pipeline is created the Jenkins server hits in the repo so that any change in the code is also reflected in the creation of the pipeline and running of the application.

Managing Deployments using Kubernetes Engine

Created a AWS t2.medium instance for using Kubernetes by installing minikube in Linux with the help of the following commands :

 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
 sudo install minikube-linux-amd64 /usr/local/bin/minikube

To start your cluster :

 minikube start

Now using the vim text editor in Linux YAML scripts are written for pod, which is the smallest unit in a K8s cluster, deployment file for creating a deployment for the django-todo app, service file for creating a service and ingress file for hosting.

To run the files the following command is used :

 kubectl apply -f <file_name>

If the file contains namespace, which are a kind of tag to group certain files, the following command is used :

 kubectl apply -f <file_name> -n <namespace_used>

For viewing the running pods, deployments, services the following commands are used :

 kubectl get pods
 kubectl get deployments
 kubectl get services

Shell Scripting Project

A basic shell script in Linux which :

  • Greets the user according to the time of the day using conditional statements
  • Provides the information about :
    • Date and time
    • Uptime of the server
    • The last logins
    • The disk space and RAM
    • Utilization and the top CPU Process

About

A documentation of my DevOps learnings - 90 days of devops answers


Languages

Language:Shell 92.3%Language:HCL 7.7%