<?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: Satish</title>
    <description>The latest articles on Debug School by Satish (@sati1241_119).</description>
    <link>https://www.debug.school/sati1241_119</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: Satish</title>
      <link>https://www.debug.school/sati1241_119</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/sati1241_119"/>
    <language>en</language>
    <item>
      <title>Day 2 - Docker commands</title>
      <dc:creator>Satish</dc:creator>
      <pubDate>Wed, 26 Apr 2023 09:56:08 +0000</pubDate>
      <link>https://www.debug.school/sati1241_119/day-2-docker-commands-315d</link>
      <guid>https://www.debug.school/sati1241_119/day-2-docker-commands-315d</guid>
      <description>&lt;p&gt;*Executed some more Docker commands *&lt;br&gt;
Docker Commands – First Commands&lt;br&gt;
Command Description&lt;br&gt;
info    Display system-wide information&lt;br&gt;
version Show the Docker version information&lt;br&gt;
Docker Commands – Working with Containers&lt;br&gt;
Command Description&lt;br&gt;
attach  Attach local standard input, output, and error streams to a running container&lt;br&gt;
cp  Copy files/folders between a container and the local filesystem&lt;br&gt;
create  Create a new container&lt;br&gt;
diff    Inspect changes to files or directories on a container’s filesystem&lt;br&gt;
exec    Run a command in a running container&lt;br&gt;
inspect Return low-level information on Docker objects&lt;br&gt;
kill    Kill one or more running containers&lt;br&gt;
pause   Pause all processes within one or more containers&lt;br&gt;
port    List port mappings or a specific mapping for the container&lt;br&gt;
ps  List containers&lt;br&gt;
rename  Rename a container&lt;br&gt;
restart Restart one or more containers&lt;br&gt;
rm  Remove one or more containers&lt;br&gt;
run Run a command in a new container&lt;br&gt;
start   Start one or more stopped containers&lt;br&gt;
stop    Stop one or more running containers&lt;br&gt;
unpause Unpause all processes within one or more containers&lt;br&gt;
update  Update configuration of one or more containers&lt;br&gt;
wait    Block until one or more containers stop, then print their exit codes&lt;br&gt;
Docker Commands – Monitoring Containers&lt;br&gt;
Command Description&lt;br&gt;
logs    Fetch the logs of a container&lt;br&gt;
ps  List containers&lt;br&gt;
stats   Display a live stream of container(s) resource usage statistics&lt;br&gt;
top Display the running processes of a container&lt;br&gt;
events  Get real time events from the server&lt;br&gt;
Docker Commands – Working with Image&lt;br&gt;
Command Description&lt;br&gt;
build   Build an image from a Dockerfile&lt;br&gt;
commit  Create a new image from a container’s changes&lt;br&gt;
export  Export a container’s filesystem as a tar archive&lt;br&gt;
history Show the history of an image&lt;br&gt;
images  List images&lt;br&gt;
import  Import the contents from a tarball to create a filesystem image&lt;br&gt;
inspect Return low-level information on Docker objects&lt;br&gt;
load    Load an image from a tar archive or STDIN&lt;br&gt;
rmi Remove one or more images&lt;br&gt;
save    Save one or more images to a tar archive (streamed to STDOUT by default)&lt;br&gt;
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE&lt;br&gt;
Docker Commands – Working with Registry/Repository&lt;br&gt;
Command Description&lt;br&gt;
login   Log in to a Docker registry&lt;br&gt;
logout  Log out from a Docker registry&lt;br&gt;
pull    Pull an image or a repository from a registry&lt;br&gt;
push    Push an image or a repository to a registry&lt;br&gt;
search  Search the Docker Hub for images&lt;br&gt;
Docker Commands – Management Commands&lt;br&gt;
Command Description&lt;br&gt;
config  Manage Docker configs&lt;br&gt;
container   Manage containers&lt;br&gt;
image   Manage images&lt;br&gt;
network Manage networks&lt;br&gt;
node    Manage Swarm nodes&lt;br&gt;
plugin  Manage plugins&lt;br&gt;
secret  Manage Docker secrets&lt;br&gt;
service Manage services&lt;br&gt;
swarm   Manage Swarm&lt;br&gt;
system  Manage Docker&lt;br&gt;
trust   Manage trust on Docker images&lt;br&gt;
volume  Manage volumes&lt;br&gt;
Docker Cheatsheet&lt;br&gt;
Build docker image&lt;br&gt;
$ cd /path/to/Dockerfile&lt;br&gt;
$ sudo docker build .&lt;br&gt;
View running processes&lt;/p&gt;

