Skip to content

Commit

Permalink
Add Datadog and ArgoCD questions
Browse files Browse the repository at this point in the history
As well as exercises.
  • Loading branch information
abregman committed Oct 24, 2022
1 parent 7cceb86 commit cbdcfa3
Show file tree
Hide file tree
Showing 15 changed files with 671 additions and 23 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

:information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE

:bar_chart:  There are currently **2415** exercises and questions

:books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
:bar_chart:  There are currently **2466** exercises and questions

: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 [FAQ page](faq.md) for more details

Expand Down Expand Up @@ -799,6 +797,33 @@ Logging<br>
<summary>What is the difference between infrastructure monitoring and application monitoring? (methods, tools, ...)</summary><br><b>
</b></details>

### Application Performance Management

<details>
<summary>What is Application Performance Management?</summary><br><b>

- IT metrics translated into business insights
- Practices for monitoring applications insights so we can improve performances, reduce issues and improve overall user experience
</b></details>

<details>
<summary>Name three aspects of a project you can monitor with APM (e.g. backend)</summary><br><b>

- Frontend
- Backend
- Infra
- ...
</b></details>

<details>
<summary>What can be collected/monitored to perform APM monitoring?</summary><br><b>

- Metrics
- Logs
- Events
Traces
</b></details>

## Prometheus

<details>
Expand Down
2 changes: 1 addition & 1 deletion faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ I don't have a definitive answer for this question, I'm exploring it myself from

1. Search for them using search engines, documentation pages, ... this is part of being a DevOps engineer
2. Use the communities: many people will be happy to help and answer your questions
3. Ask us. If you want, you can contact me or even open an issue that is only a question, that's totally fine :)
3. Ask us. If you want, you can contact me or start a discussion on this project.

### Where the questions and answers are coming from?

Expand Down
180 changes: 172 additions & 8 deletions topics/argo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,40 @@

