Thursday, May 23, 2019

Welcome To DevOps Coaching - Coaching Pre-requisites and some Agile and DevOps concepts basics links

Welcome to DevOps Coaching Program! Thanks for showing interest in joining the program. Please go through the useful links before joining the coaching sessions live with Coach.

Please click the below link to learn more about How the coaching program works.

https://www.coachdevops.com/2019/04/devops-coaching-model-information.html

Pre-requisites:
https://www.coachdevops.com/2019/01/pre-requisites-before-starting-devops.html

Once you create AWS account, GitHub and Bitbucket account using the above links, do the following to secure your AWS account:

https://www.cidevops.com/2018/09/how-to-enable-multi-factor.html

Learn more about AWS cloud in less than10 mins..
https://www.youtube.com/watch?v=r4YIdn2eTm4

Basic concepts to go through before you attend classes:

Why we need DevOps? Why companies are migrating to Cloud/DevOps?
https://www.cidevops.com/2019/05/why-we-need-devops-why-devops-is.html

If you are new to IT, please learn more about Agile, DevOps from the below links:

https://www.tutorialspoint.com/agile/index.htm
https://www.edureka.co/blog/what-is-devops/
https://www.edureka.co/blog/devops-tutorial - nice read on DevOps

What is DevOps
https://www.youtube.com/watch?v=_I94-tJlovg&t=2s

Difference between Waterfall and Scrum 
 
Top 10 DevOps tools to learn in 2024

Top DevOps Skills for 2024 | Skills required to become a DevOps engineer

https://www.coachdevops.com/2021/02/top-devops-skills-for-2021-skills.html

Saturday, May 18, 2019

How to setup SSH keys | How to setup Repo in GitHub and Setup Java Project in GitHub | How to add a Java Web App in GitHub using Maven

GitHub is one of the popular git-based version control systems. GitHub is very good example for Software-as-a-service, hosted on cloud for storing and sharing code. 

We will learn how to create a Java Project using Maven and push Java Project into GitHub from Ec2 instance. Let us learn how to create SSH keys and securely connect to gitHub from EC2 instance. 

Git is a purely distributed version control system. Click here to learn more about Git and its advantages over other SCMs.


Pre-requisites:

1. GitHub account
2. Git client installed
3. Connect to your Jenkins EC2 instance

Step # 1 - Create private repository in GitHub

Click on New to create a new repo 
Also choose initialize with repository with a README option.

Step # 2 Create SSH keys from your Jenkins EC2 machine

Login to your Jenkins EC2 instance using Git bash. (make sure you are connected to Jenkins instance)
Type ssh-keygen (and then click on enter four button times, do not give any password). 
ssh-keygen command will generate two keys - public keys and private keys. We need to upload only the public keys into GitHub.

If you already have keys generated, you can use the existing key, you don't have to overwrite the existing key.


copy the content of public key by executing below command in Git bash:
sudo cat ~/.ssh/id_rsa.pub


Step # 3 - Upload SSH Keys in GitHub

Go to GitHub, click on Settings.
Copy SSH keys Key section and then click on Add SSH key.


Step # 4 - Clone Repo locally

Now click on the Cat icon on your top left to go back to repo you just created.
Click on the repo you created in step # 1, click on Code, under SSH
 




Copy the SSH url and go to your EC2 instance using git bash and perform below command:

git clone <paste the ssh url >

type yes to connect

After you clone, you should see something below:







type below command to list the directory
ls -al
The above command should list the directory you have cloned.

Now go into repo folder(red circled like above) you have cloned.
cd MyApplicationRepo

Step # 5 - Create Java Web App using Maven
use below maven command to create Java Web App using Maven. Maven is the build for creating and building java projects. Click here to know more about Maven.

mvn archetype:generate -DgroupId=com.dept.app -DartifactId=MyWebApp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Step # 6 - Push Java Web App using Git commands into GitHub

type below command to see the new folder called MyWebApp
ls -al

type  below command to see the newly created project in red color
git status

Now add the newly created folder by executing below command:
git add  *

Now make sure all the files are moved to staging area, when you execute below command:
git status

git config --global user.name "your github user_id"
git config --global user.email "youremailid"

Perform below command to commit the changes to local repository first.
git commit -m "my first project check-in to GitHub"

Now perform below command to push from local repository to remote repository. 

git push

 

Verify code changes in GitHub

Now to GitHub and click on the repo, you will see your commits.


You can also watch the videos of the above lab exercise in my YouTube channel given below:




Monday, May 6, 2019

How to connect to an EC2 instance from Windows or IMac?

Pre-requisites:

1. SSH keys(for e.g., myEc2Jenkins.pem) already downloaded in your local machine, preferably in downloads folder.
2. Your EC2 instance is up and running in AWS
3. For windows laptop, you need to use Git bash. You can install Git by downloading from this URL - https://git-scm.com/downloads

Steps to connect to EC2 instance:

1. Go to AWS console.
2. Click on EC2, click on running instances link





3. Select the checkbox of EC2 you would like to connect to.
4. Click on Action. Copy the url from SSH which looks like below:
For e.g.
ssh -i "mykey.pem" ubuntu@dns_name.compute.amazonaws.com



For windows machine(and also for iMac))

1. Open Git bash
2. type pwd
It may print your directory in git bash
3. Now type cd downloads
4. make sure you have keys in the downloads directory by typing the below command:
  dir  *.pem

The above command should list all the pem files in the downloads directory.

only for Macbook pro laptops, you need to perform additional step
chmod 400 myJenkinsEc2KKey.pem

5. Now paste the url from step # 4 above
ssh -i "mykey.pem" ubuntu@dns_name.compute.amazonaws.com
type yes

6. now you should be in AWS cloud, screen should tell you something like this:

Last login: Sun month 18 19:01:21 2018 from 64.183.186.78
ubuntu@ip-172-31-26-96:~$

DevSecOps Bootcamp Dec 2024 Schedule | DevSecOps & AWS Azure Cloud Coaching by Coach AK | DevSecOps and Cloud Computing Online Classes

Lot of new topics covered like GitHub Actions, GitHub Advanced Security, Helm, Prometheus and Grafana..) The DevOps requirements in the IT m...