Reduce your kubernetes cost by making all your deployments on-demand with Proxless.
Deploy Proxless in front of your services and it will scale down the associated deployments when they are not requested and scale them back up when they are.
No need a CRD, no need a huge stack, the proxless deployment is the only thing u need.
Openshift friendly
Proxless is provided in alpha mode.
Using it on your production cluster is done at your own risks.
Proxless is a simple proxy written in golang and consume a minimum of resources.
You don't need to run anything other than proxless deployment and it will not modify your existing resources.
Proxless looks for the services in the cluster that have a specific annotation and scale up and down their associated deployment.
Note: in order for proxless to be fully high available, all the replicas need to sync up the lastUsed
time for each request between each other.
In order to achieve that, a non persistent standalone redis is needed. This configuration is fully optional and provided in the helm chart.
Check the documentation for more information.
- Namespace scoped
- env var
NAMESPACE_SCOPED
must betrue
- proxless will only look for services within its namespace. - a
Role
is required.
- env var
- Cluster wide
- env var
NAMESPACE_SCOPED
is `false - proxless will look for any services in the cluster. - a
ClusterRole
is required. See here.
- env var
Tested with K8S 1.14+
$ kubectl apply -f deploy/kubectl/proxless.yaml
This will deploy a proxless scoped to your namespace.
Use the helm chart below to make it cluster wide.
You can use our helm chart for a more configurable approach.
With the chart, you will be able to configure the High Availability and choose if you want proxless to be installed cluster wide or not.
Deploy the example.
It's a basic nginx pod doing a proxy_pass
to a hello-world api pod.
By default, the 2 pods are scaled down.
$ kubectl apply -f example/kubectl/example.yaml
Port-forward to your proxless deployment.
$ kubectl port-forward svc/proxless 8080:80
Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80
$ curl -H "Host: www.example.io" localhost:8080
{"message":"Hello"}
$ curl -H "Host: example.io" localhost:8080
{"message":"Hello"}
More information here
Duplicate the .env.example
file into a .env
file and modify the variables accordingly
Then run
$ go run cmd/main.go
Benjamin APPREDERISSE - @benhazard42
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/bappr/kube-proxless/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request