353 lines
7.8 KiB
Markdown
353 lines
7.8 KiB
Markdown
---
|
|
sidebar_position: 2
|
|
---
|
|
|
|
# Getting Started with Mycelium Cloud
|
|
|
|
Deploy your first Kubernetes cluster on the ThreeFold Grid in just a few steps.
|
|
|
|
## Prerequisites
|
|
|
|
Before you begin, make sure you have:
|
|
|
|
- ✅ **Mycelium installed** - Easy app for iOS, Android, macOS, Windows ([Install guide](../mycelium-network/install))
|
|
- ✅ **SSH key pair** - For node access
|
|
- ✅ **kubectl installed** - For managing your cluster ([Install kubectl](https://kubernetes.io/docs/tasks/tools/))
|
|
- ✅ **Credits** - To fund your deployment
|
|
|
|
<div className="info-box">
|
|
|
|
### 💡 Installing Mycelium is Easy!
|
|
|
|
Most users can install the Mycelium app from their App Store or download the desktop app - no command-line needed!
|
|
|
|
</div>
|
|
|
|
## Step 1: Create Your Account
|
|
|
|
### Sign Up
|
|
|
|
1. Go to [vdc.grid.tf/sign-up](https://vdc.grid.tf/sign-up)
|
|
2. Fill in your details:
|
|
- Email address
|
|
- Password
|
|
- Confirm password
|
|
3. Click **Sign Up**
|
|
|
|
### Verify Email
|
|
|
|
1. Check your email inbox
|
|
2. Click the verification link
|
|
3. Your account is now active
|
|
|
|
## Step 2: Set Up Your Account
|
|
|
|
### Add Credits
|
|
|
|
1. Log in to your dashboard
|
|
2. Navigate to **Credits** or **Billing** section
|
|
3. Add funds to your account
|
|
- Choose payment method
|
|
- Enter amount
|
|
- Complete payment
|
|
|
|
Your credits will be used to pay for cluster resources (CPU, RAM, storage, time).
|
|
|
|
### Add SSH Key
|
|
|
|
1. Navigate to **SSH Keys** section (or **Add SSH** card)
|
|
2. Click **Add SSH Key**
|
|
3. Paste your **public key** (usually `~/.ssh/id_rsa.pub`)
|
|
4. Give it a name
|
|
5. Save
|
|
|
|
<div className="info-box">
|
|
|
|
### 🔐 Need an SSH Key?
|
|
|
|
If you don't have one:
|
|
|
|
```bash
|
|
# Generate a new SSH key pair
|
|
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
|
|
|
|
# View your public key
|
|
cat ~/.ssh/id_rsa.pub
|
|
```
|
|
|
|
Copy the output and paste it into the dashboard.
|
|
|
|
</div>
|
|
|
|
## Step 3: Deploy Your First Cluster
|
|
|
|
### Access Deployment Page
|
|
|
|
1. From your dashboard, click **Deploy Cluster** or **New Cluster**
|
|
2. You'll see the cluster configuration wizard
|
|
|
|
### Configure Your Cluster
|
|
|
|
#### Basic Settings
|
|
|
|
- **Cluster Name**: Give your cluster a unique name
|
|
- **Description**: Optional description of the cluster purpose
|
|
|
|
#### Master Nodes
|
|
|
|
Configure your control plane nodes:
|
|
|
|
- **Count**: Number of master nodes
|
|
- 1 for development/testing
|
|
- 3 for production (high availability)
|
|
- **CPU**: Number of cores per master (2-4 recommended)
|
|
- **RAM**: Memory per master (4-8GB recommended)
|
|
- **Storage**: Disk space per master (20-50GB)
|
|
|
|
#### Worker Nodes
|
|
|
|
Configure your workload nodes:
|
|
|
|
- **Count**: Number of worker nodes (1-10+)
|
|
- **CPU**: Cores per worker (based on workload)
|
|
- **RAM**: Memory per worker (based on workload)
|
|
- **Storage**: Disk space per worker (based on workload)
|
|
|
|
**Example Configuration (Starter):**
|
|
```
|
|
Masters: 1 node (2 CPU, 4GB RAM, 25GB storage)
|
|
Workers: 2 nodes (2 CPU, 4GB RAM, 50GB storage each)
|
|
```
|
|
|
|
### Select Nodes
|
|
|
|
1. The system will show available ThreeFold Grid nodes
|
|
2. Select nodes for your deployment
|
|
- Choose based on location, specs, and availability
|
|
- System may auto-select optimal nodes
|
|
3. Review your selections
|
|
|
|
### Review & Deploy
|
|
|
|
1. Review your configuration:
|
|
- Node counts and specs
|
|
- Selected grid nodes
|
|
- Estimated cost
|
|
2. Confirm you have sufficient credits
|
|
3. Click **Deploy**
|
|
|
|
The deployment process will begin. This typically takes 5-15 minutes.
|
|
|
|
## Step 4: Access Your Cluster
|
|
|
|
Once deployed, you can access your cluster in two ways: kubectl and SSH.
|
|
|
|
### Method 1: kubectl Access
|
|
|
|
#### Download kubeconfig
|
|
|
|
1. Go to **Dashboard** → **Clusters**
|
|
2. Find your cluster
|
|
3. Click the download icon (⬇️) or **Get Config**
|
|
4. Save the file (e.g., `mycluster-config.yaml`)
|
|
|
|
#### Configure kubectl
|
|
|
|
```bash
|
|
# Set kubeconfig for this session
|
|
export KUBECONFIG=/path/to/mycluster-config.yaml
|
|
|
|
# Or copy to default location
|
|
mkdir -p ~/.kube
|
|
cp mycluster-config.yaml ~/.kube/config
|
|
|
|
# Test connection
|
|
kubectl get nodes
|
|
```
|
|
|
|
You should see your cluster nodes listed!
|
|
|
|
```
|
|
NAME STATUS ROLES AGE VERSION
|
|
master-1 Ready control-plane,master 10m v1.26.0+k3s1
|
|
worker-1 Ready <none> 9m v1.26.0+k3s1
|
|
worker-2 Ready <none> 9m v1.26.0+k3s1
|
|
```
|
|
|
|
### Method 2: SSH Access
|
|
|
|
#### Start Mycelium
|
|
|
|
If not already running, start Mycelium on your local machine:
|
|
|
|
**Using the App (Easy):**
|
|
1. Open the Mycelium app
|
|
2. Click **Start**
|
|
3. That's it!
|
|
|
|
**Using Command-Line (Linux):**
|
|
```bash
|
|
sudo mycelium --peers \
|
|
tcp://188.40.132.242:9651 \
|
|
tcp://185.69.166.8:9651
|
|
```
|
|
|
|
#### Get Node IPs
|
|
|
|
From your dashboard:
|
|
1. Go to your cluster details
|
|
2. Find the **Mycelium IPs** for each node
|
|
3. Note them down (e.g., `400:1234:5678:abcd::1`)
|
|
|
|
#### SSH to Nodes
|
|
|
|
```bash
|
|
# SSH to master node
|
|
ssh root@400:1234:5678:abcd::1
|
|
|
|
# SSH to worker node
|
|
ssh root@400:1234:5678:abcd::2
|
|
```
|
|
|
|
You're now connected to your cluster node!
|
|
|
|
## Step 5: Deploy Your First Application
|
|
|
|
Let's deploy a simple web application to test your cluster.
|
|
|
|
### Create a Deployment
|
|
|
|
```bash
|
|
# Create an nginx deployment
|
|
kubectl create deployment hello-web --image=nginx:latest
|
|
|
|
# Check deployment status
|
|
kubectl get deployments
|
|
kubectl get pods
|
|
```
|
|
|
|
### Expose the Service
|
|
|
|
```bash
|
|
# Expose as a service
|
|
kubectl expose deployment hello-web --port=80 --type=ClusterIP
|
|
|
|
# Check service
|
|
kubectl get services
|
|
```
|
|
|
|
### Access the Service
|
|
|
|
```bash
|
|
# Port forward to your local machine
|
|
kubectl port-forward service/hello-web 8080:80
|
|
```
|
|
|
|
Open `http://localhost:8080` in your browser. You should see the nginx welcome page!
|
|
|
|
## Step 6: Monitor Your Cluster
|
|
|
|
### Using Dashboard
|
|
|
|
Your Mycelium Cloud dashboard shows:
|
|
- Cluster status (running, stopped, etc.)
|
|
- Resource usage
|
|
- Cost tracking
|
|
- Node health
|
|
|
|
### Using kubectl
|
|
|
|
```bash
|
|
# View cluster info
|
|
kubectl cluster-info
|
|
|
|
# Check node status
|
|
kubectl get nodes
|
|
|
|
# View all resources
|
|
kubectl get all --all-namespaces
|
|
|
|
# Check cluster events
|
|
kubectl get events
|
|
```
|
|
|
|
## Managing Your Cluster
|
|
|
|
### Scale Workers
|
|
|
|
Add more worker nodes:
|
|
1. Go to cluster details in dashboard
|
|
2. Click **Scale** or **Add Nodes**
|
|
3. Configure new worker nodes
|
|
4. Deploy
|
|
|
|
### Delete Resources
|
|
|
|
```bash
|
|
# Delete the test deployment
|
|
kubectl delete deployment hello-web
|
|
kubectl delete service hello-web
|
|
```
|
|
|
|
### Stop/Start Cluster
|
|
|
|
From the dashboard:
|
|
- **Stop**: Pause cluster (saves costs)
|
|
- **Start**: Resume cluster
|
|
- **Delete**: Permanently remove (frees all resources)
|
|
|
|
## Troubleshooting
|
|
|
|
### Can't Connect with kubectl
|
|
|
|
1. **Check kubeconfig**: Ensure KUBECONFIG is set correctly
|
|
2. **Verify Mycelium**: Make sure Mycelium is running
|
|
3. **Check cluster status**: Ensure cluster is running in dashboard
|
|
4. **Test network**: Try pinging cluster nodes via Mycelium IPs
|
|
|
|
```bash
|
|
# Test Mycelium connectivity
|
|
ping6 <cluster-node-mycelium-ip>
|
|
```
|
|
|
|
### Can't SSH to Nodes
|
|
|
|
1. **Mycelium running**: Ensure Mycelium daemon is active
|
|
2. **SSH key added**: Verify your public key is in dashboard
|
|
3. **Correct IP**: Double-check Mycelium IP from dashboard
|
|
4. **Network access**: Test with `ping6` first
|
|
|
|
### Pods Not Starting
|
|
|
|
```bash
|
|
# Check pod status
|
|
kubectl describe pod <pod-name>
|
|
|
|
# Check node resources
|
|
kubectl top nodes
|
|
|
|
# Check events
|
|
kubectl get events --sort-by='.lastTimestamp'
|
|
```
|
|
|
|
## What's Next?
|
|
|
|
Now that you have a cluster running, explore more:
|
|
|
|
- **[Tutorial](tutorial)** - Deploy real applications
|
|
- **[Kubernetes Concepts](https://codescalers.github.io/www_kubecloud/kubernetes-concepts)** - Learn K8s fundamentals
|
|
- **[FAQ](https://codescalers.github.io/www_kubecloud/faq)** - Common questions
|
|
|
|
## Resources
|
|
|
|
- **Dashboard**: [vdc.grid.tf](https://vdc.grid.tf)
|
|
- **Kubernetes Docs**: [kubernetes.io/docs](https://kubernetes.io/docs/)
|
|
- **kubectl Cheat Sheet**: [kubernetes.io/docs/reference/kubectl/cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
|
|
- **Community**: [Telegram](https://t.me/threefold/1)
|
|
|
|
---
|
|
|
|
:::tip Cluster Running Successfully?
|
|
Great! Now try the **[Tutorial](tutorial)** to deploy more complex applications.
|
|
:::
|