Kubernetes and the Cloud-Native Ecosystem Interview Questions
Question 1: Where can a container run?
- on an LXD system with Docker installed
- on a Linux machine with no other prerequisites
- on a Windows machine with a container engine installed(correct answer)
- on a cloud-based Docker Hub deployment
Kubernetes tip: A container requires an engine (container engine) installed on any operating system on which it is expected to work.
Question 2: One goal of cloud-native technologies is to increase the speed of application deployments.
True(correct anwer)
False
Kubernetes tip: Other goals include making applications highly available, scalable, and portable across environments.
Question 3: What assumption is at the foundation of cloud-native technology?
- Software should be released in slow cycles to enable proper testing.
- Cloud-native projects should provide isolated solutions with less cross-integration.
- It is good to remove silos between ops teams and software development teams. (correct)
- Bonus: By removing these silos, cloud technology can help expedite code pushes to production.
Question 4: Which statement is true regarding Kubernetes?
- It is written in Java or C++.
- It originates in a Facebook system called Go.
- It is an open-source project. (Correct)
- Kubernetes Tip: Kubernetes is an open-source system with many active developers. It is maintained by Google.
Question 5: Kubernetes is the Greek word for helmsman of a ship. Why did the creators of the project choose this name?
Answer:
Kubernetes ranks containers in the order in which they were deployed.
Kubernetes oversees a set of servers and decides where to deploy containerized applications, when to scale up and down the number of application replicas, and what to do when an application or server stops working. (correct answer)
K8S Bonus:
Kubernetes negotiates with other servers and trades containers when it has run out of space.
Kubernetes moves containers from one cloud provider to another.
Questions about setting up and getting oriented with Kubernetes
Question#6: Which installer type is not offered for Minikube on Windows through the official Minikube site?
- .exe download
- Windows Package Manager
- .zip portable download(correct answer)
- Chocolatey
KubeCTL Bonus: A Chocolatey installer type is offered through the official Minikube site. A Windows Package Manager installer type is offered.
Question 7: Which command installs Minikube on macOS using Homebrew?
- Homebrew install minikube
- sudo install minikube
- brew install minikube (correct answer)
- brew minikube install
Question 8: Which statement is true regarding Docker installation on Windows?
- Docker Desktop for Windows is a free application.
- Docker is a requirement to run a Minikube Kubernetes cluster. (correct answer)
- Docker Desktop installs the container engine required by Kubernetes.
- It does not require a restart.
K8S Bonus:
A Docker Desktop installation requires a machine restart.
Docker Desktop actually requires a paid subscription for commercial use in larger enterprises.
Question 9 Which kubectl command lists the pods from all the namespaces?
kubectl get pods -A (correct answer)
kubectl get pods -N
kubectl get namespaces -P
kubectl list pods -all-namespaces
Question 10: For what purpose will you use Minikube?
- Run a Kubernetes cluster on your computer. (correct answer)
- Run a Kubernetes cluster on AWS
- Interact with a Kubernetes cluster
Question 11: Which shell command can you use on Linux at the end of the Docker installation process to confirm that Docker is properly installed?
- docker-ce
- docker (correct answer)
- lsb-release
- docker-compose-plugin
Question 12: Which package is not a prerequisite to install Docker on Linux?
- gnupg
- keyrings (correct answer)
- curl
- lsb-release
KubeCTL Bonus: "Keyrings" is not a Linux package for a name of a folder used during installation. The GNUPG(GNU Privacy Guard) package is required to add the Docker GPG key.
Question 13: Which statement is true about Minikube?
- It is designed to run production clusters.
- It is as secure as a complete Kubernetes installation.
- It is free software. (correct answer)
KubeCTL Bonus: Minikube is not designed to run production systems.
Question 13: What is different about Docker installation for macOS compared to Windows?
- The Docker engine installation on macOS requires a restart.
- The macOS installation process considers the chip family on the machine. (correct answer)
- The Docker installation package for macOS is different for Intel and Apple chips.
- The macOS Docker engine only has a graphical user interface.
- The macOS Docker engine has a different name.
K8S Bonus: The Docker installation on macOS does not require a restart.
Questions about application deployment with Kubernetes
Question 14: Using the DESCRIBE POD command, what will the event log show for a pod running for a long time?
- If a pod has been running for a while, Kubernetes will assume it is healthy and not show its events.
- The command is not expected to show pod events.
- The event log will show all events from the launch.
- Old events are less interesting for a pod running for a while.
- The event log will show as empty. (correct answer)
Question 15: Which KUBECTL command can you use to list all the pods in a specific namespace?
- kubectl apply -f mynamespace
- kubectl get pods -n mynamespace (correct answer)
- kubectl list pods -n mynamespace
- kubectl mynamespace -l deployments
Question 16: What will be the outcome of the following command?
kubectl get pods
- All pods in all namespaces will be listed.
- All pods in the default namespace will be listed (correct answer)
- With no specified namespace, the command will list all the default namespace pod.
- The command will cause an error.
Question 17: Pod A runs a web server with an IP address of 172.17.0.3. On pod B on the cluster, running wget 172.17.0.3 results in a refused connection. What is one immediate thing to check?
- Pod B is exposing port 80.
- Pods A and B are exposing port 3000.
- Pod A is exposing port 8080.
- Pod A is exposing port 80 (correct answer)
k8s Bonus Tip: Pod A should expose the port that the "wget" command is trying to call (defaulting to 80). Remember that "wget" defaults to port 80 if no port is specified.
Question 18: What is the syntax issue in the following YAML file?
items:
- bananas
- tomatoes
- The colon needs to be placed correctly.
- The indentation is wrong (correct answer)
- Nested items must be indented.
- Some lines are missing a colon.
Question 18: Which character or sequence of characters will you use in YAML to represent a sequence?
- #
- - (correct answer)
- ---
- :
Question 19: When the -o wide option is added to the kubectl get pods to command, what additional information will show?
- IP address (correct answer)
- The IP address will show for all listed pods.
- port
- status
Question 20: Which path in the deployment YAML file specifies the number of instances to run?
- spec -> template -> spec -> containers
- spec -> instances
- metadata -> replicas
- spec -> replicas (correct answer)
Question 20: What represents a valid namespace YAML?
---
apiVersion: v1
kind: Namespace name: mynamespace
---
apiVersion: v1
kind: Namespace
metadata:
name: mynamespace (correct answer)
---
apiVersion: v1
metadata:
kind: Namespace
name: mynamespace
---
apiVersion: v1
metadata:
name: mynamespace
Question 21: What is the immediate parent of the following line?
- - containerPort: 8080
- template:
- spec:
- ports: (correct answer)
- containers:
Complex Application Deployment in Kubernetes
Question 22: Your deployment YAML has the following configuration. What should your service YAML include so traffic is directed correctly?
metadata:
labels:
app: pod-info
spec:
selector:
app: pod-service
spec:
selector:
app: pod-info
(correct)
spec:
selector:
service: pod-info
Question 22: What is not a type of service that Kubernetes offers?
- AddressPool (correct answer)
- AddressPool is not a service type that Kubernetes supports.
- ClusterIP
- LoadBalancer
- NodePort
Question 23: "resources" refers to a worker node's available bandwidth and memory.
FALSE (correct)
TRUE
K8s Bonus Tip: "resources" refers to a worker node's available CPU and memory.
Question 24: In a deployment YAML file, what is the immediate parent under which the resource request and limit specifications should be placed?
- the template block
- the env block
- the container block (correct answer)
Since the resources apply to a container, they should be specified under the container's block.
Question 25: What do resources refer to in the context of resource requests and limits to a pod?
- available storage space for the pod
- available CPU and memory for the cluster
- available CPU and memory on the worker node (correct answer)
Question 26: What is the result of the following command?
Minikube delete
- Delete all objects added using YAML manifests.
- Delete the namespaces.
- Delete the entire Minikube Kubernetes cluster. (correct answer)
This command will delete the entire Minikube Kubernetes cluster.
Question 27: How would you delete a Kubernetes deployment created with a YAML manifest called api.yaml?
- kubectl destroy -f api.yaml
- kubectl delete -f api.yaml (correct answer)
- kubectl delete deployment
- kubectl delete API
Question 28: If you need someone to access an application deployed in your Kubernetes cluster, you'll set up a Kubernetes _____ Service.
- NAT Gateway
- ClusterIP
- LoadBalancer (correct answer)
- NodePort
Kubernetes Architecture Interview Questions
Question 29: What is an instance of Kubernetes called?
- a worker node
- a cluster (correct answer)
- a deployment
- a server
Question 30: What component communicates directly with the etcd component?
- Scheduler component
- The API Server (correct answer)
- Only the Kube API Server component can communicate directly with etcd.
- The Kubelet
Question 31: Which control plane component stores the data about the state of the cluster?
- API Server
- etcd (correct answer)
- scheduler
- controller manager
Question 32: What function does the Kubelet component perform on a worker load?
- Create containers using a supported engine.
- This function is actually handled by the Container Runtime.
- Check that pods and services can communicate.
- Check that the containers are healthy. (correct answer)
Question 32: What are the three components of every worker node?
- container runtime interface, kubelet, and kube-proxy (correct answer)
- kube-apiserver, container runtime interface, and kube-proxy
- kubelet, cloud-controller-manager, and kube-proxy
- kubelet, kube-scheduler, and kube-proxy
Question 33: The kube-proxy is the only worker node component that communicates with the kube-apiserver.
- FALSE (correct answer)
- TRUE
Question 34: Dockershim was removed from Kubernetes v1.24 . How did this change impact Kubernetes?
- Kubernetes can no longer use the Docker engine to run containers.(correct answer)
- Kubernetes can no longer be installed on a Docker server host.
- Kubernetes can no longer use Docker images to instantiate containers.
Question 35: Which component pulls the image from the image repository, when you launch a pod with a new container image?
- api-server
- controller manager
- kubelet (correct answer)
Question 36: Which two Kubernetes components bind a pod to a node when the user applies a new deployment?
- controller manager and scheduler
- kubelet and container-runtime
- api-server and kubelet (correct answer)
- api-server and etcd
Kubernetes tip: The controller manager is only involved in checking for changes. These two components are involved in starting a container.
Question 37: Which of these is not a component of the Kubernetes Control Plane?
- kubelet (correct answer)
- etcd
- kube-apiserver
- cloud-controller-manager
Kubernetes Advanced Topics
Question 38: What is the best way to run these application pods if you need to run an application that performs a one-time extract, transform, load (ETL) operation that transfers data from a SQL database to a data warehouse. ?
- StatefulSet
- DaemonSet
- Job (correct answer)
- Deployment
Kubernetes tip: A Kubernetes Job will spin up a pod, run the container until its task is complete, and terminate it. A Job is best for applications that perform one-time operations, like an ETL.
Question 39: How to set up data storage inside a Kubernetes cluster?
- Docker volume
- a managed SQL database
- persistent volume (correct)
Question 40: Which option will work best to run containers that are agents?
- Job
- Deployment
- DaemonSet (correct)
Kubernetes tip: DaemonSets allow you to run one pod per node, which works well for running pods implementing background processes such as agents.
Question 41: What is the immediate parent under which the securityContext definition should be placed?
- the env block
- the container name
- the metadata section
- the container block(correct)
Kubernetes tip: Since the security context is defined per container, it must be placed inside its block.
Question 42: Which service or object is associated with Kubernetes persistent volumes?
- Amazon RDS
- stateless application
- statefulSet (correct)
Kubernetes tip: A statefulSet is an object that lets an updated Kubernetes application communicate with the same volume as the previous pod.