Automatically scale down idle cloud resources to reduce costs
πΈ Think of it as "turning the lights off when the room is empty." πΈ
# Static configurationexperimental:localPlugins:traefik_cloud_saver:moduleName: github.com/danbiagini/traefik-cloud-saverversion: v0.1.0
providers:plugin:traefik_cloud_saver:windowSize: 1mmetricsURL: http://localhost:8080/metricsapiURL: http://localhost:8080/apitrafficThreshold: 1debug: truecloudConfig:type: gcpregion: <your-region>zone: <your-zone>credentials:secret: <path-to-service-account-json-file>type: service_account
You need to provide a service account json file in the container, for example at /etc/gcp/test_service_account.json
, or use a different path, but change the secret
path in the above config.
Plugin Not Loading
Scaling Not Working
Enable debug logging in configuration:
debug: true
The plugin logs to traefik logs, search for traefik-cloud-saver
in the logs.
There is an integration test that can be run to check that the GCE credentials are valid. See the file compute_integration_test.go for details on how to run it.
# Install dependenciesmake vendor# Run testsmake test# Build test containermake build-test-container
make test
# Set up GCP credentials firstmake integration-test
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
Copyright 2024 Dan Biagini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.