The Rancher Upgrade Tool simplifies generating an upgrade plan for Rancher and Kubernetes versions. It uses compatibility rules stored in a JSON file to ensure smooth and efficient upgrades. Visit Rancher Tips for more insights.
- Go Fiber: Web framework for building APIs in Go
- Fiber Prometheus: Middleware for Prometheus metrics in Fiber
- HashiCorp Go Version: Library for version parsing and comparison
main.go
: Contains the main logic for the upgrade plannerdata/upgrade-paths.json
: JSON file containing the upgrade paths and compatibility rules
/api/plan-upgrade/:platform/:rancher/:k8s
: Generates the upgrade plan for the provided Rancher and Kubernetes versions on a specific platform/healthz
: Health check endpoint/metrics
: Prometheus metrics endpoint
- Clone the repository:
git clone https://github.com/SupportTools/rancher-upgrade-tool.git cd rancher-upgrade-tool
- Add the
upgrade-paths.json
file in thedata/
directory with the upgrade paths and rules. - Install dependencies using Go modules:
go mod tidy
- Run the application:
go run main.go
- Make a GET request to
/api/plan-upgrade/:platform/:rancher/:k8s
to get the upgrade plan for the specified platform, Rancher version, and Kubernetes version. - Access Prometheus metrics data at
/metrics
.
The application exposes custom metrics for monitoring and analysis:
requests_in_last_60_seconds
: Counts incoming requests in the last 60 secondsversions_submitted_total
: Tracks the total number of Rancher and Kubernetes versions submittedrequest_duration_seconds
: Measures the duration of each requestactive_requests
: Tracks the number of active requests being processed
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.