출처: Udemy, Kubernetes Certified (KCNA) + Hands On Labs + Practice Exams
Q2. What was Docker originally called?
A. DotCloud
Q5. How many namespaces were originally added to the Linux kernel in 2002?
A. 6
Q1. What does Docker Desktop use to run an isolated instance for Docker?
A. A hidden virtual machine or "subsystem"
Q3. What is the purpose of the "i" flag when running the 'docker run' command?
A. To make the container interactive
Q7.What is one key difference between managing resources in Docker Desktop on a Mac compared to Windows?
A. On a Mac, you can customise shared resources in the Preferences, while on Windows, you cannot
Q3. What is a container registry?
A. A service for hosting and distributing container images
Q5. What is the purpose of the "latest" tag in Docker?
A. To be used as a default tag when working with images if a tag is not specified
Q1. What is the command used to validate the Docker version and configuration?
A. docker version
Q5. How can you override the default command in a Docker container when running it?
A. Add the command to the end of the docker run command
Q8. Which command line option is used to list all the parameters available to the Docker command?
A. docker --help
Q1. What does the command "docker run --rm nginx" do?
A. Pulls the nginx image if it does not exist, runs a container and removes the container upon exit
Q6. How do you publish all exposed ports of a container when running it with Docker?
A. -P
Q1. What base image is used in this tutorial?
A. Alpine
+) Alpine is a lightweight Linux distribution often used for Docker containers due to its small size.
Q2. Which package manager is used in Alpine Linux?
A. apk
+) Ubuntu - apt, centOS - yum
Q4. Which LABEL is used to mention the author of the container?
A. org.opencontainers.image.authors'
Q7. What is the difference between the CMD and RUN instructions in a Dockerfile?
A. CMD specifies the command that will be executed when the container runs, while RUN executes commands during the build process
Q8. What is the purpose of a multistage build in a Dockerfile?
A. To reduce the size of the final container image
Q11. What was the purpose of the adduser command in our Dockerfile?
A. To create a new user with reduced privileges
Q12. What does the ENTRYPOINT in a Dockerfile do?
A. Specifies the command to run when the container is started
Q3. Which of these is a means of expanding Kubernetes to have functionality outside of core functionality?
A. CRDs
Q1. Which component is responsible for spawning and running containers in a Kubernetes architecture?'
A. Low-Level Container Runtime (e.g. runc)
Q2. What is the role of the Kubelet in the Kubernetes architecture?
A. It acts as the Kubernetes component for maintaing Pods
Q7. What is the role of the Controller-Manager in the Kubernetes architecture?
A. It is a control loop that monitors the state of your cluster and makes or requests changes
Q9. What protocol is used by distributed systems to ensure that each node in the cluster agrees on the same state even in the face of failures?
A. RAFT
+) RAFT (Reliable Asynchronous Fault-Tolerant) is a consensus protocol designed specifically for distributed systems to ensure that each node in the cluster agrees on the same state even in the face of failures. RAFT works by electing a leader node and using a voting mechanism to ensure that all nodes agree on the same value for any given log entry. This ensures that the system remains consistent even if some nodes fail or become disconnected.
Q10. How do nodes in a highly available Kubernetes configuration connect to the API server?
A. They connect via the loadbalancer
+) In a highly available Kubernetes configuration, nodes typically connect to the API server through a load balancer. The load balancer distributes incoming traffic across multiple replicas of the API server, ensuring that the cluster remains accessible even if one or more API servers become unavailable. By using a load balancer, nodes can connect to the API server without needing to know the IP address of a specific API server instance.
Q13. When does the Kubernetes Kube-Scheduler determine the node placement for a pod?
A. After the pod has been created and registered in ETCD
+) After a pod has been created and registered in etcd, Kube-Scheduler looks at its queue of pending pods to be scheduled (which now includes this newly created pod). The scheduler then uses various factors like resource availability, taints, tolerations, node affinity, etc., to determine which node would be the best fit for running this pod. Once it decides on a suitable node, it updates etcd with its decision and that's how the pod gets scheduled.
Q15. Which of the following is considered a component of a Kubernetes node?
A. Kube-Proxy
+) 쿠버네티스 노드: kubelet, kube-proxy, container runtime
컨프롤플레인(마스터): kube-apiserver, controller-manager, etcd(마스터노드 또는 전용 etcd클러스터에 있음)
Q16. Which of the following is considered a component of the Kubernetes control-plane?
A. Cloud-Controller-Manager
Q4. What is the command to create a port-forward tunnel in Kubernetes for testing purposes?
A. kubectl port-forward pod/<pod_name><local_port>:<pod_port>
Q7. Which command would you use to view the logs of a container that has crashed and restarted?
A. kubectl logs pod/<pod_name> -c <container_name> -p
+) -p 플래그는 --previous의 약자로, 쿠버네티스에게 현재 컨테이너가 아닌 이전 컨테이너 인스턴스의 로그를 보여줌
Q11.Which command is used to execute an interactive shell inside a running container in a Kubernetes pod?
A. kubectl exec -it <pod_name> -c <container_name> -- bash
Q12. Which Linux namespace is the default shared in a Kubernetes Pod?
A. Linux
Q14. What is a valid container restart policy in Kubernetes?
A. Never, OnFailure, Always
Q15. What command allows you to view the YAML declaration specification from the command line?
A. kubectl explain [object]
+) kubectl explain [object]: 쿠버네티스 리소스 객체(예: Pod, Deployment 등)의 구조와 필드 설명
kubectl get [object] -o yaml: 해당 객체의 현재 상태를 YAML 포맷으로 출력
Q8. Which namespace is readable by all users, including those who are not authenticated?
A. kube-public
+) kube-public 네임스페이스는 공개 용도로 사용되는 공간으로, 로그인하지 않은 사용자도 읽을 수 있는 몇 안 되는 영역
Q10. What are the default namespaces provided with a standard Kubernetes installation?
A. default, kube-system, kube-public, kube-node-lease
+) kube-node-lease: 노드 상태 감지(노드의 생존 여부 확인)에 사용되는 리스를 저장
Q12. What command will change the current context to use a specific namespace?
A. kubectl config set-context --current --namespace=mynamespace
Q6. What does the maxUnavailable: 25% setting in a Kubernetes Deployment strategy signify?
A. Up to 25% of the Pods can be unavailable during the update process
Q7. What is the effect of changing the image of a Deployment?
A. It creates a new ReplicaSet
Q8. How can you monitor a Kubernetes Deployment's update in real time?
A. Using the command kubectl rollout status deployment/<name>
Q12. What happens when you delete a Kubernetes Deployment?
A. Both the Deployment and the linked ReplicaSets are deleted
Q3. What is the default service in Kubernetes that establishes a service with an internal IP address, reachable only within the cluster?
A. ClusterIP
Q6. What is a "Headless" service in Kubernetes?
A. A ClusterIP service that has no IP
Q9. What do EndPoints in Kubernetes represent?
A. The IP addresses assigned to the pods that the service points to
Q13. What is the distinguishing feature of a Headless service in Kubernetes?
A. It provides a DNS implementation with no proxy, so each pods handles its own traffic
Q14. How would you specifically define a Headless Service in a Kubernetes YAML specification?
A. By setting spec.clusterIP: None in the Service YAML specification
Q15. In terms of core abstractions provided by Kubernetes for service networking, how many types of services are primarily defined?
A. Four
+) ClusterIP, NodePort, LoadBalancer, and ExternalName.
Q1. What is the primary function of a Job in Kubernetes?
A. To create one or more pods and ensure a specified number of them successfully terminate
Q3. In a Kubernetes Job, what does the parameter completions: 20 signify?
A. It indicates that the job will creatr 20 pods overall to do the task
Q7. What does a CronJob create according to the schedule?
A. Job objects
Q8. How many completed and failed jobs are kept by default according to the successfulJobsHistoryLimit field in a CronJob?
A. 3
Q. Which of the following commands is used to create a ConfigMap in Kubernetes from a file containing key-value entries?
A. kubectl create configmap colour-configmap --from-env-file=configmap-colour.properties
Q7.What Kubernetes version provided a feature as stable that allows a ConfigMap to be immutable?
A. Kubernetes 1.21
Q3. How is the sensitive data stored in Kubernetes Secrets?
A. It is encoded
Q7.What type is assigned when creating a generic secret in Kubernetes?
A. Opaque
+) Opaque는 특정 포맷이나 용도에 얽매이지 않는 일반적인(generic) Secret
Q1. How does Kubernetes use labels for resource selection?
A. Many Kubernetes components use labels to select the resources they should operate on
Q4.What is the difference between the "-l" and "--selector" options in Kubernetes commands?
A. both are used to filter resources based on labels and are interchangeable'
| 영어단어 | 뜻 |
|---|---|
| hop on | 올라타다, 접속하다 |
| carve up | 분할하다 |
| irrespective | 관계 없이, 상관없이 |
| drawback | 약점 |
| multiarch | 멀티 아키텍처 |
| prune | 가지치다 |
| stand for | ~를 의미하다, 상징하다 |
| gold standard | 가장 우수하고 표준이 되는 기준 |
| excel | ~에 뛰어나다, 장점을 가지다 |
| bypass | 우회하다 |
| spawning | (IT) 새로운 프로세스나 인스턴스를 생성하다 |
| tandem | 협력관계 |
| revert | 되돌리다 |
| expedite | 신속하게 처리하다 |