<?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: Srikanth K N</title>
    <description>The latest articles on Debug School by Srikanth K N (@sreekannoth).</description>
    <link>https://www.debug.school/sreekannoth</link>
    <image>
      <url>https://www.debug.school/images/n0awxPFflT-bcInOQk5RifLaOCSsSptRhyAh98BLenQ/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvdXNl/ci9wcm9maWxlX2lt/YWdlLzU2OS81YzZh/MGEzZi00ZTQ4LTQ0/ZTctOGQ1OC04ZjUx/Y2M3NzRkNWYuanBn</url>
      <title>Debug School: Srikanth K N</title>
      <link>https://www.debug.school/sreekannoth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/sreekannoth"/>
    <language>en</language>
    <item>
      <title>Kubernetes Essentials..</title>
      <dc:creator>Srikanth K N</dc:creator>
      <pubDate>Fri, 21 Jul 2023 13:34:35 +0000</pubDate>
      <link>https://www.debug.school/sreekannoth/kubernetes-387j</link>
      <guid>https://www.debug.school/sreekannoth/kubernetes-387j</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Kubernetes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes (also known as k8s or “kube”) is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling containerized applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why we need Kubernetes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes can help you deliver and manage containerized, legacy, and cloud-native apps, as well as those being refactored into microservices. &lt;/p&gt;

&lt;p&gt;In order to meet changing business needs, your development team needs to be able to rapidly build new applications and services. Cloud-native development starts with microservices in containers, which enables faster development and makes it easier to transform and optimize existing applications. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Kubernetes works?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/ZDYR_f6SBjRDvAvwTnWS0d1sdjnMsn4B7-MMAVSSrqg/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvbmYyeDVj/bTh6b21hOGQxZ3pm/YXguUE5H" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/ZDYR_f6SBjRDvAvwTnWS0d1sdjnMsn4B7-MMAVSSrqg/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvbmYyeDVj/bTh6b21hOGQxZ3pm/YXguUE5H" alt="Kubernetes" width="880" height="752"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Pods?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pods are the smallest deployable units in Kubernetes. A Pod represents a single instance of a running process or a group of tightly coupled processes running together on a single node. While containers are commonly used within Pods, Pods can also include multiple containers that share resources and network connectivity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/mc6Mmi3bxi_I49Syue3qtjo4Kob2px_zeqLSAl4EQZI/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvYmxmaWl4/NTVxdjRzeHloNmN5/YWYucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/mc6Mmi3bxi_I49Syue3qtjo4Kob2px_zeqLSAl4EQZI/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvYmxmaWl4/NTVxdjRzeHloNmN5/YWYucG5n" alt="Pods" width="880" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The purpose of a Pod is to provide a cohesive and isolated environment for containers to run and share resources, including storage, network, and inter-process communication. Containers within a Pod can communicate with each other via localhost, as they share the same network namespace.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>pods</category>
      <category>container</category>
    </item>
    <item>
      <title>Run a bash script from ansible</title>
      <dc:creator>Srikanth K N</dc:creator>
      <pubDate>Thu, 20 Jul 2023 13:38:42 +0000</pubDate>
      <link>https://www.debug.school/sreekannoth/run-a-bash-script-from-ansible-14l3</link>
      <guid>https://www.debug.school/sreekannoth/run-a-bash-script-from-ansible-14l3</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
---
- name: Install git package on Web servers
  hosts: web

  tasks:
  - name: install a package called git
    ansible.builtin.apt:
        name: "git"
        state: present
  - name: install a package called wget
    ansible.builtin.apt:
        name: "wget"
        state: present
  - name: Copy shell script
    ansible.builtin.copy:
      src: sree_input.sh
      dest: /usr/bin/sree_input.sh
  - name: assign executable permissions to a files
    ansible.builtin.file:
        path: /usr/bin/
        owner: root
        group: root
        mode: +x
  - name: run a bash script
    ansible.builtin.script: /usr/bin/sree_input.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Docker Essentials..</title>
      <dc:creator>Srikanth K N</dc:creator>
      <pubDate>Tue, 18 Jul 2023 12:06:54 +0000</pubDate>
      <link>https://www.debug.school/sreekannoth/docker-essentials-3a86</link>
      <guid>https://www.debug.school/sreekannoth/docker-essentials-3a86</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Docker and why is it used?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker is an App containerization and isolation tool.&lt;br&gt;
It maintains integrity of application environment.&lt;br&gt;
It saves hundreds of hours of developers time so they can focus only on building application.&lt;/p&gt;

&lt;p&gt;Docker can be used as a shareable environment between developers and between localhost and all other types of servers like QA, dev, prod the environment will remain same everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Docker image and how is it different from a Docker container?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker Image is an abstraction of a container. This is the file that explains to docker daemon as to what type of container has to be built. Think of this as the plan of a building. We can draw on paper, that the plan of a building will have these many things and from this the building is actually built. The building is the container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you create a Docker image and run a Docker container?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a docker image for any service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker create nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create required number of instances and provide unique names&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker create --name Sree1 nginx
docker create --name Sree2 nginx
docker create --name Sree3 nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run these instances by starting them&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker start Sree1
docker start Sree2
docker start Sree3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What is a Dockerfile and how do you use it to create a Docker image?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Dockerfile is a text file that contains a set of instructions used to build a Docker image. It serves as a blueprint for creating the image, specifying the base image, dependencies, environment variables, file copies, and runtime commands. Docker reads the Dockerfile to automate the image creation process.&lt;/p&gt;

&lt;p&gt;The Dockerfile typically consists of a series of instructions, each of which adds a new layer to the image. These layers are cached, allowing for efficient rebuilding and sharing of common layers across multiple images.&lt;/p&gt;

&lt;p&gt;Create a Dockerfile: Docker images are created based on a Dockerfile, which is a plain text file that contains instructions for building the image. Create a new file named "Dockerfile" (without any file extension) in your project directory.&lt;/p&gt;

