Skip to content
gitmahinPublic

About

kubehost is a deployment platform that handles networking, load balancing and HA complexities behind the scenes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

KubeHost

A deployment platform for your apps - like a cloud provider, but self-hosted.

Just provide your Docker image - kubehost handles networking, load balancing and HA complexities behind the scenes.

Show me how to deploy my cloud infrastructure and applications

alt text alt text

We've all been there: it's a hackathon, your app is ready, and now you're burning your last hours setting up a server just to make it live. KubeHost solves that.

Give it a Docker image and a domain, and your app is live. That's it. (Built on top of Kubernetes)

Warning

Not for production. KubeHost is meant for demos, hackathons, and competition projects - a quick, temporary way to get something live. It's not built or hardened for hosting real, production applications.

How it works

  1. Create a project
  2. Create a deployment
  3. Give it your Docker image
  4. Add a domain. By default, / (the root) points to your deployment. You can optionally add extra paths under the same domain to route traffic to other deployments - for example, if example.com serves your client app, you can add example.com/api to route API requests to your backend/API deployment.
  5. Point your domain's DNS to your VPS's public IP

Your app is now live. specific deployment.

Connecting services to each other (e.g. a database)

Don't use localhost to connect one deployment to another - use the deployment's name as the host instead.

Example: if your database deployment is named my-database, set DB_HOST=my-database in your app - not localhost, not an IP.

Requirements

Install these on your VPS (or local machine) before using KubeHost:

Install (on a VPS)

curl -sSL https://raw.githubusercontent.com/gitmahin/kubehost/main/install.sh | sudo bash

See all commands:

kubehost --help

Warning

Before starting, grant your user permission to run Docker commands without sudo.

sudo usermod -aG docker $USER
newgrp docker

Start it:

kubehost --api-server http://<your_domain>:3000/api

Port 3000/api is required - that's where the API server listens.

Don't worry about port conflicts between your deployments - even if two services use the same port, KubeHost routes them correctly on its own.

Once KubeHost starts successfully, open the dashboard in your browser:

http://<your_domain>:3001

Warning

Do not change ports 3000 or 3001. These are fixed and required:

  • Port 3000 - API server (used internally)
  • Port 3001 - Client dashboard (this is what you open in your browser)

If these ports are blocked, changed, or not opened in your firewall/security group, you will not be able to access the dashboard or use KubeHost at all.

Setup Inbound rules (e.g. AWS EC2 security group)

Type Port Source
TCP 3000 0.0.0.0/0
TCP 3001 0.0.0.0/0
TCP 80 0.0.0.0/0

Running locally

Linux:

kubehost --api-server http://localhost:3000/api

Locally you have to provide localhost here But rest is same as Production deployment

Windows: the CLI requires Linux, so clone and run it manually instead:

git clone https://github.com/gitmahin/kubehost.git
cd kubehost
pnpm install
pnpm dev

Quick Start

  1. Create AWS ec2

  2. Install docker engine

  3. Install minikube

  4. sudo usermod -aG docker $USER
    newgrp docker
  5. Create domain for kubehost client (free or paid) and attach with public ip of your AWS EC2

  6. curl -sSL https://raw.githubusercontent.com/gitmahin/kubehost/main/install.sh | sudo bash
  7. kubehost --api-server http://<your_domain>:3000/api
  8. Add inbound rules

    Type Port Source
    TCP 3000 0.0.0.0/0
    TCP 3001 0.0.0.0/0
    TCP 80 0.0.0.0/0
  9. Give it a moment to provision kubehost apiserver and then open in browser: http://<your_domain>:3001

  10. Create new project

  11. Create new application deployment.

Warning

(For publicly accessible applications, keep the port binding set to 80; otherwise, they won’t be accessible.)

  1. Get domain for your application
  2. Attach the domain with public ip of AWS EC2 and done.
  3. Attach a service with your created application?
    1. Create new deployment for that service.
    2. Copy the deployment name and use it as host
    3. Pass the address of your service to that application via env (e.g. postgresql://username:password@<deployment_name>:<bounded_port>/database_name)

Happy deploying! 🚀

About

kubehost is a deployment platform that handles networking, load balancing and HA complexities behind the scenes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages