Add Datadog and ArgoCD questions

As well as exercises.
This commit is contained in:
abregman
2022-10-24 22:50:10 +03:00
parent 7cceb86b38
commit cbdcfa3e4f
15 changed files with 673 additions and 25 deletions

View File

@@ -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

View File

@@ -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
```

View File

@@ -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

View File

@@ -0,0 +1,23 @@
# 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
```
argocd app create some-app \
--project default \
--repo https://repo-with-helm-chart
--path "./helm" \
--sync-policy auto \
--dest-namespace default \
--dest-server https://kubernetes.cluster
```

View File

@@ -0,0 +1,17 @@
# ArgoCD Secrets 101
## Requirements
1. Running Kubernetes cluster
2. Application k8s manifests with secrets
3. Kubeseal binary installed
## Objectives
1. Install bitnami sealed controller as ArgoCD app
2. Encrypt secrets and commit them to the repo with the k8s manifests
3. Create an app using the secrets you encrypted
## Solution
Click [here](soltuion.md) to view the solution

View File

@@ -0,0 +1,31 @@
# ArgoCD Secrets 101
## Requirements
1. Running Kubernetes cluster
2. Application k8s manifests with secrets
3. Kubeseal binary installed
## Objectives
1. Install bitnami sealed controller as ArgoCD app
2. Encrypt secrets and commit them to the repo with the k8s manifests
3. Create an app using the secrets you encrypted
## Solution
1. Click on "New App"
1. app name: controller
2. project: default
3. sync policy: automatic
4. repository URL: a URL to bitnami sealed controller manifests
5. namespace: kube-system
2. Run the following for every secret: `kubeseal < some/secret.yml > sealed_secrets/some/encrypted_secret.yaml -o yaml`
3. Click on "New App"
1. app name: some-app
2. project: default
3. sync policy: automatic
4. repository URL: a URL to k8s manifests (including encrypted secrets)
5. namespace: default

View File

@@ -0,0 +1,20 @@
# Sync App - Cluster
## Requirements
1. Make sure you have a Kubernetes cluster running with ArgoCD installed
1. Make sure you have an app deployed in the cluster and tracked by ArgoCD
## Objectives
1. Verify the app is tracked by ArgoCD and in sync
2. . Make a change to your application by running a `kubectl` command. The change can anything:
1. Changing the tag of the image
2. Changing the number of replicas
3. You can go extreme and delete the resource if you would like :)
3. Check the app state in ArgoCD
4. Sync the app state
## Solution
Click [here](solution.md) to view the solution

View File

@@ -0,0 +1,48 @@
# Sync App - Cluster
## Requirements
1. Make sure you have a Kubernetes cluster running with ArgoCD installed
1. Make sure you have an app deployed in the cluster and tracked by ArgoCD
## Objectives
1. Verify the app is tracked by ArgoCD and in sync
2. . Make a change to your application by running a `kubectl` command. The change can anything:
1. Changing the tag of the image
2. Changing the number of replicas
3. You can go extreme and delete the resource if you would like :)
3. Check the app state in ArgoCD
4. Sync the app state
## Solution
### UI
1. Click on the app in the UI
1. Make sure it's in sync and in "healthy" state
2. Make a check in the cluster
1. `kubectl scale --replicas=0 <DEPLOYMENT_NAME>`
2. `kubectl get rs <DEPLOYMENT_NAME>`
3. Go back to the UI and check the state of the app
1. If it's still in sync, make sure to click on "Refresh"
2. The app should be in "out-of-sync" state
3. Click on "Sync" and then on "Synchronize"
### CLI
```
# Check app state and verify it's in sync
argocd app get app-demo
# Run the following k8s commands (or any other commands that will change the state of your app)
kubectl scale --replicas=0 <DEPLOYMENT_NAME>
kubectl get rs <DEPLOYMENT_NAME>
# Check app state again
argocd app get app-demo
# Sync app state
argocd app sync app-demo
argocd app wait app-demo
```

View File

@@ -0,0 +1,68 @@
# Sync App - Git
## 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. Create a new application using the UI or CLI
1. App Name: app-demo
2. Project: project-demo
3. Kubernetes namespace: default
2. Sync the application
3. Verify the application is running by executing `kubectl get deploy` in the `default` namespace
4. Now make a change in your repository to one of the Kubernetes manifests (e.g. update deployment tag)
5. Go back to ArgoCD and check the state of the app
6. Sync the state of the application
## Solution
Click [here](solution.md) to view the solution
### UI
1. Click on "New App"
1. Insert application name: `app-demo`
2. Insert project: `project-demo`
3. Under source put the repository URL to your GitHub repo with Kubernetes manifests
1. Set path of your application
4. Under destination put the address of your Kubernetes cluster and set namespace to `default`
5. Click on "Create"
2. Click on the newly created application
1. Click on the "sync button" and click on "Synchronize"
3. Make a change in your Git repo where the Kubernetes manifests are
1. `git add .`
2. `git commit -a`
3. `git push origin <BRANCH_NAME>`
4. Go back to ArgoCD UI and check the status of the app
1. You should see it's "out-of-sync". If you don't, you may want to click on "Refresh"
2. You can also click on "App diff" to see the difference that led to "out-of-sync"
5. Click on "Sync" and "Synchronize" to sync the application
### CLI
```
argocd app create app-demo \
--project project-demo \
--repo https://fake.repo.address \
--path ./some_app_path \
--dest-namespace default \
--dest-server my.kubernetes.cluster
# In the Git repo
cd <git repo>
vi <k8s manifest>
git add .
git commit -a
git push origin <BRANCH_NAME>
# Check app state
argocd app get app-demo
# Sync app state
argocd app sync app-demo
argocd app wait app-demo
```

View File

@@ -0,0 +1,66 @@
# Sync App - Git
## 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. Create a new application using the UI or CLI
1. App Name: app-demo
2. Project: project-demo
3. Kubernetes namespace: default
2. Sync the application
3. Verify the application is running by executing `kubectl get deploy` in the `default` namespace
4. Now make a change in your repository to one of the Kubernetes manifests (e.g. update deployment tag)
5. Go back to ArgoCD and check the state of the app
6. Sync the state of the application
## Solution
### UI
1. Click on "New App"
1. Insert application name: `app-demo`
2. Insert project: `project-demo`
3. Under source put the repository URL to your GitHub repo with Kubernetes manifests
1. Set path of your application
4. Under destination put the address of your Kubernetes cluster and set namespace to `default`
5. Click on "Create"
2. Click on the newly created application
1. Click on the "sync button" and click on "Synchronize"
3. Make a change in your Git repo where the Kubernetes manifests are
1. `git add .`
2. `git commit -a`
3. `git push origin <BRANCH_NAME>`
4. Go back to ArgoCD UI and check the status of the app
1. You should see it's "out-of-sync". If you don't, you may want to click on "Refresh"
2. You can also click on "App diff" to see the difference that led to "out-of-sync"
5. Click on "Sync" and "Synchronize" to sync the application
### CLI
```
argocd app create app-demo \
--project project-demo \
--repo https://fake.repo.address \
--path ./some_app_path \
--dest-namespace default \
--dest-server my.kubernetes.cluster
# In the Git repo
cd <git repo>
vi <k8s manifest>
git add .
git commit -a
git push origin <BRANCH_NAME>
# Check app state
argocd app get app-demo
# Sync app state
argocd app sync app-demo
argocd app wait app-demo
```