|
| 1 | +# Deploy Services |
| 2 | + |
| 3 | +This page explains how to deploy the FRIDGE services to a Kubernetes cluster. |
| 4 | +This process includes configuring for various components such as Argo Workflows, MinIO, network policies, and other infrastructure settings. |
| 5 | +It does not deploy the Kubernetes cluster itself; instead, it assumes that a Kubernetes cluster is already available. |
| 6 | + |
| 7 | +!!! note |
| 8 | + To read about deploying the Kubernetes cluster see [Deploy Infrastructure](deploy_infrastructure.md). |
| 9 | + |
| 10 | +!!! warning |
| 11 | + Container-based Kubernetes environments such as K3d or Kind are not supported, as Longhorn is not compatible with those environments. |
| 12 | + |
| 13 | +## Deployment |
| 14 | + |
| 15 | +### Pulumi Backend |
| 16 | + |
| 17 | +You can use any backend you like for Pulumi. |
| 18 | +The [Pulumi documentation](https://www.pulumi.com/docs/iac/concepts/state-and-backends/) details how to use various backends. |
| 19 | +For local development and testing, you can use the local backend: |
| 20 | + |
| 21 | +```console |
| 22 | +pulumi login --local |
| 23 | +``` |
| 24 | + |
| 25 | +### Virtual Environment |
| 26 | + |
| 27 | +First, set up a virtual environment for this project. |
| 28 | +You can use the following commands: |
| 29 | + |
| 30 | +```console |
| 31 | +python3 -m venv .venv |
| 32 | +source .venv/bin/activate |
| 33 | +pip install -r requirements.txt |
| 34 | +``` |
| 35 | + |
| 36 | +### Creating a stack |
| 37 | + |
| 38 | +The `infra/fridge/` folder already contains a Pulumi project configuration file (`Pulumi.yaml`), so you do not need to run `pulumi new` to create a new project. |
| 39 | +The `Pulumi.yaml` file defines the project name and a schema for the configurations for individual stacks. |
| 40 | + |
| 41 | +To create a new stack, you can use the following command: |
| 42 | + |
| 43 | +```console |
| 44 | +pulumi stack init <stack-name> |
| 45 | +``` |
| 46 | + |
| 47 | +!!! note |
| 48 | + You will be asked to provide a passphrase for the stack, which is used to encrypt secrets within the stack's configuration settings. |
| 49 | + |
| 50 | +### Configuring your stack |
| 51 | + |
| 52 | +Each stack has its own configuration settings, defined in the `Pulumi.<stack-name>.yaml` files. |
| 53 | +The configuration can be manually edited, or you can use the Pulumi CLI to set configuration values. |
| 54 | +You can set individual configuration values for the stack using the following command: |
| 55 | + |
| 56 | +```console |
| 57 | +pulumi config set <key> <value> |
| 58 | +``` |
| 59 | + |
| 60 | +Some of the configuration keys must be set as secrets, such as the MinIO access key and secret key. |
| 61 | +Those *must* be set using the Pulumi CLI using the `--secret` flag: |
| 62 | + |
| 63 | +```console |
| 64 | +pulumi config set --secret minio_root_password <your-minio-secret-key> |
| 65 | +``` |
| 66 | + |
| 67 | +For a complete list of configuration keys, see the `Pulumi.yaml` file. |
| 68 | + |
| 69 | +### Kubernetes context |
| 70 | + |
| 71 | +Pulumi requires that the Kubernetes context is set for the stack. |
| 72 | +For example, to set the Kubernetes context for the `dawn` stack, you can use: |
| 73 | + |
| 74 | +```console |
| 75 | +pulumi config set kubernetes:context dawn |
| 76 | +``` |
| 77 | + |
| 78 | +This must match one of the contexts in your local `kubeconfig`. |
| 79 | +You can check the available contexts with `kubectl`: |
| 80 | + |
| 81 | +```console |
| 82 | +kubectl config get-contexts |
| 83 | +``` |
| 84 | + |
| 85 | +### Deploying with Pulumi |
| 86 | + |
| 87 | +Once you have set up the stack and its configuration, you can deploy the stack using the following command: |
| 88 | + |
| 89 | +```console |
| 90 | +pulumi up |
| 91 | +``` |
| 92 | + |
| 93 | +## FRIDGE deployment targets |
| 94 | + |
| 95 | +Currently, FRIDGE is configured to support deployment on Azure Kubernetes Service (AKS) and on DAWN AI. |
| 96 | +FRIDGE uses Cilium for networking, and thus requires a Kubernetes cluster with Cilium installed. |
| 97 | + |
| 98 | +In the table below, you can see the components need to be deployed to each target. |
| 99 | +Some components are pre-installed on DAWN. |
| 100 | + |
| 101 | +| Component | AKS | DAWN | Local | |
| 102 | +| ----------------- | ----- | ----- | ----- | |
| 103 | +| argo-workflows | ✅ | ✅ | ✅ | |
| 104 | +| cert-manager.io | ✅ | | ✅ | |
| 105 | +| cilium | | | ✅ | |
| 106 | +| fridge-api | ✅ | ✅ | ✅ | |
| 107 | +| harbor | ✅ | ✅ | ✅ | |
| 108 | +| hubble | ✅ | | ✅ | |
| 109 | +| ingress-nginx | ✅ | | ✅ | |
| 110 | +| longhorn | | ✅ | ✅ | |
| 111 | +| minio | ✅ | ✅ | ✅ | |
| 112 | +| prometheus | ✅ | | ✅ | |
0 commit comments