Commit 3c9898af authored by George Papathanail's avatar George Papathanail
Browse files

Merge branch 'feature/helm' into 'main'

Feature/helm

See merge request !8
parents 1aa166a5 55698fca
Loading
Loading
Loading
Loading
Loading

helm/README.md

0 → 100644
+252 −0
Original line number Diff line number Diff line
# Open Operator Platform (OOP)

## KIND Deployment via Helm

---

## 1. Introduction

This repository provides a **Helm-based reference deployment of the Open Operator Platform (OOP)** on a **local Kubernetes-in-Docker (KIND) cluster**.

The deployment enables **fast, reproducible installation** of core OOP components for:

* Local development
* Integration testing
* API experimentation
* Research and demonstrations

This setup is for development and testing only and MUST NOT be used in production environments.

You can deploy the charts and in non-kind environments

This is work in progress.


## 2. Deployed Components

The solution deploys the following components inside a single KIND cluster:

* **Open Exposure Gateway (OEG)**

  * Northbound API entry point for tenants/applications
  * Handles application onboarding and exposure workflows
  * Acts as the main entry point to the Operator Platform
  * Backed by MongoDB

* **Service Resource Manager (SRM)**

  * Manages application artefacts and lifecycle
  * Interfaces with edge/cloud resources
  * Supports southbound orchestration workflows
  * Backed by MongoDB with PV/PVC support

* **Federation Manager (FM)**

  * Manages inter-operator federation workflows
  * Handles partner Operator (OP) discovery and onboarding
  * Supports federated artefact creation and exchange
  * Enables cross-domain and multi-operator edge deployments
  * Backed by MongoDB

---

## 3. Prerequisites

### 3.1 Required Software

| Tool | Minimum Version |
|---|---|
| Docker | 20.x |
| KIND | 0.20 |
| kubectl | 1.25 |
| Helm | v3+ |
| Bash | 4+ |

### 3.2 Verify Installation

```bash
docker --version
kind --version
kubectl version --client
helm version
````

---

## 4. Deployment Methods

Two deployment approaches are supported:

1. **Automatic deployment** (recommended)
2. **Manual step-by-step deployment**

---

## 5. Automatic Deployment (Recommended)

### 5.1 Description

The automatic deployment method:

* Creates a KIND cluster
* Configures Kubernetes networking
* Installs all OOP components via Helm

All steps are executed by a single script.

### 5.2 Steps

```bash
chmod +x deploy-on-kind.sh
./deploy-on-kind.sh
```

### 5.3 What This Script Does

1. Creates a KIND cluster using `kind-oop-config.yaml`
2. Configures `kubectl` context
3. Deploys the umbrella Helm chart (`oop-platform-chart`)
4. Waits for core services to start

---

## 6. Manual Deployment (Step-by-Step)

### 6.1 Create the KIND Cluster

```bash
kind create cluster \
  --name oop \
  --config kind-oop-config.yaml
```

Verify cluster:

```bash
kubectl cluster-info
```

---

### 6.2 Deploy OOP Using Helm

From the repository root:

```bash
helm install oop-platform ./oop-platform-chart
```

To upgrade an existing deployment:

```bash
helm upgrade oop-platform ./oop-platform-chart
```

---

### 6.3 Verify Deployment

```bash
kubectl get pods -A
kubectl get svc -A
```

All pods should reach `Running` or `Completed` state.

---

## 7. Configuration

All configuration parameters are centralized in:

```
oop-platform-chart/values.yaml
```

Supported configuration options include:

* Container images and tags
* Service ports
* MongoDB configuration
* Ingress enablement
* Resource limits and requests

After modifying values:

```bash
helm upgrade oop-platform ./oop-platform-chart
```

---

## 8. Accessing Services

Services are exposed via Kubernetes `Service` objects.

Typical access methods:

* `kubectl port-forward`
* Ingress (if enabled)
* NodePort (local testing) --> current deployment


---

## 9. Verification & Health Checks

```bash
kubectl get deployments -A
kubectl get statefulsets -A
kubectl describe pod <pod-name>
```

Refer to:

```
oop-platform-chart/VERIFICATION.txt
```

---

## 10. Cleanup

### 10.1 Remove Helm Deployment

```bash
helm uninstall oop-platform
```

### 10.2 Delete KIND Cluster

```bash
kind delete cluster --name oop
```

---

## 11. Troubleshooting

### Pods Not Starting

```bash
kubectl logs <pod-name>
kubectl describe pod <pod-name>
```

### Helm Errors

```bash
helm status oop-platform
```

### Reset Everything

```bash
kind delete cluster --name oop
./deploy-on-kind.sh
```

---


helm/deploy-on-kind.sh

0 → 100644
+109 −0
Original line number Diff line number Diff line
#!/bin/bash

# ====================================================================
# Deploy Open Operator Platform (OOP) on kind
# ====================================================================

set -e

echo "OOP Platform Deployment on kind"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

# Check prerequisites
echo " Checking prerequisites..."

if ! command -v kind &> /dev/null; then
    echo " kind is not installed"
    echo "   Install: https://kind.sigs.k8s.io/"
    exit 1
fi

if ! command -v kubectl &> /dev/null; then
    echo " kubectl is not installed"
    exit 1
fi

if ! command -v helm &> /dev/null; then
    echo " helm is not installed"
    exit 1
fi

echo " All prerequisites met"
echo ""

# Step 1: Create storage directories
echo " Step 1/5: Creating storage directories..."
sudo mkdir -p /tmp/kind-oop/mongodb_srm /tmp/kind-oop/mongodb_oeg 2>/dev/null || true
sudo chmod -R 777 /tmp/kind-oop/ 2>/dev/null || true
echo "   Storage directories ready"
echo ""

# Step 2: Create kind cluster
echo " Step 2/5: Creating kind cluster..."

if kind get clusters | grep -q "oop-cluster"; then
    echo "   Cluster 'oop-cluster' already exists"
    read -p "   Delete and recreate? (y/N) " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]]; then
        kind delete cluster --name oop-cluster
    else
        echo "   Using existing cluster"
    fi
fi

if ! kind get clusters | grep -q "oop-cluster"; then
    kind create cluster --config kind-oop-config.yaml
    echo "   Cluster created"
else
    echo "   Using existing cluster"
fi

# Set context
kubectl config use-context kind-oop-cluster
echo ""

# Step 3: Wait for cluster ready
echo " Step 3/5: Waiting for cluster to be ready..."
kubectl wait --for=condition=Ready nodes --all --timeout=120s
echo "   Cluster ready"
echo ""

# Step 4: Deploy OOP platform
echo " Step 4/5: Deploying OOP Platform..."

if [ -d "oop-platform-chart" ]; then
    cd oop-platform-chart
    ./deploy.sh
else
    echo " oop-platform-chart directory not found"
    echo "   Please extract oop-platform-chart.zip first"
    exit 1
fi

echo ""

# Step 5: Show access information
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Access URLs (via localhost)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "   SRM Dashboard:        http://localhost:32415"
echo "   Artifact Manager:     http://localhost:30080"
echo "   OEG API:             http://localhost:32263/oeg/1.0.0/docs/"
echo "   Keycloak:            http://localhost:30081"
echo "   Keycloak Admin:      http://localhost:30081/admin"
echo "      (Username: admin / Password: admin)"
echo "   Federation Manager:  http://localhost:30989"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Deployment complete!"
echo ""
echo "Useful commands:"
echo "   kubectl get pods -n oop"
echo "   kubectl get pods -n federation-manager"
echo "   kubectl logs -f deployment/srmcontroller -n oop"
echo "   kind delete cluster --name oop-cluster  # To cleanup"
echo ""
+34 −0
Original line number Diff line number Diff line
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: oop-cluster
nodes:
- role: control-plane
  
  # Port mappings for accessing services from host via localhost
  extraPortMappings:
  
  # Core Platform Services (oop namespace)
  - containerPort: 32415    # SRM Dashboard
    hostPort: 32415
    protocol: TCP
  - containerPort: 30080    # Artifact Manager
    hostPort: 30080
    protocol: TCP
  - containerPort: 32263    # OEG API
    hostPort: 32263
    protocol: TCP
  
  # Federation Services (federation-manager namespace)
  - containerPort: 30081    # Keycloak
    hostPort: 30081
    protocol: TCP
  - containerPort: 30989    # Federation Manager
    hostPort: 30989
    protocol: TCP
  
  # Storage volumes for MongoDB persistence
  extraMounts:
  - hostPath: /tmp/kind-oop/mongodb_srm
    containerPath: /mnt/data/mongodb_srm
  - hostPath: /tmp/kind-oop/mongodb_oeg
    containerPath: /mnt/data/mongodb_oeg
+11 −0
Original line number Diff line number Diff line
# Patterns to ignore when packaging
.DS_Store
.git/
.gitignore
*.swp
*.bak
*.tmp
*~
.vscode/
.idea/
QUICK_DEPLOY.md
+53.7 KiB

File added.

No diff preview for this file type.

Loading