Wednesday, July 31, 2019

Install Jenkins on RedHat Enterprise Linux 8 - How to setup Jenkins on RHEL

How to Install Jenkins on RedHat Enterprise Linux 8?

Please find below steps for setting up Jenkins on RHEL 8.

update package

sudo yum update

Install wget
sudo yum install wget -y

Java Installation

Download Java from Oracle site.

sudo wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm'

Install from RPM
sudo  rpm -i jdk-8u141-linux-x64.rpm

Add Jenkins repository to yum repository

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

Install Jenkins
sudo yum install jenkins -y

Start Jenkins
sudo service jenkins start
sudo service jenkins status

Get Jenkins Admin Password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the output of the above command.
Now go to browser and access the Jenkins page.

http://dns_name:8080

Your page will look something like this. Now paste the password into the below Administrator password text box.

Press Continue..Click on install suggested plug-ins..


 Install suggested plug-ins.

Monday, July 29, 2019

How to setup Jenkins master slave nodes in Ubuntu | Jenkins master and slave setup on Ubuntu | configure Jenkins slave in Ubuntu

Jenkins has powerful feature of master slave architecture which enables distributed builds. This article we will learn how to establish Jenkins Master and slave nodes on Ubuntu machines.

Few info on Jenkins master and slave setup:

Jenkins Master
Your main Jenkins server is the Master. The Master’s job is to handle:
  • Scheduling build jobs.
  • Dispatching builds to the slaves for the actual execution.
  • Monitor the slaves (possibly taking them online and offline as required).
  • Recording and presenting the build results.
  • A Master instance of Jenkins can also execute build jobs directly.
Jenkins Slave
A Slave is a Java executable that runs on a remote machine. Following are the characteristics of Jenkins Slaves:
  • It hears requests from the Jenkins Master instance.
  • Slaves can run on a variety of operating systems.
  • The job of a Slave is to do as they are told to, which involves executing build jobs dispatched by the Master.
  • You can configure a project to always run on a particular Slave machine, or a particular type of Slave machine, or simply let Jenkins pick the next available Slave.
Lets see how to configure both Jenkins master and slave nodes on Ubuntu EC2.

