Skip to content

Commit

Permalink
feat: seo test pilot (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisvankekem authored Jan 5, 2024
1 parent 2468253 commit 095ced8
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 78 deletions.
168 changes: 91 additions & 77 deletions docs/for-devs/get-started/lab-10.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,99 @@
---
slug: lab-10
title: BYO manifests to create a workload
sidebar_label: BYO manifests
slug: deploy-workloads-argo-cd-otomi-kubernetes
title: Deploy Workloads with Argo CD
sidebar_label: Deploy Workloads with Argo CD
description: Learn how to deploy your applications using Argo CD in the Otomi Kubernetes environment with this comprehensive guide. Discover how to manage resources effectively using Git and streamline your deployment process.
keywords:
- Argo
- ArgoCD
- Otomi
- Kubernetes
- GitOps
- Workloads
- Deployment
- Deploying
- HowTo
- Tutorial
---

:::info
Argo CD needs to be activated for this lab.
**Prerequisite**: Argo CD needs to be activated for this lab.
:::

Deploying your applications by doing `kubectl apply -f` is not ideal. As a developer you would like to manage resources based on code stored in Git. Otomi integrates Argo CD to provide an out-of-the-box GitOps solution.

## Using Argo CD to deploy manifests and charts

In the apps section in Otomi console, you'll see an app called Argo CD. Click on it.

![kubecfg](../../img/team-app-argo.png)

In Argo CD you'll see that an Argo app has already been created for your team. This app is configured to synchronize any manifest that is in the created repo in Gitea for Argo.

![kubecfg](../../img/argo-team-app.png)

If you click on the app and then click on `APP DETAILS`, you'll see the `REPO URL` and also that the `SYNC POLICY` is set to `ENABLE AUTO-SYNC`.

Go back to the console and click on the Gitea app in the apps section. In the list of repo's you'll now see a new repo called `otomi/team-<name>-argocd`.

![kubecfg](../../img/argo-team-repo.png)

To show the power of Argo CD, let's add a manifest to the repo and see what happens.

- Create a new file in the repo called `deploy-nginx.yaml`
- Add the following contents to the file:

```
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
otomi.io/app: nginx
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginxinc/nginx-unprivileged:stable
resources:
limits:
memory: '128Mi'
cpu: '200m'
requests:
memory: '64Mi'
cpu: '100m'
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 8080
```

- Commit Changes

Now go back to the Argo CD application and click on the `team<name>` application.

Note that the Argo CD application is not configured to automatically SYNC. So click `SYNC` and then `REFRESH`.

![kubecfg](../../img/argo-team-sync.png)
Deploying applications using `kubectl apply -f` can be inefficient. As a developer, managing resources based on code stored in Git enhances control and traceability. Otomi integrates with Argo CD to provide a seamless GitOps experience, streamlining your deployment process.

## Deploying Workloads Using Argo CD and Otomi

Start by navigating to the apps section in the Otomi console, where you will find an app named Argo CD. Click on it to proceed.

![Argo CD App in Otomi Console](../../img/team-app-argo.png)

In Argo CD, notice that an application specific to your team has already been set up. This application syncs with any manifest present in the Gitea repository designated for Argo.

![Argo CD Team Application Overview](../../img/argo-team-app.png)

After clicking on the app and selecting `APP DETAILS`, you'll find the `REPO URL`. The `SYNC POLICY` is also set to `ENABLE AUTO-SYNC`, facilitating automatic synchronization with the repository.

Returning to the Otomi console, select the Gitea app in the apps section. There, you'll discover a new repository titled `otomi/team-<name>-argocd`.

![Gitea Repository for Argo CD in Otomi](../../img/argo-team-repo.png)

### Demonstrating the Power of Argo CD

Let's demonstrate the capabilities of Argo CD by adding a manifest to the repository:

1. Create a file named `deploy-nginx.yaml` in the repository.
2. Insert the following contents into the file:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
otomi.io/app: nginx
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginxinc/nginx-unprivileged:stable
resources:
limits:
memory: '128Mi'
cpu: '200m'
requests:
memory: '64Mi'
cpu: '100m'
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 8080
```
3. Commit the changes to the repository.
Once you return to the Argo CD application, click on the `team<name>` application.

Remember, the application is not configured for automatic syncing, so manually initiate a `SYNC` by selecting SYNC and then `REFRESH`.

![Syncing in ArgoCD](../../img/argo-team-sync.png)


2 changes: 1 addition & 1 deletion docs/for-devs/get-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Welcome to Otomi! If you are going to use Otomi, these getting started labs are

### [Create secrets](lab-8.md)

### [BYO manifest to create a workload](lab-10.md)
### [Deploy Workloads with Argo CD](lab-10.md)

### [Explore the Catalog](lab-29.md)

Expand Down

0 comments on commit 095ced8

Please sign in to comment.