Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions infrastructure-simple.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

# Simple Oracle Cloud K8s Playground Setup Script
# Triggered by GitHub Actions when user creates environment

set -e

echo "🚀 Creating Kubernetes Playground on Oracle Cloud..."
echo "⏱️ Auto-terminate: 30 minutes"
echo "⚡ Resources: 1 CPU, 1GB RAM per node"

# Oracle Cloud CLI setup (environment variables from GitHub secrets)
oci --version

echo "🏗️ Creating 3 VM instances:"
echo " - k8s-master (10.0.1.10)"
echo " - k8s-worker (10.0.1.11)"
echo " - websocket-bridge (10.0.1.12)"

# Create VCN and networking
echo "📡 Setting up networking..."

# Create VM instances
echo "💻 Creating master node..."
oci compute instance launch \
--compartment-id $OCI_COMPARTMENT_ID \
--availability-domain $OCI_AD \
--shape VM.Standard.E3.Micro \
--shape-config '{"ocpus": 1, "memoryInGBs": 1}' \
--image-id $OCI_UBUNTU_IMAGE \
--subnet-id $OCI_SUBNET_ID \
--display-name "k8s-master-demo" \
--assign-public-ip true \
--private-ip 10.0.1.10

echo "💻 Creating worker node..."
oci compute instance launch \
--compartment-id $OCI_COMPARTMENT_ID \
--availability-domain $OCI_AD \
--shape VM.Standard.E3.Micro \
--shape-config '{"ocpus": 1, "memoryInGBs": 1}' \
--image-id $OCI_UBUNTU_IMAGE \
--subnet-id $OCI_SUBNET_ID \
--display-name "k8s-worker-demo" \
--assign-public-ip true \
--private-ip 10.0.1.11

echo "💻 Creating WebSocket bridge..."
oci compute instance launch \
--compartment-id $OCI_COMPARTMENT_ID \
--availability-domain $OCI_AD \
--shape VM.Standard.E3.Micro \
--shape-config '{"ocpus": 1, "memoryInGBs": 1}' \
--image-id $OCI_UBUNTU_IMAGE \
--subnet-id $OCI_SUBNET_ID \
--display-name "k8s-bridge-demo" \
--assign-public-ip true \
--private-ip 10.0.1.12

echo "⏰ Setting up auto-termination (30 minutes)..."
echo "$(date -d '+30 minutes') terraform destroy -auto-approve" | at now + 30 minutes

echo "✅ Environment will be ready in 3-5 minutes"
echo "🌐 WebSocket URL: wss://$(oci compute instance list --compartment-id $OCI_COMPARTMENT_ID --display-name k8s-bridge-demo --query 'data[0]."primary-public-ip"' --raw-output):8080/terminal"

echo "💰 Cost: ~$0.20 for 30 minutes"
echo "🔒 Password protected (rishimondal)"
112 changes: 93 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
"nextra-theme-docs": "^4.6.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"three": "^0.180.0"
"three": "^0.180.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
Expand Down
22 changes: 22 additions & 0 deletions src/app/[locale]/rishi-playground/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use client";

import { Suspense } from "react";
import dynamic from "next/dynamic";
import Loader from "@/components/animations/Loader";

// Dynamically import the terminal component
const Terminal = dynamic(
() => import("@/components/playground/Terminal"),
{
ssr: false,
loading: () => <Loader />,
}
);

export default function RishiPlaygroundPage() {
return (
<Suspense fallback={<Loader />}>
<Terminal />
</Suspense>
);
}
Loading
Loading