You've already forked devops-exercises
Add a couple of Kubernetes questions and exercises
Also updated CKA page.
This commit is contained in:
11
topics/kubernetes/exercises/labels_and_selectors/exercise.md
Normal file
11
topics/kubernetes/exercises/labels_and_selectors/exercise.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Labels and Selectors 101
|
||||
|
||||
## Objectives
|
||||
|
||||
1. How to list all the Pods with the label "app=web"?
|
||||
2. How to list all objects labeled as "env=staging"?
|
||||
3. How to list all deployments from "env=prod" and "type=web"?
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
13
topics/kubernetes/exercises/labels_and_selectors/solution.md
Normal file
13
topics/kubernetes/exercises/labels_and_selectors/solution.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Labels and Selectors 101
|
||||
|
||||
## Objectives
|
||||
|
||||
1. How to list all the Pods with the label "app=web"?
|
||||
2. How to list all objects labeled as "env=staging"?
|
||||
3. How to list all deployments from "env=prod" and "type=web"?
|
||||
|
||||
## Solution
|
||||
|
||||
`k get po -l app=web`
|
||||
`k get all -l env=staging`
|
||||
`k get deploy -l env=prod,type=web`
|
||||
17
topics/kubernetes/exercises/taints_101/exercise.md
Normal file
17
topics/kubernetes/exercises/taints_101/exercise.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Taints 101
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Check if one of the nodes in the cluster has taints (doesn't matter which node)
|
||||
2. Create a taint on one of the nodes in your cluster with key of "app" and value of "web" and effect of "NoSchedule"
|
||||
1. Explain what it does exactly
|
||||
2. Verify it was applied
|
||||
|
||||
## Solution
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
|
||||
1. `kubectl describe no minikube | grep -i taints`
|
||||
2. `kubectl taint node minikube app=web:NoSchedule`
|
||||
1. Any resource with "app=web" key value will not be scheduled on node `minikube`
|
||||
2. `kubectl describe no minikube | grep -i taints`
|
||||
Reference in New Issue
Block a user