&lt;p&gt;$ sudo docker ps&lt;br&gt;
View all processes&lt;/p&gt;

&lt;p&gt;$ sudo docker ps -a&lt;br&gt;
Run an image in a new container daemonized&lt;/p&gt;

&lt;p&gt;$ sudo docker run -d &lt;br&gt;
Run an image in interactive mode with the command /bin/bash&lt;/p&gt;

&lt;p&gt;$ sudo docker run -i -t  /bin/bash&lt;br&gt;
Run an image in interactive mode with the command /bin/bash and link the ports.&lt;/p&gt;

&lt;p&gt;$ sudo docker run -i -t --link :  /bin/bash&lt;br&gt;
Run an image with an ENTRYPOINT command in interactive mode with the command /bin/bash&lt;/p&gt;

&lt;p&gt;$ sudo docker run --entrypoint /bin/bash -i -t &lt;br&gt;
Run an image in interactive mode with the command /bin/bash mounting the host director /var/app/current to the container directory /usr/src/app&lt;/p&gt;

&lt;p&gt;$ sudo docker run -i -t -v /var/app/current:/usr/src/app/  /bin/bash&lt;br&gt;
Run an image in interactive mode with the command /bin/bash setting the environments variables FOO and BAR&lt;/p&gt;

&lt;p&gt;$ sudo docker run -i -t -e FOO=foo -e BAR=bar  /bin/bash&lt;/p&gt;

&lt;p&gt;• docker commit – m “message” – a”name” container id alias name&lt;/p&gt;

&lt;p&gt;*How to design docker image *&lt;br&gt;
docker run -itd ubuntu&lt;br&gt;
docker exec -it “containerid” /bin/bash&lt;br&gt;
install java&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;
install apache&lt;br&gt;
apt-get install apache2 -y&lt;br&gt;
Install wget&lt;br&gt;
apt-get install wget -y&lt;br&gt;
Install war file&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;
commit the image&lt;/p&gt;

&lt;p&gt;docker commit -m"message" -a"satish" containerid name&lt;br&gt;
docker images&lt;br&gt;
Validate java and apache&lt;br&gt;
docker exec containerid java&lt;br&gt;
docker exec containerid which apache2&lt;br&gt;
docker exec containerid ls /opt/&lt;br&gt;
Saving and loading tar file&lt;br&gt;
After committing the docker image&lt;br&gt;
Save the file&lt;br&gt;
docker save -o image.tar name of image&lt;br&gt;
you can stop the containers if u want&lt;br&gt;
Load the file&lt;br&gt;
docker load -i image.tar&lt;br&gt;
Pushing the docker image to repository&lt;br&gt;
Create an account in docker hub&lt;br&gt;
Login to docker hub in putty&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 sati1241/satishdevops&lt;br&gt;
Push the image to repo&lt;br&gt;
docker push sati1241/satishdevops&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day -1 Dockers realted questions.</title>
      <dc:creator>Satish</dc:creator>
      <pubDate>Wed, 26 Apr 2023 09:29:27 +0000</pubDate>
      <link>https://www.debug.school/sati1241_119/day-1-dockers-realted-questions-40c7</link>
      <guid>https://www.debug.school/sati1241_119/day-1-dockers-realted-questions-40c7</guid>
      <description>&lt;p&gt;What is Docker?&lt;/p&gt;

&lt;p&gt;Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. The service has both free and premium tiers. The software that hosts the containers is called Docker Engine.&lt;br&gt;
Why We need docker?&lt;/p&gt;

&lt;p&gt;Because Docker containers encapsulate everything an application needs to run (and only those things), they allow applications to be shuttled easily between environments.&lt;br&gt;
Docker enables more efficient use of system resources. Instances of containerized apps use far less memory than virtual machines, they start up ...&lt;/p&gt;

&lt;p&gt;What is Container?&lt;br&gt;
A container is a unit of software that packages code and its dependencies so the application runs quickly and reliably across computing environments.&lt;/p&gt;

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

&lt;p&gt;Containers are an abstraction in the application layer, whereby code and dependencies are compiled or packaged together. It is possible to run multiple containers on one machine. Each container instance shares the OS kernel with other containers, each running as an isolated process.&lt;br&gt;
How to install Docker?&lt;/p&gt;

&lt;p&gt;You can download and install Docker on multiple platforms. Refer to the following section and choose the best installation path for you.&lt;br&gt;
What are the components docker?&lt;/p&gt;