- [Argo](#argo)
- [ArgoCD Exercises](#argocd-exercises)
- [Argo Questions](#argo-questions)
- [ArgoCD 101](#argocd-101)
- [ArgoCD Secrets](#argocd-secrets)
- [ArgoCD Helm](#argocd-helm)
- [Argo Questions](#argo-questions)
- [ArgoCD 101](#argocd-101-1)
- [Practical ArgoCD 101](#practical-argocd-101)
- [CLI](#cli)
- [ArgoCD Configuration](#argocd-configuration)
- [Multi-Cluster Environment](#multi-cluster-environment)
- [Access Control](#access-control)
- [ArgoCD Application Health](#argocd-application-health)
- [ArgoCD Syncs](#argocd-syncs)
- [ArgoCD and Helm](#argocd-and-helm)

## ArgoCD Exercises

TODO
### ArgoCD 101

|Name|Topic|Objective & Instructions|Solution|Comments|
|--------|--------|------|----|----|
| Creating an App | App | [Exercise](exercises/app_creation/exercise.md) | [Solution](exercises/app_creation/solution.md)
| Syncing App - Git | Sync | [Exercise](exercises/sync_app_git/exercise.md) | [Solution](exercises/sync_app_git/solution.md)
| Syncing App - Cluster | Sync | [Exercise](exercises/sync_app_cluster/exercise.md) | [Solution](exercises/sync_app_cluster/solution.md)

### ArgoCD Secrets

|Name|Topic|Objective & Instructions|Solution|Comments|
|--------|--------|------|----|----|
| Secrets 101 | Secrets | [Exercise](exercises/secrets_101/exercise.md) | [Solution](exercises/secrets_101/solution.md)

### ArgoCD Helm

|Name|Topic|Objective & Instructions|Solution|Comments|
|--------|--------|------|----|----|
| Helm ArgoCD App | Secrets | [Exercise](exercises/argocd_helm_app/exercise.md) | [Solution](exercises/argocd_helm_app/solution.md)

## Argo Questions

Expand Down Expand Up @@ -53,11 +78,10 @@ With ArgoCD it's really easy to roll back to a previous version because all the
4. Push to image to a registry
5. Update K8S manifest file(s) in a separate app config repository
6. ArgoCD tracks changes in the app config repository. Since there was a change in the repository, it will apply the changes from the repo
7.
</b></details>

<details>
<summary>True or False? ArgoCD support Kubernetes YAML files but not other manifests formats like Helm Charts and Kustomize</summary><br><b>
<summary>True or False? ArgoCD supports Kubernetes YAML files but not other manifests formats like Helm Charts and Kustomize</summary><br><b>

False. It supports Kubernetes YAML files as well as Helm Charts and Kustomize.

Expand Down Expand Up @@ -113,6 +137,13 @@ Ella is right, ArgoCD is an extension of the cluster, that is very different fro
"Application"
</b></details>

<details>
<summary>How ArgoCD makes access management in the cluster easier?</summary><br><b>

Instead of creating Kubernetes resources, you can use Git to manage who is allowed to push code, to review it, merge it, etc - either human users or 3rd party systems and services. There is no need to use ClusterRole or User resources in Kubernetes hence the management of access is much more simplified.

</b></details>

### Practical ArgoCD 101

<details>
Expand Down Expand Up @@ -148,6 +179,77 @@ This section defines with which Kubernetes cluster the app in the tracked Git re
AddProject
</b></details>
<details>
<summary>True or False? ArgoCD sync period is 3 hours</summary><br><b>
False. ArgoCD sync period is 3 minutes as of today (and not hours).
</b></details>
<details>
<summary>Describe shortly what ArgoCD does every sync period</summary><br><b>
1. Gathers list of all the apps to sync (those that are marked with "auto-sync")
2. Gets Git state for each repository
3. Performs comparison between the repository Git state and the Kubernetes cluster state
1. If states are different, the application marked as "out-of-sync" and further action might be taken (based on the configuration)
2. If states are equal, the application marked as "synced"
</b></details>
#### CLI
<details>
<summary>Create a new application with the following properties:
* app name: some-app
* repo: https://fake.repo.address
* app path: ./app_path
* namespace: default
* cluster: my.kubernetes.cluster
</summary><br><b>
```
argocd app create some-app \
--project \
--repo https://fake.repo.address \
--path ./app_path \
--dest-namespace default \
--dest-server my.kubernetes.cluster
```

</b></details>

<details>
<summary>List all argocd apps</summary><br><b>

`argocd app list`
</b></details>

<details>
<summary>Print detailed information on the app called "some-app"</summary><br><b>

`argocd app get some-app`
</b></details>

### ArgoCD Configuration

<details>
<summary>Is it possible to change default sync period of ArgoCD?</summary><br><b>

Yes, it is possible by adding the following to the argocd-cm (ConfigMap):

```
data:
timeout.reconciliation: 300s
```

The value can be any number of seconds you would like to set.
</b></details>

<details>
<summary>What will be the result of setting <code>timeout.reconciliation: 0s</code>?</summary><br><b>

sync functionality will be disabled.
</b></details>

### Multi-Cluster Environment

Expand All @@ -169,11 +271,73 @@ There are multiple ways to deal with it:
2. Use overlays and Kustomize to control the context of where your changes synced based on the CI process/pipeline used.
</b></details>

### Access Control
### ArgoCD Application Health

<details>
<summary>How ArgoCD makes access management in the cluster easier?</summary><br><b>
<summary>What are some possible health statuses for an ArgoCD application?</summary><br><b>

* Healthy
* Missing: resource doesn't exist in the cluser
* Suspended: resource is paused
* Progressing: resources isn't healthy but will become healthy or has the chance to become healthy
* Degraded: resource isn't healthy
* Unknown: it's not known what's the app health
</b></details>

Instead of creating Kubernetes resources, you can use Git to manage who is allowed to push code, to review it, merge it, etc - either human users or 3rd party systems and services. There is no need to use ClusterRole or User resources in Kubernetes hence the management of access is much more simplified.
<details>
<summary>True or False? A Deployment considered to be healthy if the Pods are running</summary><br><b>

Not exactly. A Deployment (as well as StatefulSet, ReplicaSet and DaemonSet) considered healthy if the desired state equals to actual/current state (this includes the number of replicas).
</b></details>

<details>
<summary>True or False? An ingress is considered healthy if status.loadBalancer.ingress list includes at least one value</summary><br><b>

True.
</b></details>

<details>
<summary>What can you tell about the health of custom Kubernetes resources?</summary><br><b>

The health of custom Kubernetes resources is defined by writing Lua scripts.

You find such list of scripts here: https://github.com/argoproj/argo-cd/tree/master/resource_customizations
</b></details>

### ArgoCD Syncs

<details>
<summary>Explain manual syncs vs. automatic syncs</summary><br><b>

Automatic syncs means that once ArgoCD detected a change or a new version of your app in Git, it will apply the changes so the current/actual state can be equal to desired state.

With manual syncs, ArgoCD will identify there is a difference, but will do nothing to correct it.
</b></details>

<details>
<summary>Explain auto-pruning</summary><br><b>

If enabled, auto-pruning will remove resources when files or content is removed from a tracked Git repository.

If disabled, ArgoCD will not remove anything, even when content or files are removed.
</b></details>

<details>
<summary>Explain self-heal in regards to ArgoCD</summary><br><b>

Self-heal is the process of correcting the cluster state based on the desired state, when someone makes manual changes to the cluster.
</b></details>

### ArgoCD and Helm

<details>
<summary>What support is provided in ArgoCD for Helm?</summary><br><b>

ArgoCD is able to track packaged Helm chart in a sense where it will monitor for new versions.
</b></details>

<details>
<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>
22 changes: 22 additions & 0 deletions topics/argo/exercises/app_creation/exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# App Creation

## Requirements

1. Make sure you have repository with some Kubernetes manifests
2. Make sure you have a Kubernetes cluster running with ArgoCD installed

## Objectives

1. Using the CLI or the UI, create a a new application with the following properties:
1. app name: app-demo
2. project: app-project
3. repository URL: your repo with some k8s manifests
4. namespace: default
2. Verify the app was created
3. Sync the app
4. Verify Kubernetes resources were created
5. Delete the app

## Solution

Click [here](solution.md) to view the solution
60 changes: 60 additions & 0 deletions topics/argo/exercises/app_creation/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# App Creation

## Requirements

1. Make sure you have repository with some Kubernetes manifests
2. Make sure you have a Kubernetes cluster running with ArgoCD installed

## Objectives

1. Using the CLI or the UI, create a a new application with the following properties:
1. app name: app-demo
2. project: app-project
3. repository URL: your repo with some k8s manifests
4. namespace: default
2. Verify the app was created
3. Sync the app
4. Verify Kubernetes resources were created
5. Delete the app

## Solution

### UI

1. Click on "New App"
1. Insert application name: `app-demo`
2. Insert project: `app-project`
3. Under source put the repository URL to your GitHub repo with Kubernetes manifests
1. Set the path for your application
4. Under destination put the address of your Kubernetes cluster and set namespace to `default`
5. Click on "Create"
2. Click on "Sync" button on the "app-demo" form
1. Click on "Synchronize"
3. Verify the Kubernetes resources were created
1. `kubectl get deployments`
4. Delete the app

### CLI

```
argocd app create app-demo \
--project app-project \
--repo https://fake.repo.address \
--path ./some_app_path \
--dest-namespace default \
--dest-server my.kubernetes.cluster
# Check app state
argocd app list
argocd app get app-demo
# Sync app state
argocd app sync app-demo
argocd app wait app-demo
# Verify kubernetes resources were created
kubectl get deployments
# Delete the app
argocd app delete app-demo
```
15 changes: 15 additions & 0 deletions topics/argo/exercises/argocd_helm_app/exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ArgoCD Helm App

## Requirements

1. Running Kubernetes cluster
2. ArgoCD installed on the k8s cluster
3. Repository of an Helm chart

## Objectives

1. Create a new app in ArgoCD that points to the repo of your Helm chart

## Solution

Click [here](solution.md) to view the solution
Loading

0 comments on commit cbdcfa3

Please sign in to comment.