IPPR is a Go-based web service designed to interact with the Kubernetes API. It provides endpoints to view and dynamically update the CPU and memory resources of a Kubernetes pod. The application can run both inside and outside a Kubernetes cluster, automatically detecting its environment to configure the Kubernetes client.
- Go (version 1.22 or later)
- Docker
- A Kubernetes cluster (e.g., Minikube, Kind, or a cloud-based provider)
kubectlconfigured to interact with your cluster
To run the application locally, you will need to have a Kubernetes cluster accessible and your kubeconfig file properly configured.
-
Clone the repository:
git clone https://github.com/moficodes/ippr.git cd ippr -
Run the application:
go run .The application will start on port 8080. By default, it will try to connect to a pod named
ipprin theipprnamespace. You can change this by setting thePOD_NAMEandNAMESPACEenvironment variables.
To build the Docker image:
docker build -t ippr:latest .The Dockerfile uses a multi-stage build to create a minimal final image.
The k8s directory contains the necessary Kubernetes manifests to deploy the application.
-
Create the namespace:
kubectl create namespace ippr
-
Apply the manifests:
kubectl apply -f k8s/
This will create a pod, a service account, and a service in the ippr namespace.