DEV Community

Cover image for What is Docker and Kubernetes ?
Nitesh Thapliyal
Nitesh Thapliyal

Posted on

What is Docker and Kubernetes ?

In this blog we will discuss about following topics:

  • Docker
  • Container
  • Docker image
  • Kubernetes
  • Pod
  • Service
  • Ingress
  • Namespace

What is Docker?

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

Docker

What is Container?

Containers are packages of software that contain all of the necessary elements to run in any environment. In this way, containers virtualize the operating system and run anywhere, from a private data center to the public cloud or even on a developer’s personal laptop. From Gmail to YouTube to Search, everything at Google runs in containers.Containerization allows our development teams to move fast, deploy software efficiently, and operate at an unprecedented scale.

Containers are lightweight packages of your application code together with dependencies such as specific versions of programming language runtimes and libraries required to run your software services.

Cotainer

What is Docker image?

In Docker, everything is based on Images. An image is a combination of a file system and parameters. Let’s take an example of the following command in Docker

sudo docker run -it centos
Enter fullscreen mode Exit fullscreen mode

To see the list of Docker images on the system, you can issue the following command.

docker images
Enter fullscreen mode Exit fullscreen mode

What is Dockerfile?

Dockerfile is a simple text file that consists of instructions to build Docker images.

Example:

FROM python:alpine3.7
COPY ./app
WORKDIR /app
RUN pip install requirements.txt
EXPOSE 5001
ENTRYPOINT ["python","app.py"]
Enter fullscreen mode Exit fullscreen mode

What is Kubernetes?

Kubernetes also known as “k8s” or “kube” is a container orchestration platform for scheduling and automating the deployment, management, and scaling of containerized applications.

Kubernetes

what is POD?

Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.

A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers.

To check the pods in kubernetes use command:

kubectl get pods
Enter fullscreen mode Exit fullscreen mode

POD

What is service?

A service can be defined as a logical set of pods. It can be defined as an abstraction on the top of the pod which provides a single IP address and DNS name by which pods can be accessed. With Service, it is very easy to manage load balancing configuration. It helps pods to scale very easily.

A service is a REST object in Kubernetes whose definition can be posted to Kubernetes apiServer on the Kubernetes master to create a new instance.

To check the service use command:

kubectl describe serice
Enter fullscreen mode Exit fullscreen mode

What is Ingress?

Ingress is a load balancer for Kubernetes, the main purpose of ingress is to expose the HTTPS and HTTP routes that are outside the cluster to the services within the cluster itself. By the use of ingress controller, we can also define the rules which can turn control the traffic routing.

Ingress

What is Namespace?

Kubernetes objects like pods and containers live in namespaces, essentially a namespaces is a way to organize objects in your kubernetes cluster

Namespaces is a very useful tool if you have many different type of applications running or if you have multiple teams that share the cluster.

Hope you find this blog insightful 🌟

Reference:

  • Kubernetes docs
  • Tutorial point

Top comments (0)