Skip to content

Commit

Permalink
docs: local cluster environment with Argo Workflows (#810)
Browse files Browse the repository at this point in the history
#### Motivation

It is useful to be able to deploy a Kubernetes cluster locally to do
some tests without having to rely on AWS.

#### Modification

Document how to install a K8s cluster locally using `kind`.

#### Checklist

- [ ] Tests updated NA
- [x] Docs updated
- [ ] Issue linked in Title NA
  • Loading branch information
paulfouquet authored Oct 29, 2024
1 parent 9420533 commit 3ac7347
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/local.environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Local Argo Workflows environment

It is possible to install Argo Workflows in a K8s cluster on your local machine. In this documentation we will use [`kind`](https://kind.sigs.k8s.io/).

## Pre-requisite

- [Docker](https://docs.docker.com/engine/install/)
- [`kind`](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl)
- [Argo CLI](https://argo-workflows.readthedocs.io/en/latest/walk-through/argo-cli/#argo-cli)

## Cluster

To create a cluster using `kind`:

```bash
kind create cluster --name argo
```

> **_NOTE:_** The [`kind` Node container](https://hub.docker.com/r/kindest/node/tags) version number matches the Kubernetes version (`kindest/node:vX.Y.Z` uses Kubernetes `vX.Y.Z`). To specify a Kubernetes version for your cluster, use `--image kindest/node:vX.Y.Z`. It is a good idea to use the same version as the production environment (`version` in [`LinzEksCluster` Stack](../infra/eks/cluster.ts)).
## Argo Workflows

Choose and install the Controller and Server of [a release](https://github.com/argoproj/argo-workflows/releases/) that matches the [production version (`appVersion`)](https://github.com/linz/topo-workflows/blob/master/infra/charts/argo.workflows.ts). The installation process should be described in the Argo Workflow Release page, for example for `v3.5.5`:

```bash
kubectl create namespace argo
kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.5.5/install.yaml
kubectl create rolebinding default-admin --clusterrole=admin --serviceaccount=argo:default --namespace=argo
```

You should now be able to run a workflow, for example:

```bash
argo -n argo submit https://raw.githubusercontent.com/argoproj/argo-workflows/refs/heads/main/examples/hello-world.yaml
```

## Limitations

This documentation is only to install a vanilla version of Argo Workflows. The [Kubernetes components](../docs/infrastructure/components) configured for the production environment are not directly applicable to a local/`kind` environment as they require to run `CDK8s` using some information retrieved from AWS.
5 changes: 5 additions & 0 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Main entry point: [app](./cdk8s.ts)

### Deploy CDK

_AWS CDK is used to manage the AWS EKS cluster creation/update._

To deploy with AWS CDK a few context values need to be set:

- `aws-account-id`: Account ID to deploy into. This can be set with `export CDK_DEFAULT_ACCOUNT="$(aws sts get-caller-identity --query Account --output text)"`.
Expand All @@ -51,6 +53,8 @@ npx cdk deploy --context=maintainer-arns="${ci_role},${admin_role},${workflow_ma

### Deploy CDK8s

_CDK8s is used to manage Kubernetes resources on the cluster previously created._

Generate the kubernetes configuration yaml into `dist/`

```shell
Expand Down Expand Up @@ -81,3 +85,4 @@ The deployment of the K8s config is managed by GithubActions in [main](../.githu
- [Version Upgrade Guide](../docs/infrastructure/kubernetes.version.md)
- [DNS Troubleshooting](../docs/dns.configuration.md)
- [Working with Helm](../docs/infrastructure/helm.md)
- [Local Argo Workflows environment](../docs/local.environment.md)

0 comments on commit 3ac7347

Please sign in to comment.