You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kubethor is a Kubernetes management web application built using Go and React. It provides a user-friendly interface to manage and monitor Kubernetes clusters efficiently.
kubethor/ +-- kubethor-frontend/ # React frontend | +-- public/ # Public assets | +-- src/ # React source code | +-- assets # Contains frontend assets | +-- components # Contains commonly used hooks and components | +-- layouts # Contains common page layouts | +-- pages # Contains pages component | +-- App.jsx | +-- ... # Other frontend files | +-- package.json # Node.js dependencies | +-- ... # Other frontend files | +-- kubethor-backend/ # Go backend | +-- main.go # Main Go application | +-- go.mod # Go module dependencies | +-- api # Contains api's | +-- config # Contains configuration | +-- build.sh # Build script for standalone app | +-- k8s.yaml # Kubernetes deployment file | +-- Dockerfile # Kubernetes deployment file | +-- dist # Compiled React build (Need to copy from frontend folder after build) | +-- ... # Other backend files and folders | +-- README.md # Project README +-- ... # Other project files
kubethor-frontend/
public/: Contains static assets such as images, fonts, and the index.html file that serves as the entry point for the React application.
src/: The main source code for the React application.
assets/: Contains frontend assets such as images, icons, and styles.
components/: Contains reusable React components and hooks used throughout the application.
layouts/: Contains layout components that define the structure of common page layouts.
pages/: Contains page components that represent different views or routes in the application.
App.jsx: The main application component that sets up the routing and renders the core layout of the application.
package.json: Defines the Node.js dependencies and scripts for the frontend project.
kubethor-backend/
main.go: The main Go application file that initializes and runs the backend server.
go.mod: Defines the Go module dependencies for the backend project.
api/: Contains the API implementations that the backend server exposes.
config/: Contains configuration files for different environments and settings used by the backend.
build.sh: A build script used to compile the standalone backend application and manage the build process.
k8s.yaml: The Kubernetes deployment file that specifies how to deploy the backend application on a Kubernetes cluster.
Dockerfile: The Docker build file used to create a Docker image for the backend application.
dist/: A directory where the compiled React build is copied from the frontend folder after the build process. This allows the backend to serve the frontend application.
The backend application will run on http://localhost:8080.
Start the Frontend:
Navigate to the frontend directory:
cd ../kubethor-frontend
Start the development server:
npm run dev
The frontend application will run on http://localhost:3000.
Running the Application as Standalone
Build the Standalone Application:
Navigate to the kubethor-backend directory:
cd kubethor-backend
Run the build.sh script:
./build.sh
Note: The build.sh script builds the React application, copies it into the kubethor-backend folder, and then embeds it into the Go executable. This single executable can be run to serve the entire application on http://localhost:8080 without needing to run the frontend separately.
Run the Standalone Application:
After running build.sh, start the application:
./kubethor-backend
The application will be available at http://localhost:8080.
Build and Run Docker Image
As the Docker image is also a type of standalone application, ensure you copy the latest dist folder into the kubethor-backend folder. If you are building the image to deploy on a host server, make sure to change the API_BASE_URL and API_WS_URL in kubethor-frontend with your host name. The build.sh script builds the React application, copies it into the kubethor-backend folder. It is good to run build.sh before building your docker image.
Build the Docker Image:
Navigate to the kubethor-backend directory:
cd kubethor-backend
Build the Docker image:
docker build --no-cache -t kubethor-backend .
Run the Docker Container:
Run the Docker container:
docker run -p 8080:8080 kubethor-backend
Push to Docker Registry:
Log in to your Docker registry:
docker login YOUR_REGISTERY.com
Tag the Docker image:
docker tag kubethor-backend:latest YOUR_REGISTERY.com/kubethor/kubethor-backend:latest
Ensure you have a Kubernetes cluster running and kubectl configured to interact with it.
Update the k8s.yaml file in the kubethor-backend directory with your Docker image link and host URL:
Apply the Kubernetes configuration:
kubectl apply -f k8s.yaml -n my-namespace
After successful deployment, go to your host url
Note: Ensure you have the necessary permissions to deploy resources to your Kubernetes cluster. The k8s.yaml file contains the configuration for deploying the Kubethor application, including deployment, service, ingress, and horizontal pod autoscaler and other resources needed for the application to run in a Kubernetes environment.
Support
GitHub Issues
See the SUPPORT.md file for information on how to open an issue against this repository.