&lt;p&gt;You can download and install Docker on multiple platforms. Refer to the following section and choose the best installation path for you.&lt;br&gt;
1 Docker Installation in Centos/RHEL&lt;br&gt;
1.1 Method -1: How to install Docker Community Edition via YUM?&lt;br&gt;
1.2 Method – 2: How to install Docker Community Edition via RPM Packages?&lt;br&gt;
1.3 Method – 3: How to install Docker Community Edition via script?&lt;br&gt;
2 Docker install in Ubuntu&lt;br&gt;
3 How to Install Docker in RHEL8 / RHEL9 / CENTOS8 / CENTOS9?&lt;br&gt;
I used the below method&lt;br&gt;
Docker provides convenience scripts at get.docker.com.&lt;br&gt;
Step 1 – Download and Run the script.&lt;/p&gt;

&lt;p&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;/p&gt;

&lt;p&gt;$ sudo systemctl enable docker&lt;br&gt;
Step 3 – Start Docker&lt;/p&gt;

&lt;p&gt;$ sudo systemctl start docker&lt;br&gt;
Step 4 – Verify that docker is installed correctly by running the hello-world image.&lt;/p&gt;

&lt;p&gt;$ sudo docker run hello-world&lt;/p&gt;

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

&lt;p&gt;CREATE -&amp;gt; START -&amp;gt; STOP -&amp;gt; START -&amp;gt; RESTART -&amp;gt; PAUSE -&amp;gt; UNPAUSE -&amp;gt; KILL -&amp;gt; REMOVE&lt;br&gt;
What is docker pause/unpuase?&lt;/p&gt;

&lt;p&gt;Paused / Unpaused state&lt;br&gt;
So, as the container is running, there must be a way to pause it. We can do so by running the pause command. This command effectively freezes or suspends all the processes running in a container. When in a paused state, the container is unaware of its state.&lt;/p&gt;

&lt;p&gt;docker pause container&lt;/p&gt;

&lt;p&gt;It basically sends the SIGSTOP signal to pause the processes in the container.&lt;/p&gt;

&lt;p&gt;Similarly, to get the paused container back on running, we’d use the docker unpause command:&lt;/p&gt;

&lt;p&gt;docker unpause container&lt;/p&gt;

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

&lt;p&gt;For a container to be in a killed state, we run the docker kill command, which sends SIGKILL signals to terminate the main process immediately. This means the difference between docker stop and docker kill is that - stop can allow safe termination (within the grace period) while kill terminates immediately.&lt;br&gt;
How to get inside a container?&lt;/p&gt;

&lt;p&gt;Once you have your Docker container up and running, you can work with the environment of the Docker container in the same way you would do with an Ubuntu machine. You can access the bash or shell of the container and execute commands inside it and play around with the file system. You can build, test, and deploy your applications inside the container itself.&lt;br&gt;
Predominantly, there are 3 ways to access the shell of a running container. These are -&lt;/p&gt;

&lt;p&gt;Using the Docker run command to run a container and access its shell.&lt;br&gt;
$ docker run -it --name=myubuntu ubuntu:latest bash&lt;br&gt;
Using the Docker exec command to run commands in an active container.&lt;br&gt;
$ docker exec [OPTIONS] CONTAINER COMMAND [ARG...]&lt;br&gt;
$ docker exec -it myubuntu bash&lt;/p&gt;

&lt;p&gt;Using the Docker start command and attach a shell to a stopped container.&lt;/p&gt;

&lt;p&gt;$ docker start [OPTIONS] CONTAINER [CONTAINER...]&lt;br&gt;
$ docker container ps -a&lt;br&gt;
$ docker start -ai myubuntu&lt;/p&gt;

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

&lt;p&gt;In order to make a port available to services outside of Docker, or to Docker containers which are not connected to the container's network, we can use the -P or -p flag. This creates a firewall rule which maps a container port to a port on the Docker host to the outside world.&lt;br&gt;
Accesss from Outside === Network&lt;/p&gt;

&lt;p&gt;65 docker inspect 955a249cbf71&lt;br&gt;
66 docker ps&lt;br&gt;
67 curl 172.17.0.9&lt;br&gt;
68 ping "172.17.0.9"&lt;br&gt;
69 history&lt;/p&gt;

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

