Kubernetes Flashcards
What is Kubernetes, and who initially created it?
Kubernetes, often abbreviated as K8s, is an open-source container orchestration platform for automating the deployment, scaling, and management of containerized applications. It was initially created by Google.
What is the primary role of the Kubernetes API server?
The Kubernetes API server is responsible for exposing the Kubernetes API, acting as the communication point between clients and the Kubernetes cluster. It allows users to interact with the cluster to manage applications and resources.
What is Cube CTL (kubectl), and what is its purpose?
Cube CTL, often referred to as kubectl, is the Kubernetes command-line interface. Its purpose is to manage Kubernetes clusters, deploy applications, inspect cluster resources, and interact with the Kubernetes API server.
What is a Kubernetes context, and why is it useful?
A Kubernetes context is a group of access parameters that allow you to connect to a specific Kubernetes cluster. It includes the cluster name, user, and namespace. Contexts are useful for managing connections to multiple clusters and specifying which cluster kubectl commands should target.
What are some of the primary functionalities that Kubernetes provides?
Kubernetes provides functionalities such as service discovery, load balancing, rolling updates, scaling, container orchestration, and automated deployment management.
How can you check if your Kubernetes installation is running correctly using kubectl?
You can use the command kubectl cluster-info to check if your Kubernetes installation is running correctly. It will display information about the Kubernetes master and the services it exposes.
What is the purpose of a Kubernetes context, and how does it help manage multiple clusters?
A Kubernetes context is used to specify which cluster, user, and namespace should be used for kubectl commands. It helps manage multiple clusters by allowing users to switch between different contexts, making it easier to work with different clusters.
What is the default location for the kubectl configuration file, and what does it contain?
The default location for the kubectl configuration file is ~/.kube/config. This file contains information about clusters, users, and contexts, allowing kubectl to connect to the correct Kubernetes clusters.
How can you list the available contexts in kubectl, and how can you switch between them?
You can list available contexts using the command kubectl config get-contexts. To switch between contexts, you can use the kubectl config use-context command followed by the context name.
What is the role of the Kubernetes API server, and why is it a critical component of a Kubernetes cluster?
The Kubernetes API server acts as the central communication point for clients (such as kubectl) and the Kubernetes cluster. It exposes the Kubernetes API, allowing users to manage cluster resources. It is a critical component because all cluster operations go through the API server.
What are worker nodes in a Kubernetes cluster, and what role do they play?
Worker nodes are machines in a Kubernetes cluster responsible for running containers. They execute the tasks assigned by the Kubernetes master, such as running pods and containers.
What is a pod in Kubernetes, and why is it the smallest deployable unit?
A pod is the smallest deployable unit in Kubernetes, representing a single instance of a running process. It can contain one or more containers sharing the same network and storage resources.
How can you check the status of a Kubernetes cluster using kubectl?
ou can use the command kubectl cluster-info to check the status of a Kubernetes cluster. It displays information about the cluster’s master and services.
What is kubectl, and what is its primary purpose?
Kubectl is the Kubernetes command-line tool used to interact with a Kubernetes cluster. Its primary purpose is to manage and control Kubernetes resources.
How can you list all the available contexts in your kubectl configuration?
You can list all available contexts in your kubectl configuration using the command kubectl config get-contexts.
What is a Kubernetes context, and why is it useful?
A Kubernetes context is a group of access parameters that specify which cluster, user, and namespace should be used for kubectl commands. It is useful for managing multiple clusters and environments.
How can you switch between different Kubernetes contexts?
You can switch between different Kubernetes contexts using the kubectl config use-context command followed by the context name.
What are some options for running Kubernetes locally on your desktop or laptop?
You can run Kubernetes locally using tools like Docker Desktop, MiniKube, Kind (Kubernetes in Docker), or MicroK8s.
How can you enable Kubernetes in Docker Desktop, and what is the recommended setup for Windows users?
To enable Kubernetes in Docker Desktop, you can go to settings and check the “Enable Kubernetes” option. The recommended setup for Windows users is to use WSL 2 as the base engine.
What are the advantages of using MiniKube for local Kubernetes development?
MiniKube allows you to run a single-node Kubernetes cluster locally, making it suitable for testing and development. It is easy to set up and provides a consistent Kubernetes environment.
What is Kind (Kubernetes in Docker), and how does it differ from other local Kubernetes solutions?
Kind is a tool that runs Kubernetes clusters inside Docker containers. It is lightweight and can emulate multiple control planes and worker nodes, making it useful for testing and development.
What is the Kubernetes Control Plane, and what components does it consist of?
The Kubernetes Control Plane is the central management entity of a Kubernetes cluster. It consists of components like the API Server, Controller Manager, Scheduler, and etcd.
What is the role of the Kubernetes API Server, and why is it considered the frontend to the cluster?
The Kubernetes API Server is the central component that serves the Kubernetes API. It acts as the frontend to the cluster, receiving and processing requests from users and clients.
What is etcd in Kubernetes, and what purpose does it serve?
etcd is a distributed key-value store that Kubernetes uses to store all of its cluster data. It serves as the cluster’s source of truth and configuration store.
What is the Kubernetes Kubelet, and what is its responsibility within a node?
The Kubernetes Kubelet is an agent running on each node in the cluster. Its responsibility is to ensure that containers are running in a Pod and to communicate with the Kubernetes Control Plane.
What is a Kubernetes Deployment, and how does it ensure application availability?
A Kubernetes Deployment is an object that manages the deployment of replica Pods. It ensures application availability by maintaining the desired number of replicas and rolling updates.
What is a Kubernetes Service, and why is it essential for inter-pod communication?
A Kubernetes Service is an abstraction that exposes a set of Pods as a network service. It is essential for inter-pod communication because it provides a stable IP and DNS name for accessing Pods.
What is a Persistent Volume (PV) in Kubernetes, and how does it ensure data persistence?
A Persistent Volume (PV) is a cluster-wide storage resource that can be mounted by Pods. It ensures data persistence by abstracting the underlying storage infrastructure and providing a uniform interface.
What is a Kubernetes Namespace, and why is it used?
A Kubernetes Namespace is a way to create virtual clusters within a physical cluster. It is used to organize and isolate resources, making it easier to manage multi-tenant environments.
What is the purpose of tagging Docker images with version numbers or labels?
Tagging Docker images with version numbers or labels allows you to manage and track different versions of your images. It helps ensure consistency and facilitates image updates.
How can you delete a Docker image from your local repository?
You can delete a Docker image from your local repository using the docker rmi command followed by the image name or ID.