Commit e94b97ba authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

Add some docs

parent 911c84e5
Loading
Loading
Loading
Loading
+76 −68
Original line number Diff line number Diff line
@@ -23,94 +23,102 @@ lite2edge_registry_password: "your-token-or-password"
```bash
ansible-playbook playbooks/scenarios/full-deployment.yml -e @secrets.yml
```
## Scenario Playbooks

## 01-deploy-kind-cluster.yml
### deploy_two_full_oops.yml

**Purpose**: Create and configure Kind cluster
**Purpose**: Deploy two complete Operator Platform environments on separate nodes

**Variables**:
- `kind_cluster_name` - Cluster name (default: `operator-platform`)
- `kind_version` - Kind binary version (default: `v0.29.0`)
- `worker_nodes` - Number of worker nodes (default: `2`)
- `recreate_cluster` - Force recreate if exists (default: `no`)

**Output**:
- Kubeconfig: `../automation/1-kind-cluster/operator-platform-external-kubeconfig.yaml`
- Config: `../automation/1-kind-cluster/kind-config.yaml`
- Setup script: `../automation/1-kind-cluster/setup-env.sh`

## install-prometheus.yml

**Purpose**: Install Prometheus Stack

**Tags**:
- `prometheus`: Install Prometheus stack

## install-node-feature-discovery.yml
**Actions**:
- Deploys OP1 (on openop_3) with cluster name `op1` and kubeconfig `op1-kubeconfig.yaml`
- Deploys OP2 (on openop_2) with cluster name `op2` and kubeconfig `op2-kubeconfig.yaml`
- Each OP includes: Kind cluster, NFD, Harbor, Artefact Manager, Federation Manager, Homer, and lite2edge

**Purpose**: Install Node Feature Discovery
**Usage**:
```bash
cd ansible
ansible-playbook playbooks/scenarios/deploy_two_full_oops.yml -e @secrets.yml
```

**Tags**:
- `nfd`: Install Node Feature Discovery
**Targeting specific OPs**:
```bash
# Deploy only OP1
ansible-playbook playbooks/scenarios/deploy_two_full_oops.yml -e @secrets.yml --tags op1

## 02-deploy-harbor.yml
# Deploy only OP2
ansible-playbook playbooks/scenarios/deploy_two_full_oops.yml -e @secrets.yml --tags op2
```

**Purpose**: Deploy Harbor artifact registry
### quick_undeploy_full_oops.yml

**Actions**:
- Installs Harbor via Helm
- Configures NodePort access
- Sets up persistence
**Purpose**: Quickly remove both OP environments by deleting their Kind clusters

**Variables**:
- `harbor_namespace`: Namespace for Harbor (default: `harbor`)
- `harbor_admin_password`: Admin password (default: `Harbor12345`)
- `harbor_http_nodeport`: NodePort for HTTP access (default: `30002`)
- `harbor_https_nodeport`: NodePort for HTTPS access (default: `30003`)
**Usage**:
```bash
ansible-playbook playbooks/scenarios/quick_undeploy_full_oops.yml
```

**Access**:
- URL: `http://<host_ip>:30002`
- Default Credentials: `admin` / `Harbor12345`
**Targeting specific OPs**:
```bash
# Undeploy only OP1
ansible-playbook playbooks/scenarios/quick_undeploy_full_oops.yml --tags op1

## 03-deploy-artefact-manager.yml
# Undeploy only OP2
ansible-playbook playbooks/scenarios/quick_undeploy_full_oops.yml --tags op2
```

**Purpose**: Deploy Artefact Manager
## Advanced Usage

**Actions**:
- Deploys Artefact Manager to the cluster
- Configures NodePort access
### Deploying Individual Services to Specific OPs

**Variables**:
- `artefact_manager_image`: Docker image (default: `ghcr.io/sunriseopenoperatorplatform/artefactmanager`)
- `artefact_manager_tag`: Image tag (default: `0.5`)
- `artefact_manager_nodeport`: NodePort for API access (default: `30080`)
When working with multiple OOP deployments (e.g., OP1 and OP2), you can deploy or undeploy individual services to specific clusters using extra variables and host limits.

**Access**:
- URL: `http://<host_ip>:30080`
#### Deploy/Undeploy lite2edge to Specific OP

## 03-deploy-i2edge.yml
**Deploy to OP1 (openop_3)**:
```bash
ansible-playbook playbooks/tools/lite2edge/deploy.yml \
  -e "kind_cluster_name=op1" \
  -e "kubeconfig_filename=op1-kubeconfig.yaml" \
  --limit openop_3
```

**Purpose**: Deploy the i2edge application
**Deploy to OP2 (openop_2)**:
```bash
ansible-playbook playbooks/tools/lite2edge/deploy.yml \
  -e "kind_cluster_name=op2" \
  -e "kubeconfig_filename=op2-kubeconfig.yaml" \
  --limit openop_2
```

**Actions**:
- Builds i2edge Docker image
- Loads image into Kind
- Creates storage directories
- Deploys via Kustomize
- Waits for pods to be ready
**Undeploy from OP1 (openop_3)**:
```bash
ansible-playbook playbooks/tools/lite2edge/undeploy.yml \
  -e "kind_cluster_name=op1" \
  -e "kubeconfig_filename=op1-kubeconfig.yaml" \
  --limit openop_3
```

## 99-undeploy-kind-cluster.yml
**Undeploy from OP2 (openop_2)**:
```bash
ansible-playbook playbooks/tools/lite2edge/undeploy.yml \
  -e "kind_cluster_name=op2" \
  -e "kubeconfig_filename=op2-kubeconfig.yaml" \
  --limit openop_2
```

**Purpose**: Delete Kind cluster and cleanup
!!! tip
    This pattern works for any service playbook. The key is:
    
**Variables**:
- `kind_cluster_name` - Cluster to delete (default: `operator-platform`)
    1. Specify the cluster name with `-e "kind_cluster_name=<cluster_name>"`
    2. Specify the kubeconfig file with `-e "kubeconfig_filename=<filename>"`
    3. Limit execution to specific host with `--limit <hostname>`

**Safety**:
- Prompts for confirmation before deletion
- Use `-e "confirm_deletion=yes"` to skip prompt (dangerous!)
!!! note
    The cluster name and kubeconfig filename must match what was used during the deployment. For the two-OOP scenario:
    
## Advanced Usage
    - **OP1**: `kind_cluster_name=op1`, `kubeconfig_filename=op1-kubeconfig.yaml`, host: `openop_3`
    - **OP2**: `kind_cluster_name=op2`, `kubeconfig_filename=op2-kubeconfig.yaml`, host: `openop_2`

### Verbose Output