Kodekloud CKA class Flashcards
(114 cards)
What two Kubernetes services run on worker nodes, and what do they do? consider updating as we learn.
kubelet: listens to instructions from the kube-api and manages the nodes containers.
Kube-Proxy: A network proxy that runs on each node that maintains network rules on each nde.
What is the CRI?
Container Runtime Interface : Container runtimes such as Docker, CRD, RKT. Docker continued to work with dockershim. while the other CRIs followed the standardized spec. Containerd seems to be where everything is going. in 1.24 the dockershim was removed.
What is containerd?
Containerd is an industry-standard container runtime with an emphasis on simplicity, robustness, and portability. It is designed to manage the complete container lifecycle of its host system, including image transfer and storage, container execution and supervision, and low-level storage and network attachments. Containerd is part of the Cloud Native Computing Foundation and serves as the core container runtime for Kubernetes.
what is the containerd ‘ctr’ command?
ctr is a command-line interface tool provided by containerd for interacting directly with the containerd daemon, primarily used for debugging and testing. The top three uses include managing container lifecycles (create, start, stop, and delete containers), pulling and pushing images, and directly interacting with the containerd API for low-level operations.
how do i pull and run an image with the containerd ctr command?
ctr images pull docker.io/library/redis:alpine
ctr run docker.io/library/redis:alpine redis
nerdctl is the better alternative to ctr for containerd. why is nerdctl better?
Nerdctl supports a wide range of Docker CLI commands, making it easier for users to transition from Docker to containerd without changing their workflows. It includes high-level features such as building images, composing multi-container applications, and managing volumes and networks, which are not directly available or as accessible in ctr.
nerdctl replaces the docker command in containerd. How do i create a container with nerdctl? how do expose ports with nerdctl.
Docker and nerdctl are pretty much identical. so nerdctl would be.
nerdctl run –name redis redis:alpine
nerdctl run –name webserver -p 80:80 -d nginx
what is crictl?
crictl is kubernetes command that allows to to control your container runtimes. used to inspect and debug contain runtimes.
crictl, which is a kubernetes command, is used to interact with the CRI. what crictl command will view the logs? How would pods be listed?
crictl logs LOGID
crictl pods
What is ETCD in Kubernetes?
etcd is a distributed key-value store that serves as the backbone for storing and managing the critical data of a Kubernetes cluster, ensuring consistency and reliability across the cluster state. It plays a pivotal role in Kubernetes for configuration data, state management, and coordination of distributed system operations, acting as the single source of truth for the cluster.
ETCD: what is a key value store?
ETCD is a database that stores data as a key:value. Each individual gets a file and there will be a key and a value. In kubernetes the KEY is the file name and the value is the data. it stores the file info in JSON.
what port does ETCD operate on?
TCP/2379
What is etcdctl and how do we retrieve a key value with it?
etcdctl is how we interact with etcd. ./etcdctl get key1 - command will return the value of the key1. in the key-value database.
what does this do: etcdctl get <key> [--prefix]</key>
Description: Retrieves the value of the specified key. If –prefix is used, it fetches all keys with the specified prefix.
Command: etcdctl put mykey “this is my key”
Description: Sets the value for a specified key. This command is used to create or update the value of a key in etcd.
Command: etcdctl del <key> [--prefix]</key>
Description: Deletes a specified key or, when used with –prefix, deletes keys with the specified prefix. It’s crucial for managing and cleaning up data in etcd.
how: Save a snapshot of the etcd database to a specified filename. This is vital for backing up etcd data.
etcdctl snapshot save myEtcd-backup-file.db
what is the command to: List all members in the etcd cluster. This command is essential for monitoring and managing the etcd cluster membership.
etcdctl member list
What is the etcdctl command to get all of the keys in the etcd db?
ETCDCTL_API=3 etcdctl get “” –prefix –keys-only
removing the –keys-only will also return values.
what does this command do: export ETCDCTL_API=3
sets the environment variable to tell etcdctl to use API version 3.
What is the process of the Kube-API when sending a request to create a new pod?
Memory hint: A.V.R.U.S.K.
- Authenticate User: Verify the identity of the user or service making the request, ensuring they are authorized to perform the action.
- Validate Request: Check the request for correctness and ensure it contains all necessary information for creating a pod.
- Retrieve Data: Fetch necessary data from etcd that might be required for processing the request, such as existing configuration or state.
- Update etcd: Persist the new pod’s specification in etcd to update the cluster’s desired state, ensuring consistency across the system.
- Scheduler: The scheduler detects the new pod creation request from the updated state in etcd and selects an appropriate node for the pod to run on, based on resource requirements, constraints, and policies.
- Kubelet: The kubelet on the chosen node is informed about the new pod and takes responsibility for creating and starting the pod’s containers according to the specified configuration.
Question: What is the Kube Controller Manager?
Answer: The Kube Controller Manager is a component of Kubernetes that runs various controller processes. . All of the controllers are bundled under this.
Question: What does the ReplicaSet Controller do?
Answer: Ensures the specified number of replicas for a pod are running at any given time, providing redundancy and scalability.
What is the purpose of the Deployment Controller?
The deployment controller manages the deployment of ReplicaSets and enables declarative updates of Pods, along with features like rollbacks and scaling.