"ssh:/git@developer.sourcefind.cn:2222/OpenDAS/dynamo.git" did not exist on "50f1e0e17aebadbe5de9e337c6aaa5262f8559f2"
Unverified Commit c12f61a6 authored by mohammedabdulwahhab's avatar mohammedabdulwahhab Committed by GitHub
Browse files

feat: fluxcd guide to managing custom resources (#1220)


Signed-off-by: default avatarmohammedabdulwahhab <furkhan324@berkeley.edu>
parent 68ac71c4
...@@ -12,8 +12,7 @@ Dynamo operator is a Kubernetes operator that simplifies the deployment, configu ...@@ -12,8 +12,7 @@ Dynamo operator is a Kubernetes operator that simplifies the deployment, configu
- [Architecture](#architecture) - [Architecture](#architecture)
- [Custom Resource Definitions (CRDs)](#custom-resource-definitions-crds) - [Custom Resource Definitions (CRDs)](#custom-resource-definitions-crds)
- [Installation](#installation) - [Installation](#installation)
- [Usage](#usage) - [GitOps Deployment with FluxCD](#gitops-deployment-with-fluxcd)
- [Examples](#examples)
- [Reconciliation Logic](#reconciliation-logic) - [Reconciliation Logic](#reconciliation-logic)
- [Configuration](#configuration) - [Configuration](#configuration)
- [Troubleshooting](#troubleshooting) - [Troubleshooting](#troubleshooting)
...@@ -190,6 +189,121 @@ spec: ...@@ -190,6 +189,121 @@ spec:
--- ---
## GitOps Deployment with FluxCD
This section describes how to use FluxCD for GitOps-based deployment of Dynamo inference graphs. GitOps enables you to manage your Dynamo deployments declaratively using Git as the source of truth. We'll use the [aggregated vLLM example](../../examples/llm/README.md) to demonstrate the workflow.
### Prerequisites
- A Kubernetes cluster with [Dynamo Cloud](dynamo_cloud.md) installed
- [FluxCD](https://fluxcd.io/flux/installation/) installed in your cluster
- A Git repository to store your deployment configurations
- [Dynamo CLI](../../get_started.md#installation) installed locally
### Workflow Overview
The GitOps workflow for Dynamo deployments consists of three main steps:
1. Build and push a pipeline to the Dynamo API store
2. Create and commit a DynamoGraphDeployment custom resource for initial deployment
3. Update the pipeline by building a new version and updating the CR for subsequent updates
### Step 1: Build and Push Pipeline
First, build and push your pipeline using the Dynamo CLI:
```bash
# Set your project root directory
export PROJECT_ROOT=$(pwd)
# Configure environment variables
export KUBE_NS=dynamo-cloud
export DYNAMO_CLOUD=http://localhost:8080 # If using port-forward
# OR
# export DYNAMO_CLOUD=https://dynamo-cloud.nvidia.com # If using Ingress/VirtualService
# Build and push the service
cd $PROJECT_ROOT/examples/llm
DYNAMO_TAG=$(dynamo build --push graphs.agg:Frontend | grep "Successfully built" | awk '{ print $NF }' | sed 's/\.$//')
```
The `--push` flag ensures the pipeline is pushed to the remote API store, making it available for deployment.
### Step 2: Create Initial Deployment
Create a new file in your Git repository (e.g., `deployments/llm-agg.yaml`) with the following content:
```yaml
apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
name: llm-agg
spec:
dynamoComponent: frontend:jh2o6dqzpsgfued4 # Use the tag from Step 1
services:
Frontend:
replicas: 1
envs:
- name: SPECIFIC_ENV_VAR
value: some_specific_value
Processor:
replicas: 1
envs:
- name: SPECIFIC_ENV_VAR
value: some_specific_value
VllmWorker:
replicas: 1
envs:
- name: SPECIFIC_ENV_VAR
value: some_specific_value
# Add PVC for model storage
pvc:
name: vllm-model-storage
mountPath: /models
size: 100Gi
```
Commit and push this file to your Git repository. FluxCD will detect the new CR and create the initial deployment in your cluster. The operator will:
- Create the specified PVCs
- Build container images for all components
- Deploy the services with the configured resources
### Step 3: Update Existing Deployment
To update your pipeline:
1. Build and push a new version of your pipeline:
```bash
DYNAMO_TAG=$(dynamo build --push graphs.agg:Frontend | grep "Successfully built" | awk '{ print $NF }' | sed 's/\.$//')
```
2. Update the `dynamoComponent` field in your CR with the new tag:
```yaml
spec:
dynamoComponent: frontend:new_tag_here # Update with new tag from Step 1
```
3. Commit and push the changes to your Git repository.
The Dynamo operator will:
- Detect the updated CR
- Build new container images for the updated components
- Perform a rolling update of the deployments when the new images are ready and the components are ready to serve traffic
- Preserve existing PVCs and their data
### Monitoring the Deployment
You can monitor the deployment status using:
```bash
# Check the DynamoGraphDeployment status
kubectl get dynamographdeployment llm-agg -n $KUBE_NS
# Check the component deployments
kubectl get dynamocomponentdeployment -n $KUBE_NS
```
---
## Deploying a Dynamo Pipeline using the Operator ## Deploying a Dynamo Pipeline using the Operator
[See deployment steps](operator_deployment.md) [See deployment steps](operator_deployment.md)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment