Add a couple of Kubernetes questions
This commit is contained in:
parent
fb0de87ce0
commit
73dc7b3416
176
README.md
176
README.md
@ -2,18 +2,18 @@
|
||||
|
||||
:information_source: This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :)
|
||||
|
||||
:bar_chart: There are currently **1435** questions
|
||||
:bar_chart: There are currently **1500** questions
|
||||
|
||||
:books: To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
|
||||
|
||||
:warning: You can use these for preparing for an interview but most of the questions and exercises don't represent an actual interview. Please read [Q&A](common-qa.md) for more details
|
||||
|
||||
:thought_balloon: If you wonder "How to prepare for a DevOps interview?", you might want to read some of my suggestions [here](prepare_for_interview.md)
|
||||
|
||||
:pencil: You can add more questions and exercises by submitting pull requests :) You can read more about it [here](CONTRIBUTING.md)
|
||||
|
||||
:books: To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
|
||||
|
||||
:busts_in_silhouette: [Join](https://www.facebook.com/groups/538897960007080) our [Facebook group](https://www.facebook.com/groups/538897960007080) for additional exercises, articles and more resources on DevOps
|
||||
|
||||
:pencil: You can add more questions and exercises by submitting pull requests :) You can read more about it [here](CONTRIBUTING.md)
|
||||
|
||||
****
|
||||
|
||||
<!-- ALL-TOPICS-LIST:START -->
|
||||
@ -477,7 +477,7 @@ Jenkins integrates development life-cycle processes of all kinds, including buil
|
||||
* Job
|
||||
* Build
|
||||
* Plugin
|
||||
* Slave/Node
|
||||
* Slave/Node/Worker
|
||||
* Executor</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
@ -486,7 +486,7 @@ Jenkins integrates development life-cycle processes of all kinds, including buil
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Explain CI/CD and how you implemented it in Jenkins</summary><br><b>
|
||||
<summary>Explain CI/CD and how have you implemented it in Jenkins</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
@ -505,10 +505,6 @@ Jenkins integrates development life-cycle processes of all kinds, including buil
|
||||
<summary>How to secure Jenkins?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Can you describe some of Jenkins best practices?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Describe how do you add new nodes (agents) to Jenkins</summary><br><b>
|
||||
|
||||
@ -519,12 +515,16 @@ You can describe the UI way to add new nodes but better to explain how to do in
|
||||
<summary>How to acquire multiple nodes for one specific build?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Whenever a build fails, you would like to notify the team owning the job regarding the failure and provide failure reason. How would you do that?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>There are four teams in your organization. How to prioritize the builds of each team? So the jobs of team x will always run before team y for example</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>If you are managing a dozen of jobs, you can probably use the Jenkins UI. How do you manage the creation and deletion of hundreds of jobs every week/month?</summary><br><b>
|
||||
<summary>If you are managing a dozen of jobs, you can probably use the Jenkins UI. But how do you manage the creation and deletion of hundreds of jobs every week/month?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
@ -548,14 +548,6 @@ You can describe the UI way to add new nodes but better to explain how to do in
|
||||
<summary>Have you written Jenkins scripts? If yes, what for and how they work?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
#### Jenkins Integration
|
||||
|
||||
<details>
|
||||
<summary>How would you collect logs from Jenkins builds (not master) and display them to user via Kibana? Describe the process, components, etc.<br>
|
||||
<img src="images/jenkins/jenkins-to-kibana.png" width="621x;" height="171px;"/>
|
||||
</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
## Cloud
|
||||
|
||||
<details>
|
||||
@ -4715,6 +4707,8 @@ At a minimum, a cluster contains a worker node and a master node."
|
||||
Read more [here](https://www.redhat.com/en/topics/containers/what-is-a-kubernetes-cluster)
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes Nodes
|
||||
|
||||
<details>
|
||||
<summary>What is a Node?</summary><br><b>
|
||||
|
||||
@ -4738,12 +4732,35 @@ The master coordinates all the workflows in the cluster:
|
||||
The workers are the nodes which run the applications and workloads.
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Which command you run to view your nodes?</code></summary><br><b>
|
||||
|
||||
`kubectl get nodes`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>True or False? Every cluster must have 0 or more master nodes and at least on e worker</summary><br><b>
|
||||
|
||||
False. A Kubernetes cluster consists of at least 1 master and can have 0 workers (although that wouldn't be very useful...)
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What are the components of the master node?</summary><br><b>
|
||||
|
||||
* API Server - the Kubernetes API. All cluster components communicate through it
|
||||
* Scheduler - assigns an application with a worker node it can run on
|
||||
* Controller Manager - cluster maintenance (replications, node failures, etc.)
|
||||
* etcd - stores cluster configuration
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What are the components of a worker node?</summary><br><b>
|
||||
|
||||
* Kubelet - an agent responsible for node communication with the master.
|
||||
* Kube-proxy - load balancing traffic between app components
|
||||
* Container runtime - the engine runs the containers (Podman, Docker, ...)
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes Pod
|
||||
|
||||
<details>
|
||||
@ -4763,14 +4780,15 @@ It means they would eventually die and pods are unable to heal so it is recommen
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What is a service in Kubernetes?</summary><br><b>
|
||||
<summary>Which command you run to view all pods running on all namespaces?</code></summary><br><b>
|
||||
|
||||
A permanent IP address that can be attached to a pod.
|
||||
Even if connected, their lifecycles aren't connected.
|
||||
`kubectl get pods --all-namespaces`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What is the difference between an external and an internal service?</summary><br><b>
|
||||
<summary>How to delete a pod?</code></summary><br><b>
|
||||
|
||||
`kubectl delete pod pod_name`
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes Deployment
|
||||
@ -4779,6 +4797,12 @@ Even if connected, their lifecycles aren't connected.
|
||||
<summary>What is a "Deployment" in Kubernetes?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to edit a deployment?</code></summary><br><b>
|
||||
|
||||
kubectl edit deployment some-deployment
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What happens after you edit a deployment and change the image?</summary><br><b>
|
||||
|
||||
@ -4787,25 +4811,85 @@ The pod will terminate and another, new pod, will be created.
|
||||
Also, when looking at the replicaset, you'll see the old replica doesn't have any pods and a new replicaset is created.
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to delete a deployment?</summary><br><b>
|
||||
|
||||
One way is by specifying the deployment name: `kubectl delete deployment [deployment_name]`
|
||||
Another way is using the deployment configuration file: `kubectl delete -f deployment.yaml`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What happens when you delete a deployment?</summary><br><b>
|
||||
|
||||
The pod related to the deployment will terminate and the replicaset will be removed.
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes Service
|
||||
|
||||
<details>
|
||||
<summary>What is a Service in Kubernetes?</summary><br><b>
|
||||
|
||||
A permanent IP address that can be attached to a pod.
|
||||
Even if connected, their lifecycles aren't connected.
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to get information on a certain service?</summary><br><b>
|
||||
|
||||
kubctl describe service [service_name]
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to verify that a certain service forwards the requests to a pod</summary><br><b>
|
||||
|
||||
Run `kubectl describe service` and if the IPs from "Endpoints" match any IPs from the output of `kubectl get pod -o wide`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What is the difference between an external and an internal service?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes Ingress
|
||||
|
||||
<details>
|
||||
<summary>What is Ingress?</summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What are the components of the master node?</summary><br><b>
|
||||
#### Kubernetes Configuration File
|
||||
|
||||
* API Server - the Kubernetes API. All cluster components communicate through it
|
||||
* Scheduler - assigns an application with a worker node it can run on
|
||||
* Controller Manager - cluster maintenance (replications, node failures, etc.)
|
||||
* etcd - stores cluster configuration
|
||||
<details>
|
||||
<summary>Which parts a configuration file has?</summary><br><b>
|
||||
|
||||
It has three main parts:
|
||||
1. Metadata
|
||||
2. Specification
|
||||
3. Status (this automatically generated and added by Kubernetes)
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What is the format of a configuration file?</summary><br><b>
|
||||
|
||||
YAML
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to get latest configuration of a deployment?</summary><br><b>
|
||||
|
||||
`kubectl get deployment [deployment_name] -o yaml`
|
||||
</b></details>
|
||||
|
||||
#### Kubernetes etcd
|
||||
|
||||
<details>
|
||||
<summary>Where Kubernetes gets the status data (which is added to the configuration file) from?</summary><br><b>
|
||||
|
||||
etcd
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>True or False? Etcd holds the current status of any kubernetes component</summary><br><b>
|
||||
|
||||
True
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
@ -4814,13 +4898,7 @@ The pod related to the deployment will terminate and the replicaset will be remo
|
||||
True
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What are the components of a worker node?</summary><br><b>
|
||||
|
||||
* Kubelet - an agent responsible for node communication with the master.
|
||||
* Kube-proxy - load balancing traffic between app components
|
||||
* Container runtime - the engine runs the containers (Podman, Docker, ...)
|
||||
</b></details>
|
||||
#### Kubernetes Misc
|
||||
|
||||
<details>
|
||||
<summary>What is kubectl?</summary><br><b>
|
||||
@ -4970,18 +5048,6 @@ View more [here](https://www.youtube.com/watch?v=rDCWxkvPlAw)
|
||||
|
||||
#### Kubernetes Commands
|
||||
|
||||
<details>
|
||||
<summary>Which command you run to view your nodes?</code></summary><br><b>
|
||||
|
||||
`kubectl get nodes`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>Which command you run to view all pods running on all namespaces?</code></summary><br><b>
|
||||
|
||||
`kubectl get pods --all-namespaces`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to list all namespaces?</code></summary><br><b>
|
||||
|
||||
@ -5031,12 +5097,6 @@ EOF
|
||||
<summary>What the coomand <code>kubectl get pod</code> does?</code></summary><br><b>
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to edit a deployment?</code></summary><br><b>
|
||||
|
||||
kubectl edit deployment some-deployment
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What <code>kubectl apply -f [file]</code> does?</code></summary><br><b>
|
||||
</b></details>
|
||||
@ -5047,12 +5107,6 @@ kubectl edit deployment some-deployment
|
||||
`kubectl describe pod pod_name`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to delete a pod?</code></summary><br><b>
|
||||
|
||||
`kubectl delete pod pod_name`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to execute the command "ls" in an existing pod?</code></summary><br><b>
|
||||
|
||||
|
17
common-qa.md
17
common-qa.md
@ -2,10 +2,7 @@
|
||||
|
||||
### What is the purpose of repository?
|
||||
|
||||
1. Learn - asking questions or doing exercises is a great way to learn
|
||||
2. Share - sharing knowledge is a great experience, give it a try
|
||||
|
||||
It is also used sometimes (from what I've been told) to prepare for interviews but a note for interviewers: most of the questions in this repository shouldn't be used as interview questions. A DevOps interview (or any technical interview) is not a trivia game :)
|
||||
Learning
|
||||
|
||||
### My goal is to prepare for a DevOps interview. How to do that?
|
||||
|
||||
@ -17,7 +14,7 @@ Feel free to contribute any ideas and insights you have.
|
||||
That's a great question.<br>
|
||||
I don't have a definitive answer for this question, but what I feel works for me is to:
|
||||
|
||||
* Practice - doing DevOps tasks/work is probably the best way to gain experience and knowledge
|
||||
* Practice - doing DevOps tasks/work should be the primary way to become a DevOps engineer (obvisouly)
|
||||
* Read - Read blogs, books, ... anything that can enrich you about DevOps
|
||||
* Participate - there are great DevOps communities. I especially like [Reddit DevOps](https://www.reddit.com/r/devops). Visiting there, I learn quite a lot on different topics.
|
||||
* Share - This is one of the reasons I created this project. Primary goal was to help others but a secondary goal quickly became to learn more. By asking questions, you actually learn better a certain topic. Try it out, take a certain subject and try to come up with questions you would ask someone to test his/her skills.
|
||||
@ -36,12 +33,12 @@ It's a hard question and the reason is that if you'll ask 20 different people, y
|
||||
|
||||
* OS - DevOps require you good understanding of operating system concepts. The level required is mainly depends on the company although in my opinion it should be the same level. You should understand how the operating system works, how to troubleshoot and debug issues, etc.
|
||||
* Coding is part of DevOps. The level again depends on the company. Some will require you to know basic level of scripting while others deep understanding of common algorithms, data structure, design patterns etc.
|
||||
* Cloud and Containers - while not 100% must in all companies/positions, this skill is on the rise every year and many (if not most) of the positions/companies require this skill. This specifically means: AWS/Azure/GCP, Docker, Kubernetes, ...
|
||||
* Cloud and Containers - while not 100% must in all companies/positions, this skill is on the rise every year and many (if not most) of the positions/companies require this skill. This specifically means: AWS/Azure/GCP, Docker, Podman, Kubernetes, ...
|
||||
|
||||
### I feel like there are some questions that shouldn't be included in this project
|
||||
|
||||
Is that a question? :)
|
||||
In any case, if you don't like some/most of the questions or think that some questions should be removed you can open an issue or submit a PR and we can discuss it there. We don't have rules against deleting questions :D
|
||||
If you don't like some of the questions or think that some questions should be removed you can open an issue or submit a PR and we can discuss it there. We don't have rules against deleting questions
|
||||
|
||||
### Can I copy the questions from here to my site?
|
||||
|
||||
@ -50,15 +47,15 @@ You can but:
|
||||
* Not without attribution. Many people worked hard on adding these questions and they deserve a proper credit for their work
|
||||
* Not if you plan to make money out of it. Directly or indirectly (e.g. ADS) as this is a free content and we would like it to stay this way :)
|
||||
|
||||
Same goes for copying questions from sites to this repository. We saw it happened already with a couple of pull requests and we rejected them. We will not allow to copy content from people/sites to this repository.
|
||||
|
||||
### Can I add questions and/or answers to this project?
|
||||
|
||||
I'll simply imagine you didn't ask that on an open source project... :)
|
||||
|
||||
### Why can't I add installation questions?
|
||||
|
||||
Because these is one of the worst types of questions out there.
|
||||
|
||||
Some sites claim "How to install Jenkins?" or "What is the home directory of Jenkins?" are proper interview questions but personally I think we should have the responsibility to not encourage or even create a phenomenon where interviewers will think it's normal or has any benefit to ask such questions.
|
||||
The purpose of the questions in this repository is to make you learn about a certain technology or purpose. I don't believe installation questions like "How to install Jenkins?" for example, teaches you anything value on Jenkins itself.
|
||||
|
||||
### Where can I practice coding?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user