Inno I- Docer/k8s Flashcards

1
Q

What is Docker and what are its key features?

A

Docker is an open platform for developing, shipping, and running applications. Key features include:

Containerization: Packages applications with all dependencies

Lightweight: Containers share the host OS kernel, reducing overhead

Portability: Runs consistently across different environments

Fast deployment: Containers start in seconds

Version control: Allows easy tracking of image versions

Isolation: Provides secure, isolated environments for applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Docker Compose and how does it enhance Docker functionality?

A

Docker Compose is a tool for defining and running multi-container Docker applications. It enhances Docker by:

Using YAML files to configure application services

Simplifying management of multiple containers

Automating container creation and startup

Facilitating easy scaling of services

Providing built-in networking between containers

Enabling persistent volume management

Supporting environment variables for flexible configurations

Streamlining development, testing, and deployment workflows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Docker?

A

Docker is an open platform for developing, shipping, and running applications2. It enables developers to:

Package applications with all dependencies

Separate applications from infrastructure

Deliver software quickly

Manage infrastructure and applications similarly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the key components of Docker?

A

The key components of Docker are:

Docker Engine: Core component for running and managing containers

Docker Daemon (dockerd): Listens for Docker API requests and manages Docker objects

Docker Client: Primary way users interact with Docker through commands

Docker Desktop: Easy-to-install application for Mac, Windows, or Linux

Docker Hub: Centralized repository for sharing and distributing container image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does Docker differ from virtual machines?

A

Docker containers differ from virtual machines (VMs) in the following ways1:

Containers share the host OS kernel, while VMs run on hypervisors with full guest OS

Containers are lightweight and start in milliseconds; VMs are heavier and take longer to boot

Docker allows running multiple containers on a single host with less overhead

Containers provide better performance and resource utilization compared to VMs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is containerization in Docker?

A

Containerization in Docker1:

Packages applications and dependencies into isolated units called containers

Leverages the host operating system’s kernel

Allows multiple containers to run simultaneously on a single machine

Provides consistent environments across development, testing, and production

Eliminates the “it works on my machine” problem

Enhances portability across various platforms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Docker achieves strong isolation between containers by1:

A

**Utilizing Linux features like namespaces and control groups (cgroups)
**

Running each container in its own isolated environment

Preventing processes in one container from interfering with others

Employing user namespaces to map container root users to unprivileged host users

Allowing resource limits on containers to maintain system stability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the benefits of using Docker?

A

Benefits of using Docker include:

Fast, consistent delivery of applications

Responsive deployment and scaling

Running more workloads on the same hardware

Simplified application development and management

Portability across different environments

Isolation and security for running multiple containers

Efficient use of system resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Docker Compose?

A

Docker Compose is a tool for:

Defining and running multi-container Docker applications

Managing complex applications using a single YAML file

Simplifying the orchestration and coordination of various services

Streamlining development, deployment, and management of containerized applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the key features of Docker Compose?

A

Key features of Docker Compose include:

YAML-based configuration

Service definition

Container networking

Scalability and load balancing

Volume management

Environment variables support

Inter-container communication

Compose CLI for managing application stacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Docker Compose simplify application management?

A

Docker Compose simplifies application management by:

Allowing definition of multi-container applications in a single YAML file

Providing a unified way to manage services, networks, and volumes

Enabling easy sharing of application configurations among team members

Supporting variables for customizing compositions across environments

Offering caching of configurations for faster container creation

Allowing rapid prototyping and iteration in development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are common use cases for Docker Compose?

A

Common use cases for Docker Compose include:

Development environments: Quickly setting up isolated environments

Automated testing: Creating and destroying test environments easily

Single host deployments: Managing multiple services on a single machine

CI/CD workflows: Supporting continuous integration and deployment processes

Prototyping: Rapidly creating and testing multi-container applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does Docker Compose handle networking?

A

Docker Compose handles networking by:

Creating a default bridge network for all services to communicate

Allowing definition of custom networks for better control

Providing built-in network isolation for containers

Simplifying the setup of microservices architectures

Enabling seamless communication between containers within the same Compose proje

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you define services in a Docker Compose file?

A

Services in a Docker Compose file are defined under the services section. A basic service definition includes:

Image or build instructions

Ports to expose

Environment variables

Volumes

Networks

Dependencies on other services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does Docker Compose handle service dependencies?

A

Docker Compose handles service dependencies using the depends_on option7. This ensures that dependent services start in the correct order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the essential Docker commands for managing containers?

A

docker run: Create and start a container

docker ps: List running containers

docker ps -a: List all containers (including stopped ones)

docker stop: Stop a running container

docker start: Start a stopped container

docker rm: Remove a container

docker logs: View container logs

docker exec: Execute a command in a running container

17
Q

How do you build and manage Docker images?

A

docker build: Build an image from a Dockerfile

docker images: List available images

docker pull: Download an image from a registry

docker push: Upload an image to a registry

docker rmi: Remove an image

docker tag: Tag an image with a name and optional tag

18
Q

What is a Docker image?

A

A Docker image is a read-only template containing a set of instructions for creating a container. It includes the application code, runtime, libraries, environment variables, and config files needed to run an application.

19
Q

What is a Docker container?

A

A Docker container is a runnable instance of a Docker image. It’s a lightweight, standalone, executable package that includes everything needed to run an application, including the code, runtime, system tools, libraries, and settings.

20
Q

What is a Dockerfile?

A

A Dockerfile is a text file containing instructions for building a Docker image. It specifies the base image, adds application code, sets environment variables, installs dependencies, and configures the container’s behavior.