&lt;p&gt;The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command.&lt;br&gt;
To check the status of a specific container you can use the docker ps command to list all running containers and filter them using grep to show the specific container you're interested in.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day -3 related to Kubernetes</title>
      <dc:creator>Satish</dc:creator>
      <pubDate>Wed, 26 Apr 2023 09:28:22 +0000</pubDate>
      <link>https://www.debug.school/sati1241_119/day-3-related-to-kubernetes-4h0i</link>
      <guid>https://www.debug.school/sati1241_119/day-3-related-to-kubernetes-4h0i</guid>
      <description>&lt;p&gt;What is Kubernetes?&lt;/p&gt;

&lt;p&gt;Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management. Originally designed by Google, the project is now maintained by the Cloud Native Computing Foundation.&lt;/p&gt;

&lt;p&gt;Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.&lt;/p&gt;

&lt;p&gt;Kubernetes is an open-source container orchestration system for managing, scaling, and automating software deployment. Kubernetes helps organizations with DevOps, as it combines the development and maintenance phase of software systems to improve agility. Through the Kubernetes user interface, developers can view, access, deploy, update, and optimize container ecosystems. &lt;/p&gt;

&lt;p&gt;Why Kubernetes?&lt;br&gt;
Kubernetes provides you with a framework to run distributed systems resiliently. It takes care of scaling and failover for your application, provides deployment patterns, and more. For example: Kubernetes can easily manage a canary deployment for your system.&lt;/p&gt;

&lt;p&gt;Essentially, containerization is an efficient and effective way to implement DevOps than a monolithic application. Kubernetes creates and manages containers on the cloud-based server systems. Kubernetes helps DevOps teams to reduce the burden of infrastructure by letting containers operate on different machines/environments without breakdowns.&lt;/p&gt;

&lt;p&gt;Explained Kubernetes Architecture ?&lt;/p&gt;

&lt;p&gt;An environment running Kubernetes consists of the following basic components: a control plane (Kubernetes control plane), a distributed key-value storage system for keeping the cluster state consistent (etcd), and cluster nodes (Kubelets, also called worker nodes or minions).&lt;/p&gt;

&lt;p&gt;TABLE OF CONTENTS&lt;br&gt;
Kubernetes Architecture&lt;br&gt;
Control Plane&lt;br&gt;
Worker Node&lt;br&gt;
Kubernetes Control Plane Components&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;kube-apiserver&lt;/li&gt;
&lt;li&gt;etcd&lt;/li&gt;
&lt;li&gt;kube-scheduler&lt;/li&gt;
&lt;li&gt;Kube Controller Manager&lt;/li&gt;
&lt;li&gt;Cloud Controller Manager (CCM)
Kubernetes Worker Node Components&lt;/li&gt;
&lt;li&gt;Kubelet&lt;/li&gt;
&lt;li&gt;Kube proxy&lt;/li&gt;
&lt;li&gt;Container Runtime
Kubernetes Cluster Addon Components&lt;/li&gt;
&lt;li&gt;CNI Plugin&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Master Components?&lt;br&gt;
etcd. It stores the configuration information which can be used by each of the nodes in the cluster. ...&lt;br&gt;
API Server. ...&lt;br&gt;
Controller Manager. ...&lt;br&gt;
Scheduler. ...&lt;br&gt;
Docker. ...&lt;br&gt;
Kubelet Service. ...&lt;br&gt;
Kubernetes Proxy Service.&lt;/p&gt;

&lt;p&gt;Worker Components?&lt;br&gt;
Worker nodes within the Kubernetes cluster are used to run containerized applications and handle networking to ensure that traffic between applications across the cluster and from outside of the cluster can be properly facilitated.&lt;/p&gt;

&lt;p&gt;The components on a node include the kubelet, a container runtime, and the kube-proxy.&lt;/p&gt;

&lt;p&gt;Workstation Components?&lt;/p&gt;

&lt;p&gt;Kubernetes automates operational tasks of container management and includes built-in commands for deploying applications, rolling out changes to your applications, scaling your applications up and down to fit changing needs, monitoring your applications, and more—making it easier to manage applications.&lt;/p&gt;

&lt;p&gt;A Kubernetes cluster consists of the components that are a part of the control plane and a set of machines called nodes.&lt;/p&gt;

&lt;p&gt;What is POD?&lt;br&gt;
A pod is the smallest execution unit in Kubernetes. A pod encapsulates one or more applications. Pods are ephemeral by nature, if a pod (or the node it executes on) fails, Kubernetes can automatically create a new replica of that pod to continue operations.&lt;/p&gt;

&lt;p&gt;A pod is the smallest execution unit in Kubernetes. A pod encapsulates one or more applications. Pods are ephemeral by nature, if a pod (or the node it executes on) fails, Kubernetes can automatically create a new replica of that pod to continue operations.&lt;/p&gt;

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