<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Debug School: Gaurav Pathak</title>
    <description>The latest articles on Debug School by Gaurav Pathak (@gauravpathakddn_729).</description>
    <link>https://www.debug.school/gauravpathakddn_729</link>
    <image>
      <url>https://www.debug.school/images/CPDdQlGexClW9WOTxwLbEDeLKxuBxqind7bvkmstzXo/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly90aGVw/cmFjdGljYWxkZXYu/czMuYW1hem9uYXdz/LmNvbS9pLzk5bXZs/c2Z1NXRmajltN2t1/MjVkLnBuZw</url>
      <title>Debug School: Gaurav Pathak</title>
      <link>https://www.debug.school/gauravpathakddn_729</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/gauravpathakddn_729"/>
    <language>en</language>
    <item>
      <title>Day2- Docker Command By Gaurav Pathak</title>
      <dc:creator>Gaurav Pathak</dc:creator>
      <pubDate>Thu, 27 Apr 2023 05:30:06 +0000</pubDate>
      <link>https://www.debug.school/gauravpathakddn_729/day2-docker-command-by-gaurav-pathak-gp9</link>
      <guid>https://www.debug.school/gauravpathakddn_729/day2-docker-command-by-gaurav-pathak-gp9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Some Docker Commands&lt;/strong&gt;&lt;br&gt;
• cp&lt;br&gt;
• diff&lt;br&gt;
• rename&lt;br&gt;
• port&lt;br&gt;
• update&lt;br&gt;
• wait&lt;br&gt;
• logs&lt;br&gt;
• events&lt;br&gt;
• top&lt;br&gt;
• inspect&lt;br&gt;
&lt;strong&gt;Docker commands for images&lt;/strong&gt;&lt;br&gt;
• docker images&lt;br&gt;
• docker pull&lt;br&gt;
• docker info&lt;br&gt;
• docker rmi&lt;br&gt;
• docker inspect&lt;br&gt;
• docker commit – m “message” – a”name” container id alias name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to create a docker images with java and apache installed&lt;/strong&gt;&lt;br&gt;
docker run -itd ubuntu&lt;br&gt;
docker exec -it “containerid” /bin/bash&lt;br&gt;
&lt;em&gt;install java&lt;/em&gt;&lt;br&gt;
apt-get update&lt;br&gt;
apt-get install openjdk-11-jdk -y&lt;br&gt;
apt-get install openjdk-11-jdk-headless -y&lt;br&gt;
&lt;em&gt;install apache&lt;/em&gt;&lt;br&gt;
apt-get install apache2 -y&lt;br&gt;
Install wget&lt;br&gt;
apt-get install wget -y&lt;br&gt;
&lt;strong&gt;Install war file&lt;/strong&gt;&lt;br&gt;
wget &lt;a href="https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war"&gt;https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war&lt;/a&gt;&lt;br&gt;
chmod 755 sample.war&lt;br&gt;
&lt;em&gt;commit the image&lt;/em&gt;&lt;br&gt;
docker commit -m"my first commit" -a"gaurav" containerid name&lt;br&gt;
docker images&lt;br&gt;
&lt;em&gt;Validate java and apache&lt;/em&gt;&lt;br&gt;
docker exec containerid java&lt;br&gt;
docker exec containerid which apache2&lt;br&gt;
docker exec containerid ls /opt/&lt;/p&gt;

&lt;p&gt;After committing to save file in tar&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker save -o image.tar name of image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To load the image which is saved as tar,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker load -i name.tar:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check the images using docker images command to see if the tar is loaded.&lt;br&gt;
To share the image with large group we can push our image to docker repository&lt;br&gt;
Create an account in docker hub&lt;br&gt;
Login to docker hub &lt;br&gt;
docker login&lt;br&gt;
provide username and password&lt;br&gt;
tag the image matching to repo name&lt;br&gt;
docker tag image /gauravpathakddn/devopstraining&lt;br&gt;
Push the image to repo&lt;br&gt;
docker push /gauravpathakddn/devopstraining&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day3- Kubernetes Introduction by Gaurav Pathak</title>
      <dc:creator>Gaurav Pathak</dc:creator>
      <pubDate>Wed, 26 Apr 2023 09:59:04 +0000</pubDate>
      <link>https://www.debug.school/gauravpathakddn_729/kubernetes-introduction-by-gaurav-pathak-1bfn</link>
      <guid>https://www.debug.school/gauravpathakddn_729/kubernetes-introduction-by-gaurav-pathak-1bfn</guid>
      <description>&lt;p&gt;As per my initial understanding ...&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Kubernetes is container orchestration tool for managing, automating, and scaling containerized applications. Using Kubernetes interface through GUI or kubectl , developers /devops can view ,access and deploy into container ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Managing container within a data centre is complex ,rather than individually managing each container in a cluster, a DevOps team can instead use Kubernetes to allocate the necessary resources to a container in  advance, and manage them effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explained Kubernetes Architecture
&lt;/h2&gt;

&lt;p&gt;Kubernetes cluster has master nodes(control plane) and worker nodes. &lt;br&gt;
&lt;strong&gt;Master node&lt;/strong&gt; is the in charge and the &lt;strong&gt;worker nodes&lt;/strong&gt; do the actual work. We can have multiple master node which are connected via a load balancer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Master Components
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;API-Server&lt;/em&gt; – Its front door for the user who want to use Kubernetes and its services. It exposes the API(REST) and consumes JSON via manifest files.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CLUSTER STORE&lt;/em&gt; – It’s the persistent storage which has the information about cluster state and configuration.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CONTROLLER MANAGER&lt;/em&gt; – It’s a watcher within the master nodes that watch for changes and help in maintaining  desired state.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SCHEDULER&lt;/em&gt; -  It assign the work to worker nodes when asked from API Server. It watches API server for a change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worker Components
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Kublet&lt;/em&gt; - It is the main Kubernetes agent. It registers nodes with clusters and instantiates pods and reports back to master.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Container Engine&lt;/em&gt; (Ex -Docker) – It a container management tool for pulling images and creating container.&lt;br&gt;
&lt;em&gt;Kube Proxy&lt;/em&gt; – It handle networking w.r.t to POD and also manage load balancing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workstation Components
&lt;/h2&gt;

&lt;p&gt;It can be laptop with kubectl installed.&lt;br&gt;
It can be web based UI.&lt;br&gt;
Text Editor or IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is POD?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A pod is the smallest execution unit in Kubernetes. &lt;/li&gt;
&lt;li&gt;POD contains one or multiple containers. &lt;/li&gt;
&lt;li&gt;POD communicate over pod network to each other&lt;/li&gt;
&lt;li&gt;POD is IP addresses and abstract the container running inside them
For ex- container 1 -&amp;gt; port 80  , container 2  -&amp;gt; port 90  . IP Address for POD – 10.10.2.2
Then to access container1 address will be 10.10.2.2:80&lt;/li&gt;
&lt;li&gt;If a pod fails, it cannot be redeployed. A pod can only be created.&lt;/li&gt;
&lt;li&gt;PODs are having three stages – Pending , Running, Success/Failed&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Day 1 Docker - Assignment- By Gaurav Pathak</title>
      <dc:creator>Gaurav Pathak</dc:creator>
      <pubDate>Mon, 24 Apr 2023 17:55:01 +0000</pubDate>
      <link>https://www.debug.school/gauravpathakddn_729/day-1-docker-assignment-by-gaurav-pathak-5637</link>
      <guid>https://www.debug.school/gauravpathakddn_729/day-1-docker-assignment-by-gaurav-pathak-5637</guid>
      <description>&lt;h2&gt;
  
  
  What is Docker?
&lt;/h2&gt;

&lt;p&gt;Docker is a container management tool. It allow developers ,admins etc. to easily deploy their application in a container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why We need docker?
&lt;/h2&gt;