21
Q

What is Docker Hub?

A

Docker Hub is a cloud-based registry service provided by Docker for storing and sharing container images. It offers both public and private repositories, allowing users to push, pull, and manage Docker images.

22
Q

What is a Docker volume?

A

A Docker volume is a mechanism for persisting data generated by and used by Docker containers. Volumes are stored in a part of the host filesystem managed by Docker and are independent of the container’s lifecycle, allowing data to persist even after a container is removed.

23
Q

What is a Kubernetes Cluster?

A

A Kubernetes Cluster is a set of worker machines, called nodes, that run containerized applications orchestrated by a control plane. It consists of:

One or more worker nodes

A control plane (also called the Kubernetes master)

Various components for managing the cluster’s state and operations

24
Q

What are the main components of the Kubernetes Control Plane?

A

The Kubernetes Control Plane includes:

kube-apiserver: Exposes the Kubernetes HTTP API

etcd: Consistent and highly-available key-value store for all API server data

kube-scheduler: Assigns Pods to suitable nodes

kube-controller-manager: Runs controllers to implement Kubernetes API behavior

cloud-controller-manager (optional): Integrates with underlying cloud providers

25
What are Node Components in Kubernetes?
Node Components run on every node, maintaining running pods and providing the Kubernetes runtime environment: kubelet: Ensures that Pods are running, including their containers kube-proxy: Maintains network rules on nodes to implement Services Container runtime: Software responsible for running containers (e.g., Docker)
26
What is a Pod in Kubernetes?
A Pod is: The smallest deployable unit in Kubernetes A group of one or more containers treated as a single entity **Shares an IP address and has its own filesystem namespace** Usually runs a single primary container, but can include sidecar containers for additional functionality
27
What is a Kubernetes Controller?
A Kubernetes Controller is: A non-terminating control loop that manages components and workloads Responsible for moving the application from its current state towards the desired state Examples include node controller, replication controller, and endpoints controller Managed by the kube-controller-manager
28
What is a Kubernetes Deployment?
A Kubernetes Deployment is: A resource that defines how many replicas of a pod should be running Specifies how pods should be updated Provides labels for easy reference Allows for automated rollouts, scaling, and rollbacks of applications
29
What are Kubernetes Namespaces?
Kubernetes Namespaces are: A way to divide cluster resources between multiple users or projects Used to enhance Role-Based Access Controls (RBAC) Create isolation between projects, teams, and different stages of an application's lifecycle Help organize and identify sets of Kubernetes objects
30
What is Kubernetes Service Discovery?
Kubernetes Service Discovery is: The process of automatically locating applications and services on a network Allows containers to find and communicate with each other Implemented through Kubernetes Services, which provide a stable IP address and DNS name for a set of pods
31
What is a Kubernetes Ingress?
A Kubernetes Ingress is: An API object that allows external traffic to access services in your Kubernetes cluster Manages external access to services, typically HTTP Can provide load balancing, SSL termination, and name-based virtual hosting
32
Basic Concepts of Kubernetes
Kubernetes is an open-source c**ontainer orchestration platform** designed to automate the deployment, scaling, and management of containerized applications. Here are some key concepts: Cluster: **A set of worker machines (nodes)** that run containerized applications **Control Plane: Manages** the cluster state and desired configuration **Nodes**: Worker machines that run pods Pods: The smallest deployable units in Kubernetes, containing one or more containers Services: An abstract way to expose an application running on a set of pods Deployments: Describe the desired state for pods and replicas
33
Kubernetes vs Docker Compose
While both tools manage containerized applications, Kubernetes offers several advantages over Docker Compose: **Scalability**: Kubernetes can manage applications across multiple hosts, while Docker Compose is primarily for single-host deployments **Auto-scaling**: Kubernetes can automatically scale deployments based on resource utilization **Self-healing**: Kubernetes automatically restarts failed containers and replaces or reschedules containers when nodes die **Load balancing**: Kubernetes provides built-in load balancing for distributed applications **Production-ready**: Kubernetes is designed for production environments, while Docker Compose is often used for local development and testing
34
Why You Need Kubernetes
Kubernetes becomes necessary when: You need to manage complex, distributed systems Your application requires high availability and fault tolerance You want to automate deployment, scaling, and operations of application containers You need to manage workloads across multiple cloud providers or on-premises infrastructure
35
What Kubernetes Does
Kubernetes provides several key features: **Container orchestration**: Manages the lifecycle of containers across multiple hosts **Service discovery** and load balancing: Exposes containers using DNS or IP addresses and distributes network traffic **Storage orchestration**: Automatically mounts storage systems of your choice Automated rollouts and **rollbacks**: Changes the state of existing containers to a desired state at a controlled rate **Batch execution**: Manages batch and CI workloads, replacing containers that fail **Horizontal scaling:** Scales applications up and down easily with a command, UI, or automatically based on CPU usage
36
What Kubernetes Doesn't Do
Despite its power, Kubernetes has limitations: Container image management: Kubernetes doesn't have built-in tools for storing or managing container images Application-level services: It doesn't provide middleware, data-processing frameworks, databases, or other application-level services Logging, monitoring, alerting: While it can integrate with these systems, Kubernetes doesn't provide comprehensive built-in solutions Built-in security scanning: Kubernetes doesn't scan container images for vulnerabilities or prevent malware inside containers Host security: Beyond basic pod security policies, Kubernetes doesn't manage host-level security Container registry security: Kubernetes integrates with registries but doesn't ensure their security configuration
37