#!/bin/bash # Dynamic Mycelium IPv6 Address Discovery Script # This script fetches Mycelium IPv6 addresses from the cluster and generates HTML content set -e echo "🔍 Discovering Mycelium IPv6 addresses..." # Fetch IPv6 addresses from cluster nodes IPV6_ADDRESSES=$(kubectl get nodes -o jsonpath='{range .items[*]}{range .status.addresses[?(@.type=="InternalIP")]}{.address}{"\n"}{end}{end}' | grep -E '^[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+$') if [ -z "$IPV6_ADDRESSES" ]; then echo "❌ No IPv6 addresses found!" exit 1 fi echo "✅ Found IPv6 addresses:" echo "$IPV6_ADDRESSES" # Generate HTML content with dynamic addresses cat > /tmp/index.html << HTML_EOF
This website is globally accessible via Mycelium Cloud!
This demonstrates that you can host a real website that anyone with Mycelium can access from anywhere in the world.
IPv6 addresses are automatically discovered from the cluster!
This page updates every 30 seconds to show the current cluster state.
Your website is accessible via any Mycelium IPv6:
http://[$ipv6]:30090Anyone with Mycelium can access your website from anywhere!
Test if load balancing is working:
curl -H "Cache-Control: no-cache" http://[$(echo "$IPV6_ADDRESSES" | head -1)]:30090
Try multiple requests to see traffic distribute across different pods!
Mycelium Cloud • Real Global Internet Infrastructure
Deploy once, access worldwide! 🌍