Posts

Docker Volumes - Deep Dive with Use Cases

Image
Understanding  Docker Volumes in-depth with real-time scenarios. Where the MongoDB is the backend tier Database and frontend web application using - Mongo-Express container. Use Case 1: MongoDB container without volume observe what happens to the data. Use Case 2: After attaching volume = persistence - confirm re-create containers data persist  Use Case 3: Database containerversion changes does not impacts the Data persisted Let's start the experiment on data persistance. Docker Volume deep dive - MongoDB persistant  To share the sensitive data we use network isolation, which is already discussed in Docker Networks  post. # Create Network docker network create mynet Now let's use this mynet throughout all our use-case examples. MongoDB Connect to Mongo-express which is a member in the same network so that it can access the database Use Case 1: MongoDB Without any volume - Non Persistence MongoDB Container without any persistance storage : docker run -d --...

Docker Expose Port Understanding Port Mapping and Port Forwarding

Image
 In this, we will discuss an experiment on Docker Container Network port exposed or published. A Netcat command utility will be used to make an echo server. which will be read the message on one socket and the other end sends the message to the terminal. Understanding Port forwarding in Docker Containers Background on Docker Port Docker container ports by default mapping to host ports. The -P option will bind the container exposed ports (EXPOSE command in Dockerfile) to random available ports of the host. We can bind any port of the container even though it is not pre-defined with EXPOSE ones. For this, you can use -p (lower case) with host port followed by a colon (:) container port  Note: This experiment can be successful on ubuntu:14.04 image only. Because other than that ubuntu images don't support nc and host.docker.internal to look into the docker network. Here we have four use cases: Two ports open to run the echo server  Container access host network Dynamically...

Jenkins integration with SonarQube Scanner

Image
Hello Guys, DevSecOps team members, In this post I would like to integrate Jenkins with SonarQube.  SonarQube is an open-source product for continuous inspection of code quality.   The main objective of SonarQube to check Code Quality and provide the Code Security. SonarQube empowers and ensure all developers to write cleaner and safer code.  In this experiment we will be running the SonarQube on a Docker Engine. Prerequisites We must have following pre-requisites to do this experiment SonarQube Server installed, up and running state Jenkins installed and Master is up and running Sonar Scanner installed on same machine(container) where Jenkins build job executes Important URLs  The following links are very helpful while dealing with the SonarQube and its integration with Jenkins. Docker play-ground :  Sonar Scanner Link   SonarQube on DockerHub     Step 1: Preparing SonarQube on the Docker You could installed Docker and it is Up and runn...

Sidebar Links in Jenkins Job

Image
Hello Everyone! Here I will give some real use cases where the Jenkins integration with Sidebar Links requirement for a Jenkins Project.  Case 1: Your project might have a complete build strategy defined and it is shared on a Confluence page or common documentation platform. This document need to be linked to the Jenkins Job. Case 2 : Your QA team want to have all the jobs which they want to access on a single page. Even though you have placed all the QA-related jobs into a View. The solution is using Sidebar Link to the View from the Job. Case 3: A QA team working on two different Product testings where you have the two separate Jobs, but in the Organization the jobs are grown where a listing of all jobs will make difficult to search for the second job. instead of searching for the second job if we have the second job on the first job page then QA team life will be easy.  How to use Sidebar Links in a Jenkins Job? Sidebar link can be used for linking following: Documentation...

Jenkins Manage Assign Roles - Role based Strategy

Image
Here I am finding a solution for the users who belong to QA must have access only to the QA-related jobs. In this post,  Situation IT Organizations includes multiple teams such as: QA, Release, Developer and DBA or Middleware Engineers  Jenkins Master - Container-based Default all users have the same authorization. I would like to share how to launch the Jenkins Master on a Docker Container. login with docker playground. As you have provision to Add Node from the left side click it. You will get a terminal to use for 4 hours to play with the Docker engine.   To run the Jenkins inside docker container name: Jenkins-master run in detached mode -d Port forwarding from container port 8080 to host 8081 and 50000 to 50001 Allocate disk space to run the Jenkins workspace use -v Docker image from Blue Ocean Let's launch the Jenkins container using below command: docker run --name jenkins-master -u root --rm \ -d -p 8081:8080 -p 50001:50000 \ -v ...

Kubernetes Services

Image
 Hello everyone !! In this post, we will discuss the Kubernetes Services, What, and How we can deploy the service on a Kubernetes cluster. What is Kubernetes Service? We have Kubernetes services for not to remember the pod IP address, it is more comfortable inter-connecting the pods using service names. Why we need Kubernetes Services? We will get to know once we deploy the following different kinds of Kubernetes services on your Kubernetes cluster. Types of Kubernetes Services NodePort ClusterIP Headless  Loadbalancer Kubernetes Service types NodePort The node port will be a port enabled on a Node per microservice application.  Let's have pod defination in myapp.yaml apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp spec: containers: - name: nginx-containers image: nginx Create the myapp pod using the above defination. Example nodeport.yaml file apiVersion: v1 kind: Service metadata: name: appservi...

Git log - commit history

Image
Here is the GitOps story! we started learning more depth of every GIT commit history using git CLI. In this post, we have touched some rea-time scenario-based question and answers with practical examples which are useful for other DevOps team members.  The best question to help release management - who worked on the critical program/script which is in the release process? This can be found using the git log command.  The most interesting story if someone left the company and need to know what he did in his last commit. Tracking changes all of them done by that particular user.  The git log having many options: sorting filtering output formatting Let's see in detail by with experimenting each with an example. How to get the git log in a "Sorting order"? Here we have a couple of sorted commit history commands.  Using the --pretty value with  Oneline to going to give you the log output in simplify format. git log --pretty=oneline The output combination of ...