Tuesday, September 29, 2020

How to create AKS cluster in the Azure portal | How to connect to AKS cluster in Azure Portal

What is Azure Kubernetes Service (AKS)

Azure Kubernetes Service (AKS) is a managed container orchestration service, based on the open source Kubernetes system, which is available on the Microsoft Azure public cloud. AKS allows you to quickly deploy a production ready Kubernetes cluster in Azure, deploy and manage containerized applications more easily with a fully managed Kubernetes service. 

AKS reduces the complexity and operational overhead of managing Kubernetes by offloading much of that responsibility to Azure. As a hosted Kubernetes service, Azure handles critical tasks like health monitoring and maintenance for you. The Kubernetes masters are managed by Azure. You only manage and maintain the agent nodes. As a managed Kubernetes service, AKS is free - you only pay for the agent nodes within your clusters, not for the masters. 

Pre-requistes:

  • Azure CLI is installed
  • Account setup in Azure.
  • Install kubectl. Click here to learn how to install on Ubuntu

We will see how to create AKS cluster in portal Azure.

1. go to https://portal.azure.com/#home

2. Click on Kubernetes services


3. Click on Add Kubernetes Cluster

4. Click on Add Kubernetes Cluster
 Enter information below:
 
 

5. Enter node count as 2, choose standard size

6. Click on Create after making sure validations are passed:
 

This is will take at least 2 to 5 mins to create AKS clusters. If all goes well, you should be able to see the cluster.

Once it is created, go to Kubernetes Services, click on cluster name.

 
How to connect to AKS cluster using Azure CLI

Now click on the cluster name, click on connect.


Make sure you have Azure CLI is installed on your local machine in order to connect to AKS cluster.

Connect to Azure portal using Azure CLI first.

az login

Enter your Microsoft credentials

az account set --subscription subscription_id

az aks get-credentials --resource-group AKS-POC --name AKS-POC

# List all deployments in a specific namespace
kubectl get deployments --all-namespaces=true




 

# List all deployments in a specific namespace
kubectl get deployments --namespace kube-system

Please watch how to create AKS cluster in Azure port using below video:

Tuesday, September 22, 2020

How to change default port number in Tomcat? | Change default port number in Tomcat | Change default port number in Tomcat

 The default port number for Tomcat is 8080. It can be changed though by modifying the below properties file.

sudo vi /var/lib/tomcat9/conf/server.xml



 

 

 

Modify the desired port no in the above file. once you modify, you need to restart Tomcat service to take effect.

sudo service tomcat9 stop

sudo service tomcat9 start

sudo service tomcat9 status

Click here to see steps for how to install Tomcat9 on Ubuntu.

Thursday, September 10, 2020

How to perform git revert | revert to previous Git commit | Git Revert Examples

Git is a popular distributed and open source version control system. Click here to learn more about Git and advantages of Git.

Let us see how can we revert to previous commit.

In order to demo this, I have created a sample repo in GitHub. You can clone it without using ssh keys. You can also try in your Sample Repo as well.

git clone https://github.com/akannan1087/myRepoForJavaApp.git

cd myRepoForJavaApp

First code commit
Let us create a text file called hello.txt
sudo vi hello.txt
Add one line like below
First commit!

git add hello.txt
git commit -m "making our first commit"
git push

you will see all commits with latest commit in the top.

Second code commit
sudo vi hello.txt
Add one line like below
First commit!
Second commit!

git add hello.txt
git commit -m "making our second commit"
git push

third code commit

sudo vi hello.txt
Add one line like below
First commit!
Second commit!
Third commit!!!

git add hello.txt
git commit -m "making our third commit"
git push

Try to view all commits in one line
git log --oneline

547d163 making our third commit
1ec0921 making our second commit
550095c making our first commit
1bad8df Update index.jsp
c206c37 Update index.jsp
161a241 Update index.jsp
5b4e649 my first project setup in GitHub
b429bb6 Initial commit

How to revert to first commit
Now let us say we want to revert to first commit # 550095c making our first commit

git checkout  550095c hello.txt

type git status

git commit -m "reverting to first commit"
git push

cat hello.txt

Please click here if you want to learn more about Git.

Tuesday, September 8, 2020

Top 10 DevOps Popular Tools | Popular DevOps Tools You Must Know In 2021 | Learn DevOps Tools in 2021

Here are the top 10 DevOps Tools to focus on to put your DevOps learning in fast-track and kick start your career quickly as a Cloud or DevOps engineer in about 6 to 8 weeks from now.

1.    Terraform # 1 Infrastructure automation tool
2.    Git – BitBucket/GitHub/Azure Git - # 1 - SCM tool
3.    Jenkins, Maven, Master/Slave, Pipelines - scripted, declarative - # 1 CI tool
4.    Ansible- # 1 Configuration Management tool
5.    Docker- # 1 Container platform 
6.    Kubernetes # 1 container orchestration tool 
7.    Azure DevOps, Pipelines – Microsoft platform for migrating applications to Azure Cloud
8.    SonarQube# 1 Code quality tool
9.    Slack# 1 Collaboration tool
10.  Nexus# 2 Binary repo manager 

Finally having some scripting knowledge is also good – Python, YAML playbooks, JSON script
Cloud experience - AWS and Azure
 
Watch about each of the above tools in YouTube..

Thursday, September 3, 2020

How to scan sql code using sonar | How to perform code analysis on PL/SQL files in SonarQube? SQL plug-ins for SonarQube

If you would like to enable scanning for PL/SQL files in SonarQube, there are both commercial and open source plug-ins available. Lets see how to enable open source plug-in for SonarQube. Useful information is below:

https://github.com/felipebz/sonar-plsql

Pre-requisites:
SonarQube is already set up and running.

Steps:
1. navigate to ${Sonar_Home}/extensions/plugins folder where you installed SonarQube.
${Sonar_Home} could be /opt/sonarqube
cd /opt/sonarqube/extensions/plugins
2. Download the plsql opensource plug-in from the above websites by executing below command:
sudo wget https://github.com/felipebz/sonar-plsql/releases/download/2.0.0/sonar-plsql-open-plugin-2.0.0.jar
3. Stop the Sonarqube scanner.
sudo systemctl stop sonar
4. Start the Sonarqube scanner.
 sudo systemctl start sonar
5. Make sure Sonarqube is up and running
sudo systemctl status sonar

once started, you should see below message
sonar.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonar.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-02-15 01:36:23 UTC;
6. If you don't see server is not starting, you might want to check the logs by executing:
cat /opt/sonarqube/logs/web.log 
7. Now login to SonarQube, Navigate to Quality Profiles section, you should see PL/SQL rules added.
 
You can watch the above steps in my TouYube video as well:
 

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...