&lt;p&gt;Define the base image: In the Dockerfile, start by specifying a base image on which your image will be built. For example, you can use a minimal Linux distribution like Alpine or a specific version of an operating system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM ubuntu:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install dependencies: If your application requires any dependencies, install them using package managers like apt-get (for Debian-based systems) or yum (for Red Hat-based systems). You can also copy files into the image using the COPY instruction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apt-get update &amp;amp;&amp;amp; apt-get install -y package1  package2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the working directory: Use the WORKDIR instruction to set the working directory inside the container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WORKDIR /app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy your application code: Copy the application code into the image using the COPY instruction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COPY . /app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Define the container runtime command: Use the CMD instruction to specify the command that should be executed when the container is run. This can be the command to start your application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CMD ["python", "app.py"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build the Docker image: Open a terminal or command prompt, navigate to the directory containing the Dockerfile, and run the following command to build the Docker image. Replace  with a desired name for your image and  with a version or label.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t &amp;lt;image-name&amp;gt;:&amp;lt;tag&amp;gt; .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run a Docker container: After successfully building the image, you can run a Docker container using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d --name &amp;lt;container-name&amp;gt; &amp;lt;image-name&amp;gt;:&amp;lt;tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! You've created a Docker image and run a Docker container based on that image. You can now access your application from the appropriate ports or interact with the running container as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can you inspect the contents of a Docker container and the changes made to a container while it was running?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Display detailed information on one or more images using &lt;em&gt;docker image inspect&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker image inspect [OPTIONS] IMAGE [IMAGE...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How can you share a Docker image with others and pull an image from a Docker registry?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To share Docker images, you have to use a Docker registry. The default registry is Docker Hub and is where all of the images you've used have come from. A Docker ID allows you to access Docker Hub which is the world's largest library and community for container images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the different network modes available in Docker and how do you choose the right network mode for your application?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker networking is the component that helps in establishing communication between containers. Docker comes with five main types of network drivers, which are elaborated on below.&lt;/p&gt;

&lt;p&gt;None: This driver will disable the entire networking system, hindering any container from connecting with other containers.&lt;/p&gt;

&lt;p&gt;Bridge: The Bridge is the default network driver for a container which is used when multiple containers communicate with the same Docker host.&lt;/p&gt;

&lt;p&gt;Host: There are stances when the user does not require isolation between a container and a host. The host network driver is used in that case, eradicating this isolation. &lt;/p&gt;

&lt;p&gt;Overlay: Overlay network driver allows communication between different swarm services when the containers run on different hosts. &lt;/p&gt;

&lt;p&gt;macvlan: This network driver makes a container look like a physical driver by assigning a mac address and routing the traffic between the containers through this mac address. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can you mount a volume in a Docker container and share data between the host and container?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The docker run command first creates a writeable container layer over the specified image and then starts using the specified command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the parameter -v allows you to bind a local directory.&lt;/p&gt;

&lt;p&gt;-v or --volume allows you to mount local directories and files to your container. For example, you can start a MySQL database and mount the data directory to store the actual data in your mounted directory.&lt;/p&gt;

&lt;p&gt;run mysql container in the background with a mounted volume&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --name mysql-db -v $(pwd)/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-se
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What is the difference between a Docker Compose file and a Dockerfile, and how are they used in deploying multi-container applications?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Dockerfile is a simple text file that contains the commands a user could call to assemble an image whereas Docker Compose is a tool for defining and running multi-container Docker applications.&lt;/p&gt;

&lt;p&gt;The contents of a Dockerfile describe how to create and build a Docker image, while docker-compose is a command that runs Docker containers based on settings described in a docker-compose.yaml file.&lt;/p&gt;

&lt;p&gt;Example of a docker-compose.yaml file&lt;/p&gt;

&lt;p&gt;For example, a docker-compose.yaml file that describes how to run the image created with the Dockerfile might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3.9'
services:
  my-nginx-service:
    container_name: my-website
    image: my-nginx-image:latest
    cpus: 1.5
    mem_limit: 2048m
    ports:
      - "8080:80"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How can you monitor the performance of a Docker container and diagnose issues with it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several ways to monitor Docker containers in real time.&lt;/p&gt;

&lt;p&gt;docker logs : View the logs of a running container.&lt;br&gt;
docker attach : Attach to a running container and view its output.&lt;br&gt;
docker top : View the running processes of a container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components of Docker and its Brief Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Components of Docker:&lt;/p&gt;

&lt;p&gt;The Docker components are divided into two categories; &lt;br&gt;
basic and advanced. &lt;/p&gt;

&lt;p&gt;The basic components include Docker client, Docker image, Docker Daemon, Docker Networking, Docker registry, and Docker container. &lt;/p&gt;

&lt;p&gt;Docker Compose and Docker swarm are the advanced components of Docker.&lt;/p&gt;

&lt;p&gt;Basic Docker Components:&lt;/p&gt;

&lt;p&gt;Lets dive into basic docker components:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Client:&lt;/strong&gt; The first component of Docker is the client, which allows the users to communicate with Docker. Being a client-server architecture, Docker can connect to the host remotely and locally. As this component is the foremost way of interacting with Docker, it is part of the basic components. Whenever a user gives a command to Docker, this component sends the desired command to the host, which further fulfils the command using the Docker API. If there are multiple hosts, then communicating with them is not an issue for the client as it can interact with multiple hosts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Image:&lt;/strong&gt; Docker images are used to build containers and hold the entire metadata that elaborates the capabilities of the container. These images are read-only binary templates in YAML. Every image comes with numerous layers, and every layer depends on the layer below it. The first layer is called the base layer, which contains the base operating system and image. The layer with dependencies will come above this base layer. These layers will have all the necessary instructions in read-only, which will be the Dockerfile. A container can be built using an image and can be shared with different teams in an organization through a private container registry. In case you want to share the same outside the organization, you can use a public registry for the same.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Daemon:&lt;/strong&gt; Docker Daemon is among the most essential components of Docker as it is directly responsible for fulfilling the actions related to containers. It mainly runs as a background process that manages parts like Docker networks, storage volumes, containers, and images. Whenever a container start up command is given through docker run, the client translates that command into an HTTP API call and returns it to the daemon. Afterwards, the daemon analyses the requests and communicates with the operating system. The Docker daemon will only respond to the Docker API requests to perform the tasks. Moreover, it can also manage other Docker services by interacting with other daemons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Networking:&lt;/strong&gt; As defined earlier in this post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Registry:&lt;/strong&gt; Docker images require a location where they can be stored and the Docker registry is that location. Docker Hub is the default storage location of images that stores the public registry. However, registries can either be private or public. Every time a Docker pull request is made, the image is pulled from the desired Docker registry where it was the same. On the other hand, Docker push commands store the image in the dedicated registry. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Container:&lt;/strong&gt; A Docker container is the instance of an image that can be created, started, moved, or deleted through a Docker API. Containers are a lightweight and independent method of running applications. They can be connected to one or more networks and create a new image depending on the current state. Being a volatile Docker component, any application or data located within the container will be scrapped the moment the container is deleted or removed. Containers mostly isolate each other and have defined resources. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between docker pause and unpause?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The docker pause and docker unpause commands are used to suspend and resume the execution of processes within a Docker container, respectively. They provide a way to temporarily halt the container's processes without stopping or terminating the container itself.&lt;/p&gt;

&lt;p&gt;docker pause - The docker pause command suspends all processes within a running container. When you pause a container, all processes within the container are frozen, and their execution is temporarily halted.&lt;/p&gt;

&lt;p&gt;To pause a container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pause my-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container remains in a paused state until you explicitly resume it or issue a docker unpause command.&lt;/p&gt;

&lt;p&gt;Pausing a container can be useful in scenarios where you need to temporarily halt the container's execution, such as during troubleshooting or to limit resource usage.&lt;/p&gt;

&lt;p&gt;docker unpause: The docker unpause command resumes the execution of processes within a paused container. It allows the container to continue running its processes from the point where they were paused.&lt;/p&gt;

&lt;p&gt;To resume a paused container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker unpause my-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the container is resumed, the processes inside it start executing again.&lt;/p&gt;

&lt;p&gt;It's important to note that the docker unpause command only affects containers that are currently in a paused state. If you try to unpause a container that is not paused, it has no effect.&lt;/p&gt;

&lt;p&gt;In summary, docker pause suspends the execution of processes within a container, while docker unpause resumes their execution, allowing the container to continue running from the point where it was paused. These commands provide a way to temporarily halt and resume a container's processes without stopping or terminating the container itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between docker stop and kill?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The docker stop and docker kill commands are both used to stop Docker containers, but they differ in how they handle the termination process:&lt;/p&gt;

&lt;p&gt;docker stop: The docker stop command is used to gracefully stop a running container. When you issue a docker stop command, Docker sends a SIGTERM signal to the main process running inside the container, allowing it to perform any necessary cleanup or shutdown tasks.&lt;/p&gt;

&lt;p&gt;For example, to stop a container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop my-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container receives the SIGTERM signal and has a chance to handle it before shutting down. By default, Docker allows a grace period of 10 seconds for the container to stop gracefully. If the container does not stop within that timeframe, Docker proceeds with a forced termination.&lt;/p&gt;

&lt;p&gt;docker kill: The docker kill command is used to forcefully stop a running container. It sends a SIGKILL signal to the container's main process, immediately terminating it without any chance for cleanup or shutdown tasks.&lt;/p&gt;

&lt;p&gt;To kill a container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker kill my-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a container is killed with docker kill, it is abruptly stopped, and any processes running inside the container are terminated immediately.&lt;/p&gt;

&lt;p&gt;In summary, docker stop allows a container to perform cleanup tasks by sending a SIGTERM signal and waiting for a specified grace period. On the other hand, docker kill forcefully terminates a container by sending a SIGKILL signal without allowing the container to perform any cleanup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between docker exec and attach?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The docker exec and docker attach commands are used to interact with running Docker containers, but they serve different purposes:&lt;/p&gt;

&lt;p&gt;docker exec: The docker exec command allows you to run a new command or script inside a running container. It provides a way to execute commands in an existing container without starting a new shell session.&lt;/p&gt;

&lt;p&gt;For example, to run a shell command inside a container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec my-container &amp;lt;command&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts a new process within the container and executes the specified . The output of the command is displayed in the terminal where you ran the docker exec command. It does not attach to the container's standard input or output streams, allowing you to run commands in the background.&lt;/p&gt;

&lt;p&gt;docker attach: The docker attach command attaches your terminal's standard input, output, and error streams to a running container. It connects to the main process running in the container, typically the process that was started when the container was launched.&lt;/p&gt;

&lt;p&gt;To attach your terminal to a container named "my-container," you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker attach my-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once attached, any input/output from the container is directly displayed in your terminal, and you can interact with the running process inside the container. Exiting the attached terminal session usually terminates the container unless the process running inside the container keeps running independently.&lt;/p&gt;

&lt;p&gt;It's important to note that when attaching to a container using docker attach, you are directly connected to the running process, and detaching from the terminal (e.g., by pressing Ctrl+C) will stop the container.&lt;/p&gt;

&lt;p&gt;In summary, docker exec allows you to execute a command inside a running container without attaching to its standard streams, while docker attach connects your terminal to a running container, enabling you to interact with the container's primary process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;List of dockerfile instructions and its Brief Summary?&lt;/strong&gt;&lt;br&gt;
Here's an overview of some commonly used instructions in a Dockerfile:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FROM:&lt;/strong&gt; Specifies the base image on which your image will be built.&lt;br&gt;
&lt;strong&gt;RUN:&lt;/strong&gt; Executes commands during the image build process, such as installing dependencies or configuring the environment.&lt;br&gt;
&lt;strong&gt;COPY or ADD:&lt;/strong&gt; Copies files or directories from the host machine into the image.&lt;br&gt;
&lt;strong&gt;WORKDIR:&lt;/strong&gt; Sets the working directory inside the container.&lt;br&gt;
&lt;strong&gt;ENV:&lt;/strong&gt; Sets environment variables for the container.&lt;br&gt;
&lt;strong&gt;EXPOSE:&lt;/strong&gt; Informs Docker that the container will listen on specific ports at runtime.&lt;br&gt;
&lt;strong&gt;CMD or ENTRYPOINT:&lt;/strong&gt; Defines the command to be executed when a container is run from the image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between CMD vs Entry&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CMD:&lt;/strong&gt; Sets default parameters that can be overridden from the Docker command line interface (CLI) while running a docker container. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ENTRYPOINT:&lt;/strong&gt; Sets default parameters that cannot be overridden while executing Docker containers with CLI parameters.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>containers</category>
      <category>dockerfile</category>
      <category>registry</category>
    </item>
    <item>
      <title>Terraform Code</title>
      <dc:creator>Srikanth K N</dc:creator>
      <pubDate>Mon, 17 Jul 2023 11:54:25 +0000</pubDate>
      <link>https://www.debug.school/sreekannoth/terraform-code-3kgf</link>
      <guid>https://www.debug.school/sreekannoth/terraform-code-3kgf</guid>
      <description>&lt;p&gt;Terraform code to create an EC2 instance that would use a Security group that would allow SSL and Web traffic&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Variable Block

variable "sreevar" {
    type = "map"
    default = {
    region = "us-east-1"
    vpc = "vpc-5234832d"
    ami = "ami-0c1bea58988a989155"
    itype = "t2.micro"
    subnet = "subnet-81896c8e"
    publicip = true
    keyname = "SreeSecKey"
    secgroupname = "SreeSG"
  }
}

provider "aws" {
  region = lookup(var.sreevar, "region")
}

  resource "aws_security_group" "SG_Web_SSL" {
  name = lookup(var.sreevar, "secgroupname")
  description = "Allow Web and SSL traffic"
  vpc_id = lookup(var.sreevar, "vpc")

  // To Allow SSH Transport
  ingress {
    from_port = 22
    protocol = "tcp"
    to_port = 22
    cidr_blocks = ["0.0.0.0/0"]
  }

  // To Allow Port 80 Transport
  ingress {
    from_port = 80
    protocol = "tcp"
    to_port = 80
    cidr_blocks = ["0.0.0.0/0"]
  }

// To Allow outbound traffic
  egress {
    from_port       = 0
    to_port         = 0
    protocol        = "-1"
    cidr_blocks     = ["0.0.0.0/0"]
  }

 tags = {
    Name = "allow_web_ssl"
  }

  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_instance" "project-sree" {
  ami = lookup(var.sreevar, "ami")
  instance_type = lookup(var.sreevar, "itype")
  subnet_id = lookup(var.sreevar, "subnet")
  associate_public_ip_address = lookup(var.sreevar, "publicip")
  key_name = lookup(var.sreevar, "keyname")

  tags = {
    Name ="SREE-SERVER"
    Environment = "Dev"
    OS = "UBUNTU"
    Managed = "Identity-Managed"
  }

  vpc_security_group_ids = [aws_security_group.SG_Web_SSL.id] 

  depends_on = [ aws_security_group.SG_Web_SSL ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>terraform</category>
      <category>securitygroup</category>
      <category>ec2</category>
      <category>key</category>
    </item>
    <item>
      <title>A Mindset Change..</title>
      <dc:creator>Srikanth K N</dc:creator>
      <pubDate>Thu, 13 Jul 2023 17:19:24 +0000</pubDate>
      <link>https://www.debug.school/sreekannoth/a-mindset-change-330e</link>
      <guid>https://www.debug.school/sreekannoth/a-mindset-change-330e</guid>
      <description>&lt;p&gt;If you’re not changing, you’re not growing. If you’re not growing, you’re not being intelligent. Humans thrive in change and expansion — yet there can be so many internal or external blocks to change.&lt;/p&gt;

&lt;p&gt;Trying to keep things as they are is a very unhealthy approach to life. Avoiding change reflects a misunderstanding of the human condition and human flourishing. Change is not to be avoided, but embraced..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/8pU3gzhleZCjRIpcLIw1mj5V-S3cghJtteLHEiZ433U/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvN2pwbXc4/enFuN2duano5OGZk/OGwuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/8pU3gzhleZCjRIpcLIw1mj5V-S3cghJtteLHEiZ433U/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvN2pwbXc4/enFuN2duano5OGZk/OGwuanBn" alt="Embrace Change" width="768" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the IT parlance, change can be viewed as a product release. It can be organization transformation, an infrastructure shift, a new service, or a feature release to a classically developed product. &lt;/p&gt;

&lt;p&gt;All of these can benefit from &lt;strong&gt;MVE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;MVE is Minimal Viable Everything..&lt;/p&gt;

&lt;p&gt;Consider every big change that you are attempting to achieve and then, slice it down to that which is minimally viable. Implement that minimum viable thing, collect feedback from its related consumers, then correct and continue as appropriate.&lt;/p&gt;

&lt;p&gt;If you are figuring out how to transform from a classic IT organization to a DevOps organization, start by considering the minimally viable DevOps organization. &lt;/p&gt;

&lt;p&gt;That brings us to the question..&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DevOps in simple terms?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s just a catchy way of saying &lt;em&gt;&lt;strong&gt;we deliver with Minimum Viable Process using lean techniques to drive waste out of the system.&lt;/strong&gt;&lt;/em&gt; It requires shared goals and shared pain throughout the IT value stream.&lt;/p&gt;

&lt;p&gt;Now that we know of MVP, what is the lean technique to drive waste out of the system?&lt;/p&gt;

&lt;p&gt;We all want to spend less time in overhead work like meetings, compliance, documentation, late rework, waiting and progress reporting. And we want to spend less time in manual tasks that can be automated. By avoiding these sources of waste AND by steering with continuous feedback and advanced analytics, we can improve the economics and add value to the service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What exactly does DevOps do?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps is all about rebooting deep-rooted cultural habits, transforming old processes and ensuring all changes are made for the right reasons. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/J-6IuUuDB1zQfdKW6W0J9UpxdWOu4p7aTu3s8tl4Evg/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMveWtyZ3By/cmMwdHllMmo1YWVs/cWcuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/J-6IuUuDB1zQfdKW6W0J9UpxdWOu4p7aTu3s8tl4Evg/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMveWtyZ3By/cmMwdHllMmo1YWVs/cWcuanBn" alt="DevOps" width="814" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Don’t embrace DevOps for the sake of it. Only proceed if you have clarity and purpose.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the challenges in DevOps implementation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The challenges and risks for DevOps implementation include cultural resistance to change, lack of communication and collaboration between teams, lack of standardization and automation, security and compliance risks, and difficulties in measuring success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Misnomer and / or Anti pattern??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have read and come this far and think DevOps is a simple thing to understand and implement..well..Organizations do fell into this trap..&lt;/p&gt;

&lt;p&gt;With software buzzwords that people focus so much on what something is that they forget what it is not. DevOps is no exception and this happens when you ask to summarize an extensive concept in a few words. &lt;/p&gt;

&lt;p&gt;This anti-pattern is a classic example of why one has to dive deep into something before jumping to conclusions — because        &lt;strong&gt;“Dev + Ops = DevOps”&lt;/strong&gt; is the sort of answer that’ll probably earn you only grace marks in an exam. It’s not DevOps just because you combine your development and operations teams and call it DevOps.&lt;/p&gt;

&lt;p&gt;Some common Anti patterns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agile and DevOps Are the Same&lt;/li&gt;
&lt;li&gt;DevOps Is All About the Tools&lt;/li&gt;
&lt;li&gt;You Need a Dedicated DevOps Team&lt;/li&gt;
&lt;li&gt;DevOps Gets Rid of Operations&lt;/li&gt;
&lt;li&gt;DevOps Is Only About Automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What are the list of DevOps Tools?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well I won't delve into listing out all that is available by dozens of DevOps tool..I would rather present a picture below worth a thousand words..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/GwSp-3GM90gkzqWW1I-Vw3uiqfG34QHEWbp1qfuT7tc/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvZHFwdzVl/M3F5bW44MTZ1bDVn/OWMucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/GwSp-3GM90gkzqWW1I-Vw3uiqfG34QHEWbp1qfuT7tc/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvZHFwdzVl/M3F5bW44MTZ1bDVn/OWMucG5n" alt="DevOps Tools" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DevSecOps?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Phew..Just when you have had enough of technical Jargon..I irritate you with another argot..!!&lt;/p&gt;

&lt;p&gt;Relax.. I will simplify...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/QFGYm3LfAEtsiatzm73jX9r2iT_6WrHy5PlNdpA--VE/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvazJiZGp4/bnZ3MzFkMnpubHY4/Y3AuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/QFGYm3LfAEtsiatzm73jX9r2iT_6WrHy5PlNdpA--VE/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvazJiZGp4/bnZ3MzFkMnpubHY4/Y3AuanBn" alt="DevSecOps" width="680" height="917"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DevOps has a focus on efficiency while DevSecOps focuses on security. DevSecOps builds upon DevOps to address vulnerability at every stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How DevOps and SRE are different?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simple rule to differentiate SRE from DevOps is:&lt;/p&gt;

&lt;p&gt;If your engineering team has &lt;strong&gt;reliability/performance/uptime&lt;/strong&gt; requirements that need someone to carry that torch on top of feature development : You might need an &lt;strong&gt;SRE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/R8_mZsnTOlTiXFrwUwi_lURgEfsZWZF_SNSBG88tzxo/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvaTk5b29y/eGoxcDNsMTAyODBz/N3cuanBlZw" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/R8_mZsnTOlTiXFrwUwi_lURgEfsZWZF_SNSBG88tzxo/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvaTk5b29y/eGoxcDNsMTAyODBz/N3cuanBlZw" alt="SRE" width="853" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At a higher level, the SRE team serves as a bridge between development teams and operations teams, enabling the development team to bring new software or new features to production as quickly as possible, while also ensuring an agreed-upon acceptable level of IT operations performance and error risk in line with the service level agreements (SLAs) the organization has in place with its customers. &lt;/p&gt;

&lt;p&gt;Based on their experience and a wealth of operations data, the SRE team helps the development and operations teams establish&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Service level indicators (SLIs)&lt;/li&gt;
&lt;li&gt;    Service level objectives (SLOs)&lt;/li&gt;
&lt;li&gt;    Error budgets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this &lt;a href="https://www.googblogs.com/sre-vs-devops-competing-standards-or-close-friends/"&gt;article&lt;/a&gt; from Google, the company behind SRE concept, they state that SREs can use DevOps practice, but they don't necessarily have to. Maybe that's where the confusion comes from?&lt;/p&gt;

&lt;p&gt;On a day-to-day, Site Reliability Engineers do not answer to the same hierarchy of other software engineers, so they should not be biased by any feature delivery, yet, their responsibility is to guarantee the uptime or any other SLA from their teams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what's your resolution??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hmm..So you have Agile, DevOps, DevSecOps, SRE and many options to choose from..What would be your choice.??&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/rv2js0PvU25CdWDUepX3yGymHve9d0XKFJ2Wa0gHnu0/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvcWFvaTBr/NHg1c3BtYXVwaXFn/djAuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/rv2js0PvU25CdWDUepX3yGymHve9d0XKFJ2Wa0gHnu0/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvcWFvaTBr/NHg1c3BtYXVwaXFn/djAuanBn" alt="Resolution" width="408" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whatever be your choice, if it need to bear you the fruits, you must first have a change in your mindset..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debug.school/images/3TYvxvemtiAZyxuj5AMdP8iazbNwlA2FVrnxtaO-JJQ/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvaDdkeWlo/aDQ1bDFiazBidjY2/OWwuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://www.debug.school/images/3TYvxvemtiAZyxuj5AMdP8iazbNwlA2FVrnxtaO-JJQ/w:880/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvYXJ0/aWNsZXMvaDdkeWlo/aDQ1bDFiazBidjY2/OWwuanBn" alt="Growth Mindset" width="520" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Srikanth K N&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devsecops</category>
      <category>sre</category>
      <category>agile</category>
    </item>
  </channel>
</rss>
