You've already forked devops-exercises
Add Argo and k8s questions
Also updated Datadog questions.
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
- [ArgoCD 101](#argocd-101)
|
||||
- [ArgoCD Secrets](#argocd-secrets)
|
||||
- [ArgoCD Helm](#argocd-helm)
|
||||
- [Argo Questions](#argo-questions)
|
||||
- [Argo Rollouts](#argo-rollouts)
|
||||
- [ArgoCD Questions](#argocd-questions)
|
||||
- [ArgoCD 101](#argocd-101-1)
|
||||
- [Practical ArgoCD 101](#practical-argocd-101)
|
||||
- [CLI](#cli)
|
||||
@@ -14,6 +15,9 @@
|
||||
- [ArgoCD Application Health](#argocd-application-health)
|
||||
- [ArgoCD Syncs](#argocd-syncs)
|
||||
- [ArgoCD and Helm](#argocd-and-helm)
|
||||
- [Argo Rollouts Questions](#argo-rollouts-questions)
|
||||
- [Argo Rollouts 101](#argo-rollouts-101)
|
||||
- [Argo Rollouts Commands](#argo-rollouts-commands)
|
||||
|
||||
## ArgoCD Exercises
|
||||
|
||||
@@ -37,7 +41,14 @@
|
||||
|--------|--------|------|----|----|
|
||||
| Helm ArgoCD App | Secrets | [Exercise](exercises/argocd_helm_app/exercise.md) | [Solution](exercises/argocd_helm_app/solution.md)
|
||||
|
||||
## Argo Questions
|
||||
### Argo Rollouts
|
||||
|
||||
|Name|Topic|Objective & Instructions|Solution|Comments|
|
||||
|--------|--------|------|----|----|
|
||||
| Blue/Green Rollout | Rollouts | [Exercise](exercises/blue_green_rollout/exercise.md) | [Solution](exercises/blue_green_rollout/solution.md)
|
||||
| Canary Rollout | Rollouts | [Exercise](exercises/canary_rollout/exercise.md) | [Solution](exercises/canary_rollout/solution.md)
|
||||
|
||||
## ArgoCD Questions
|
||||
|
||||
### ArgoCD 101
|
||||
|
||||
@@ -340,4 +351,62 @@ ArgoCD is able to track packaged Helm chart in a sense where it will monitor for
|
||||
<summary>True or False? When ArgoCD tracks Helm chart the chart is no longer an Helm application and it's a ArgoCD app</summary><br><b>
|
||||
|
||||
True. Trying to execute commands like `helm ls` will fail because helm metadata doesn't exist anymore and the application is tracked as ArgoCD app.
|
||||
</b></details>
|
||||
|
||||
## Argo Rollouts Questions
|
||||
|
||||
### Argo Rollouts 101
|
||||
|
||||
<details>
|
||||
<summary>What is Argo Rollouts?</summary><br><b>
|
||||
|
||||
A controller for Kubernetes to perform application deployments using different strategies like Blue/Green deployments, Canary deployments, etc.
|
||||
|
||||
In addition, it supports A/B tests, automatic rollbacks and integrated metric analysis.
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>What happens when you rollout a new version of your app with argo rollouts?</summary><br><b>
|
||||
|
||||
- Argo Rollouts creates a new replicaset (that is the new app version)
|
||||
- Old version is still alive
|
||||
- ArgoCD marks the app as out-ofsync
|
||||
</b></details>
|
||||
|
||||
### Argo Rollouts Commands
|
||||
|
||||
<details>
|
||||
<summary>How to list rollouts?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts list rollouts`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to list the rollouts of a given application?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts get rollout SOME-APP`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to check the status of a rollout?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts status SOME-APP`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to rollout a new version (with new container tag)?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts set image SOME-APP web-app=some/registry/and/image:v2.0`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How to manually promote to new app version?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts promote SOME-APP`
|
||||
</b></details>
|
||||
|
||||
<details>
|
||||
<summary>How do you monitor a rollout?</summary><br><b>
|
||||
|
||||
`kubectl argo rollouts get rollout SOME-APP --watch`
|
||||
</b></details>
|
||||
21
topics/argo/exercises/blue_green_rollout/exercise.md
Normal file
21
topics/argo/exercises/blue_green_rollout/exercise.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Argo Rollouts - Blue/Green
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Running Kubernetes cluster
|
||||
2. Argo Rollouts CLI
|
||||
3. Deployed app in specific version
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Install Argo Rollouts controller
|
||||
2. Write a rollout manifest that use blue/green deployment and apply it
|
||||
1. Set it to 3 replicas
|
||||
2. Disable auto-promotions
|
||||
3. Check the rollout list
|
||||
4. Rollout a new version of your app in any way you prefer
|
||||
1. Check the status of the rollout
|
||||
|
||||
## Solutions
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
58
topics/argo/exercises/blue_green_rollout/solution.md
Normal file
58
topics/argo/exercises/blue_green_rollout/solution.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Argo Rollouts - Blue/Green
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Running Kubernetes cluster
|
||||
2. Argo Rollouts CLI
|
||||
3. Deployed app in specific version
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Install Argo Rollouts controller
|
||||
2. Write a rollout manifest that use blue/green deployment and apply it
|
||||
1. Set it to 3 replicas
|
||||
2. Disable auto-promotions
|
||||
3. Check the rollout list
|
||||
4. Rollout a new version of your app in any way you prefer
|
||||
1. Check the status of the rollout
|
||||
|
||||
## Solution
|
||||
|
||||
Installation:
|
||||
|
||||
1. `kubectl create namespace argo-rollouts`
|
||||
1. `kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml`
|
||||
|
||||
2. Rollout resource:
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Rollout
|
||||
metadata:
|
||||
name: some-app
|
||||
spec:
|
||||
replicas: 3
|
||||
strategy:
|
||||
blueGreen:
|
||||
autoPromotionEnabled: false
|
||||
selector:
|
||||
matchLabels:
|
||||
app: some-web-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: some-web-app
|
||||
spec:
|
||||
containers:
|
||||
- name: web-app
|
||||
image: some/registry/and/image:v1.0
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
```
|
||||
|
||||
3. `kubectl argo rollouts list rollouts`
|
||||
4. `kubectl argo rollouts set image SOME-APP web-app=some/registry/and/image:v2.0`
|
||||
1. `kubectl argo rollouts get rollout some-app --watch`
|
||||
21
topics/argo/exercises/canary_rollout/exercise.md
Normal file
21
topics/argo/exercises/canary_rollout/exercise.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Argo Rollouts - Canary
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Running Kubernetes cluster
|
||||
2. Argo Rollouts CLI
|
||||
3. Deployed app in a specific version
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Install Argo Rollouts controller
|
||||
2. Write a rollout manifest that use canary rollout strategy and apply it
|
||||
1. Set it to 3 replicas
|
||||
2. Disable auto-promotions
|
||||
3. Check the rollout list
|
||||
4. Rollout a new version of your app in any way you prefer
|
||||
1. Check the status of the rollout
|
||||
|
||||
## Solutions
|
||||
|
||||
Click [here](solution.md) to view the solution.
|
||||
70
topics/argo/exercises/canary_rollout/solution.md
Normal file
70
topics/argo/exercises/canary_rollout/solution.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Argo Rollouts - Canary
|
||||
|
||||
## Requirements
|
||||
|
||||
1. Running Kubernetes cluster
|
||||
2. Argo Rollouts CLI
|
||||
3. Deployed app in a specific version
|
||||
|
||||
## Objectives
|
||||
|
||||
1. Install Argo Rollouts controller
|
||||
2. Write a rollout manifest that use canary rollout strategy and apply it
|
||||
1. Set it to 6 replicas
|
||||
2. Disable auto-promotions
|
||||
3. Check the rollout list
|
||||
4. Rollout a new version of your app in any way you prefer
|
||||
1. Check the status of the rollout
|
||||
|
||||
## Solution
|
||||
|
||||
Installation:
|
||||
|
||||
1. `kubectl create namespace argo-rollouts`
|
||||
1. `kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml`
|
||||
|
||||
2. Rollout resource:
|
||||
|
||||
```
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Rollout
|
||||
metadata:
|
||||
name: some-app
|
||||
spec:
|
||||
replicas: 6
|
||||
strategy:
|
||||
canary:
|
||||
stableService: k8s-service-stable
|
||||
canaryService: k8s-service-canary
|
||||
trafficRouting:
|
||||
ambassador:
|
||||
mappings:
|
||||
- k8s-mapping
|
||||
steps:
|
||||
- setWeight: 30
|
||||
- pause: {}
|
||||
- setWeight: 60
|
||||
- pause: {}
|
||||
- setWeight: 100
|
||||
- pause: {}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: some-web-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: some-web-app
|
||||
spec:
|
||||
containers:
|
||||
- name: web-app
|
||||
image: some/registry/and/image:v1.0
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
```
|
||||
|
||||
3. `kubectl argo rollouts list rollouts`
|
||||
4. `kubectl argo rollouts set image SOME-APP web-app=some/registry/and/image:v2.0`
|
||||
1. `kubectl argo rollouts get rollout some-app --watch`
|
||||
Reference in New Issue
Block a user