A pod is the smallest execution unit 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. Pods can communicate with each other by using another pods IP address or by referencing a resource that resides in another pod. Pods are created by workload resources called controllers, which manage rollout, replication, and health of pods in the cluster.Read more
A Kubernetes cluster consists of a set of worker machines, called nodes, that run containerized applications. Every cluster has at least one worker node.he worker node(s) host the Pods that are the components of the application workload. The control plane manages the worker nodes and the Pods in the cluster. kubelet An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod.The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described inRead more
Kubernetes – Master Machine Components API Server Kubernetes is an API server which provides all the operation on cluster using the API. Controller Manager This component is responsible for most of the collectors that regulates the state of cluster and performs a task and is responsible for collecting and sending information to API server. Scheduler This is one of the key components of Kubernetes master. It is a service in master responsible for distributing the workload. It is responsible forRead more
Pod — collection of containers 3.Scaling 4.Provides additional services: as well as the management of containers, Kubernetes offers security, networking and storage services 5.Storage orchestration: Kubernetes mounts and add storage system of your choice to run apps 6.Container balancing: Kubernetes always knows where to place containers, by calculating the “best location” for themRead more
Write an example dockerfile with 2 CMD, 2 ENTRYPOINT and 1 CMD/1 ENTRYPOINT and write down behavior of it.
root@ip-172-31-28-155:/home/ubuntu/srm# cat dockerfile_multiFROM ubuntuMAINTAINER Rajesh Kumar << email@example.com>>ENV DEBIAN_FRONTEND=noninteractiveRUN apt-get updateRUN apt-get -y install tzdataRUN apt-get install git -y && apt-get install -yq apache2CMD echo “Hello CMD kp”ENTRYPOINT [“/bin/echo”, “Hello Entry kannan”] root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image_multiHello Entry kannan /bin/sh -c echo “Hello CMD kp” root@ip-172-31-28-155:/home/ubuntu/srm# cat dockerfile_multiFROM ubuntuMAINTAINER Rajesh Kumar << firstname.lastname@example.org>>ENV DEBIAN_FRONTEND=noninteractiveRUN apt-get updateRUN apt-get -y install tzdataRUN apt-get install git -y && apt-get install -yq apache2CMD echo “Hello CMD kp”CMD echo “Hello CMD kannan” root@ip-172-31-28-155:/home/ubuntu/srm# docker runRead more
FROM : Set base image MAINTAINER : Author of docker file RUN : Run the commands in new layer VAR : Used to set variable, we can re-use these variables later EXPOSE : specify port of the container COPY : Copy files to the container ADD : copy files into container and extract it USER : Set the runtime user ENV : set environment variable CMD : to set PID1 ENTRY POINT : to set PID1 WORK DIR : setRead more
All layers in a docker image is Read only. All layers in an image is merged to one layer while creating the container.. Docker image is a collection of files systems. A docker image is a template for docker container. One docker image can be used to create multiple containers File systems are layered over each other Layer 0 have the root filesystem Each layer in image will have 40 character length UUID generated by SHA 256 algorithm.Read more
Docker uses storage drivers to store image layers, and to store data in the writable layer of a container. The container’s writable layer does not persist after the container is deleted, but is suitable for storing ephemeral data that is generated at runtime. Storage drivers are optimized for space efficiency, but (depending on the storage driver) write speeds are lower than native file system performance, especially for storage drivers that a use copy-on-write filesystemRead more
List of Top 5 docker images from hub.docker.com and create a running container of it and try to use it.
The docker update command dynamically updates container configuration.Read more
The wait command will wait until a container stops and then print their exit codes.eg docker run –name kphttpd httpd docker wait kphttpd docker kill kphttpdRead more
Q1. Explain What is Docker Container with image? Docker container with image is an executable software package built on top of its own root file system. Every docker image will have its own docker container. Q2. What is the difference between docker stop and docker kill? ‘stop’ commands does graceful shutdown….where ‘kill’ command does a forceful kill. The status code will be different for both eventhough the status is same (Exited) after stop command, exit code is 0 Q3. WhatRead more