Step 1 - Jenkins master node configuration (this step # 1 is NOT required)

(If you have already Jenkins up and running, this step is not required)
Install first Java by following below steps. Make sure port 8080 is opened in security group.

sudo apt-get update
sudo apt-get install default-jdk -y

Jenkins (make sure you open port number)

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins -y
now to go to browser --> http://server_ip_address:8080/
Copy the password from this location
By entering
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Paste the password and click on install suggested plug-ins.
Create SSH keys in master node by executing below command:

ssh-keygen (no need to enter any password, just enter three times)

Step # 2 Slave node configuration(you need new micro Ubuntu instance for this slave)
only port 22 needs to be open

Install Java

sudo apt-get update
sudo apt-get install default-jdk -y

Install Maven
sudo apt-get install maven -y

Create User as Jenkins
sudo useradd -m jenkins
sudo -u jenkins mkdir /home/jenkins/.ssh




Add SSH Keys from Master to Slave 

Execute the below command in Jenkins master Ec2.
sudo cat ~/.ssh/id_rsa.pub

Copy the output of the above command:

Now go to Slave node and execute the below command
sudo -u jenkins vi /home/jenkins/.ssh/authorized_keys

This will be empty file, now copy the public keys from master into above file.
Once you pasted the public keys in the above file in Slave, come out of the file by entering wq!

Now go into master node
ssh jenkins@slave_node_ip





this is to make sure master is able to connect slave node. once you are successfully logged into slave, type exit to come out of slave.





Now copy the SSH keys into /var/lib/jenkins/.ssh by executing below command in master(make sure you exited from slave by typing exit command:

sudo cp ~/.ssh/known_hosts  /var/lib/jenkins/.ssh

Because jenkins master will look keys from the above folder.

Step # 3 Register slave node in Jenkins:
Now to go Jenkins Master, manage jenkins, manage nodes.









Click on new node. give name and check permanent agent.
give name and no of executors as 1. enter /home/jenkins as remote directory.
select launch method as Launch slaves nodes via SSH.
enter Slave node ip address as Host.











click on credentials. Enter user name as jenkins. Make jenkins lowercase as it is shown.
 Kind as SSH username with private key. enter private key of master node directly by executing below command:

sudo cat ~/.ssh/id_rsa
(Make sure you copy the whole key including the below without missing anything)
-----BEGIN RSA PRIVATE KEY-----

-----END RSA PRIVATE KEY-----

click Save.
select Host key verification strategy as "manually trusted key verification strategy".

Click Save.
Click on launch agent..make sure it connects to agent node.



Now you can kick start building the jobs, you will see Jenkins master runs jobs in slave nodes.

Wednesday, July 10, 2019

Devops Interview Preparation Tips | DevOps Interview Tips | Top 8 Devops Interview Prep Tips

Let us quickly review the steps needed for successful interview experience after Devops course is done. This is based on my personal experience and also my ex-students feedback who had gone through coaching program and successfully placed at various customers all over US.

1. Preparation, preparation and preparation..
  • Plan how you will prepare for the interview. Click here to see the popular DevOps tools list.
  • Have a good resume and review with coach first.. 
  • Start using Devops interview notes...You need to daily refresh all the questions and answers from this document.
2. Apply out of state or out of city positions first
Do not apply local positions at least for your first 5 interviews. You need to get familiar with attending interviews first..So you don't want to loose local opportunity.

3. Do not wait for the perfect time to apply for the job 
Time is now! Sometimes people think that once I am done with this and that, I will start applying for a job. Believe me, that perfect time will never come again..

4. Go extra mile
Prepare outside besides what was given during coaching sessions... You need to master all the interview questions and then start looking at google search or youtube for more on devops interview questions.

5. Share and Network  
Collaborate. Always share interview questions to the group every time you attend interviews. Also try to find answers for every question you don't know answer for. Discuss lab exercises with friends and Collaboration is the key.

6. Be open minded and learn every day
You need to learn new things every day....Always have the willingness to learn new things. You can subscribe to LinuxAcademy for Devops courses.

7. Believe that you are true DevOps champion
If you don't believe, who else can believe? You need to talk DevOps, walk DevOps and sleep DevOps.. You have done all the lab exercises. Not many people out there in the Market know all these tools.

8. Make more mistakes now
Always attend more interviews, face more failures in the beginning. Failures are stepping stone of the success. Learn how to fail in the interview..Then you will always do better job after a few interviews...DO NOT GIVE UP!!!

AWS/Azure DevOps Training August 2020

Are you in IT? Tired of your work? Not able to make a progress? 
Are you not having a job? Looking for a break in IT? No Worries.. 
Are you interesting in learning about DevOps? 

DevOps is THE hot skill in US. Currently almost all the employers are struggling to get a right resource in their teams who can do the DevOps and automation work..You could be that person by attending my coaching program.

DevOps Training In-Person Batches at Frisco, Plano, Dallas and Fort Worth Areas
Weekend online batch from Aug 9th on Saturdays 09:45 AM to 11:15 AM & Sundays 10:30 AM to 12:00 PM 
Weekday Online batch -  August 11th on Every Tuesdays and Thursdays 06:00 pm CST to 07:30 pm CST

DevOps Training highlights:

- Comprehensive hands on knowledge on Git, Jenkins, TeamCity, Maven, SonarQube, Nexus, Terraform, Ansible, Puppet, Docker on AWS and Azure.

- 20+ yrs IT exp, 5+ Yrs in DevOps/Cloud/Automation.

- Many students already placed in reputed companies from my coaching program successfully.

- Working as a Sr.DevOps Coach/Architect in a one of the top IT services companies in USA.

- Unique program...less theory, more hands on lab exercises...in Person class room training

Resume preparation will be done with candidates personally.

One-to-one Interview coaching.

- Coaching is purely hands on with 101% job relevant.

100% Job assistance.

- Both weekday(on-line) & weekend batches available.

- Coached about  620+ people successfully for past 2+ years and many of my students got placed with many large enterprises in DFW, Chicago, Florida, Seattle, Bay area, Ohio and NY areas..

Contact no: 469-733-5248
Email - devops.coaching@gmail.com
Contact: AK

Install kubectl on Mac OS | How to install kubectl in MAC OS

Kubernetes uses a command line utility called  kubectl  for communicating with the cluster API server. It is  tool for controlling  Kubernet...