&lt;p&gt;Docker allows you to instantly create and manage containers with ease, which facilitates faster deployments. Also when compared with Physical Server/Virtual server, docker help us in cutting cost, saves time and improve software development quality. It provides a complete application isolation by provisioning container on fly within few seconds.  &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Container?
&lt;/h2&gt;

&lt;p&gt;A container is a runtime instance of a Docker image.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Container Works?
&lt;/h2&gt;

&lt;p&gt;Containers bundle the application along with its dependency packages. It kind of providing a standalone environment to run the specific application.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install Docker?
&lt;/h2&gt;

&lt;p&gt;We can use below scripts to install docker.&lt;br&gt;
Step 1 – Download and Run the script.&lt;br&gt;
$ curl -fsSL get.docker.com -o get-docker.sh&lt;br&gt;
$ sudo sh get-docker.sh&lt;br&gt;
Step 2 – Enable Docker&lt;br&gt;
$ sudo systemctl enable docker&lt;br&gt;
Step 3 – Start Docker&lt;br&gt;
$ sudo systemctl start docker&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the components of docker?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Docker Engine (Docker Client + DockerD)&lt;/li&gt;
&lt;li&gt;Docker Images&lt;/li&gt;
&lt;li&gt;Docker Registry&lt;/li&gt;
&lt;li&gt;Container&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is a container lifecycle commands?
&lt;/h2&gt;

&lt;p&gt;docker create image(httpd)&lt;br&gt;
docker start containerId&lt;br&gt;
docker stop container nameorId&lt;br&gt;
docker restart&lt;br&gt;
docker pause&lt;br&gt;
docker unpause&lt;br&gt;
docker kill ex:- docker kill containerId&lt;br&gt;
docker remove ex:- docker rm containerId&lt;/p&gt;

&lt;h2&gt;
  
  
  What is docker pause/unpause?
&lt;/h2&gt;

&lt;p&gt;The docker pause command is used to suspend all processes in the specified containers.&lt;br&gt;
The docker unpause command un-suspends all processes in the specified containers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is docker stop/kill?
&lt;/h2&gt;

&lt;p&gt;Docker &lt;strong&gt;stop&lt;/strong&gt; command sends SIGTERM signal to running container process. &lt;br&gt;
Docker stop command will gracefully terminate the container making sure that all child process will gracefully end up before container will shutdown. It return process exited code as 0 upon successful termination.&lt;/p&gt;

&lt;p&gt;Docker &lt;strong&gt;kill&lt;/strong&gt; command is kind of similar to docker stop command however it sends SIGKILL signal to our running container process. SIGKILL signal immediately shuts the container down without taking any pause.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get inside a container?
&lt;/h2&gt;

&lt;p&gt;We can get inside a container using SHELL.&lt;br&gt;
We can use docker exec command. This will let us to run arbitrary commands inside an existing container. Ex - docker exec 6d77829ff395 ps -eaf .&lt;br&gt;
6d77829ff395 - Container Id for an ubuntu container.&lt;br&gt;
To exec command in interactive mode we can use command&lt;br&gt;
docker exec -it 6d77829ff395.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to access container from outside?
&lt;/h2&gt;

&lt;p&gt;To access container from outside we need NETWORK.&lt;br&gt;
Use docker inspect command to get container IP address and follow the below steps&lt;br&gt;
  docker inspect 955a249cbf71&lt;br&gt;
  docker ps&lt;br&gt;
  curl &lt;a href="http://172.17.0.9"&gt;http://172.17.0.9&lt;/a&gt;&lt;br&gt;
  ping "172.17.0.9"&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the rule for container is running?
&lt;/h2&gt;

&lt;p&gt;Container is running &lt;strong&gt;AS LONG AS&lt;/strong&gt;  &lt;strong&gt;PID1&lt;/strong&gt; is running &lt;strong&gt;Anything&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
