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.
- Cluster Management: Easily manage multiple Kubernetes clusters.
- Resource Monitoring: Visualize and monitor Kubernetes resources such as Pods, Services, Deployments, etc.
- Log Aggregation: Centralized logging to view logs from different containers.
- Resource Editor: Edit Kubernetes resources directly from the web interface.
- Resource Delete: Delete Kubernetes resources with ease.
- Resource Detail View: View detailed information about Kubernetes resources.
- Switch Between Namespaces: Seamlessly switch between different namespaces to manage resources.
-
Frontend
-
Backend
- Go (Golang): The programming language used for the backend.
- Kubernetes Client: Client library for interacting with Kubernetes clusters.
- Pull the Docker Image:
docker pull kubethor/kubethor
- Run the Docker Container:
docker run -p 8080:8080 kubethor/kubethor
- Access the application via http://localhost:8080 on your browser.
For 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.
- Go (version 1.16 or higher)
- Node.js (version 18.x or higher)
- Docker (optional, for containerized deployment)
- kubectl (for interacting with Kubernetes clusters)
-
Clone the repository:
git clone git@github.com:sassoftware/kubethor.git cd kubethor
-
Frontend Setup:
-
Navigate to the
kubethor-frontend
directory:cd ../kubethor-frontend
-
Install the dependencies:
npm install
If any error use:
npm config set registry https://registry.npmjs.org/ npm install --verbose
-
Build the React app:
npm run build
-
For running React app in Development Environment:
npm run dev
-
-
Backend Setup:
-
Navigate to the
kubethor-backend
directory:cd ../kubethor-backend
-
Copy dist folder [React app build to backend] from
kubethor-frontend
intokubethor-backend
directory:cp -r ../kubethor-frontend/dist/ ../kubethor-backend
-
Download all dependencies:
go mod download
-
Build the Go application:
go build -o kubethor-backend
-
-
Start the Backend:
-
Navigate to the
backend
directory:cd kubethor-backend
-
Run the Go application:
./kubethor-backend
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
. -
-
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 thekubethor-backend
folder, and then embeds it into the Go executable. This single executable can be run to serve the entire application onhttp://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
. -
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
-
Push the Docker image:
docker push YOUR_REGISTERY.com/kubethor/kubethor-backend
-
-
Deploy to Kubernetes Cluster:
-
Navigate to the
kubethor-backend
directory:cd kubethor-backend
-
Ensure you have a Kubernetes cluster running and
kubectl
configured to interact with it. -
Update the
k8s.yaml
file in thekubethor-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. -
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: