photoncloud-monorepo/testing/qemu-cluster/README.md

96 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# PhotonCloud QEMU Test Cluster
QEMU環境でPhotoCloud Bare-Metal Service Meshをテストするための環境構築スクリプト。
## 構成
- **VM数**: 2台node-01, node-02
- **ネットワーク**: 192.168.100.0/24ブリッジモード
- **OS**: Ubuntu 22.04 LTS最小構成
- **デプロイ**: Chainfire + NodeAgent + mTLS Agent
## セットアップ
### 1. QEMU/KVMのインストール
```bash
sudo apt-get update
sudo apt-get install -y qemu-system-x86_64 qemu-kvm bridge-utils
```
### 2. ベースイメージの作成
```bash
./scripts/create-base-image.sh
```
###3. クラスタの起動
```bash
./scripts/start-cluster.sh
```
### 4. PhotonCloudコンポーネントのデプロイ
```bash
./scripts/deploy-photoncloud.sh
```
## テストシナリオ
### シナリオ1: プレーンHTTP通信
1. node-01でapi-serverを起動plain mode
2. node-02でworker-serviceを起動plain mode
3. worker-service → api-server へHTTPリクエスト
4. 通信成功を確認
### シナリオ2: mTLS有効化
1. cert-authorityで証明書を発行
2. api-serverをmTLSモードで再起動
3. worker-serviceをmTLSモードで再起動
4. 通信成功を確認
### シナリオ3: 動的ポリシー変更
1. Chainfire上でポリシーをplain→mtlsに変更
2. NodeAgentがポリシー変更を検知
3. mTLS Agentがポリシーを適用
4. 通信が継続されることを確認
### シナリオ4: サービス発見
1. api-serverを2インスタンス起動
2. worker-serviceがServiceDiscovery経由で両インスタンスを発見
3. ラウンドロビンで負荷分散されることを確認
### シナリオ5: ノード障害
1. node-01をシャットダウン
2. NodeAgentのハートビートが停止
3. mTLS Agentがnode-01のインスタンスを除外
4. node-02のインスタンスのみに通信が行くことを確認
## ディレクトリ構成
```
testing/qemu-cluster/
├── README.md
├── scripts/
│ ├── create-base-image.sh # ベースイメージ作成
│ ├── start-cluster.sh # クラスタ起動
│ ├── stop-cluster.sh # クラスタ停止
│ └── deploy-photoncloud.sh # PhotonCloud デプロイ
├── images/
│ └── base.qcow2 # ベースイメージ
├── vms/
│ ├── node-01.qcow2 # node-01のディスク
│ └── node-02.qcow2 # node-02のディスク
└── configs/
├── cluster-config.json # クラスタ設定
├── node-01-config.toml # node-01設定
└── node-02-config.toml # node-02設定
```