Skip to content

Commit

Permalink
docs: local cluster environment with Argo Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Oct 13, 2024
1 parent b851ea5 commit 2113716
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
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 environment](local.environment.md)
39 changes: 39 additions & 0 deletions infra/local.environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Local environment

It is possible to install a 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/) (preferred as production environment uses it) or Podman
- [`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
```

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

```bash
argo -n argo submit workflows/test/env.yaml
```

## Limitations

At the moment, 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.

0 comments on commit 2113716

Please sign in to comment.