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.
Frontend
Backend
docker pull kubethor/kubethordocker run -p 8080:8080 kubethor/kubethorFor more details about the Docker image, visit the Kubethor Docker Hub page.
Here's an overview of the project structure:
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.Video:
Clone the repository:
git clone [email protected]:sassoftware/kubethor.git
cd kubethorFrontend Setup:
Navigate to the kubethor-frontend directory:
cd ../kubethor-frontendInstall the dependencies:
npm installIf any error use:
npm config set registry https://registry.npmjs.org/
npm install --verboseBuild the React app:
npm run buildFor running React app in Development Environment:
npm run devBackend Setup:
Navigate to the kubethor-backend directory:
cd ../kubethor-backendCopy dist folder [React app build to backend] from kubethor-frontend into kubethor-backend directory:
cp -r ../kubethor-frontend/dist/ ../kubethor-backendDownload all dependencies:
go mod downloadBuild the Go application:
go build -o kubethor-backendStart the Backend:
Navigate to the backend directory:
cd kubethor-backendRun the Go application:
./kubethor-backendThe backend application will run on http://localhost:8080.
Start the Frontend:
Navigate to the frontend directory:
cd ../kubethor-frontendStart the development server:
npm run devThe frontend application will run on http://localhost:3000.
Build the Standalone Application:
Navigate to the kubethor-backend directory:
cd kubethor-backendRun the build.sh script:
./build.shNote: The
build.shscript builds the React application, copies it into thekubethor-backendfolder, and then embeds it into the Go executable. This single executable can be run to serve the entire application onhttp://localhost:8080without needing to run the frontend separately.
Run the Standalone Application:
After running build.sh, start the application:
./kubethor-backendThe application will be available at http://localhost:8080.
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-backendBuild the Docker image:
docker build --no-cache -t kubethor-backend .Run the Docker Container:
Run the Docker container:
docker run -p 8080:8080 kubethor-backendPush to Docker Registry:
Log in to your Docker registry:
docker login YOUR_REGISTERY.comTag the Docker image:
docker tag kubethor-backend:latest YOUR_REGISTERY.com/kubethor/kubethor-backend:latestPush the Docker image:
docker push YOUR_REGISTERY.com/kubethor/kubethor-backendDeploy to Kubernetes Cluster:
Navigate to the kubethor-backend directory:
cd kubethor-backendEnsure 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-namespaceAfter successful deployment, go to your host url
Note: Ensure you have the necessary permissions to deploy resources to your Kubernetes cluster. The
k8s.yamlfile 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.
See the SUPPORT.md file for information on how to open an issue against this repository.
Contributions are welcome! Please read our Contributing Guidelines for more information.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
For any inquiries or support, please reach out to: