ECM Distro Tools (codename: dirt-weasel) is a collection of programs, scripts, and utilities that provide for easier administration, management, and interaction with the RKE2 and K3s ecosystems.
There's a mix of C, Go and shell scripts in this repository. The shell scripts reside in the bin
directory and are ready to use. The Go programs are rooted in the cmd
directory and need to be compiled. To compile the Go programs run the following in the root of the project:
make all
To compile the container image locally, perform:
docker build . -t rancher/ecm-distro-tools
The following is a non-exausitve list of the utilities included in this repository and their corresponding usage. (see bin/ and cmd/ for all utility code)
docker run --rm -it rancher/ecm-distro-tools utility_index
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools update_go -o 1.16.3b7 -n 1.17.3b7 -r image-build--envtcd
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools backport -r k3s -m v1.21.5+k3s1 -p v1.21.4+k3s1
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools gen-release-notes -r k3s -m v1.21.5+k3s1 -p v1.21.4+k3s1
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools check_for_k8s_release -r 'v1.23.3 v1.22.6 v1.21.9 v1.20.15'
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools weekly_report -r k3s
Send template output to standard out.
docker run --rm -it rancher/ecm-distro-tools standup
Send template output to a file at ${PWD}
. File will be named YYYY-MM-dd
docker run --rm -it rancher/ecm-distro-tools standup -f
docker run --rm -it rancher/ecm-distro-tools bootstrap_hash -p k3s
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools rancher_image_scan <IMAGE_NAME>
# RKE2 Kubernetes base image
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools tag_image_build_k8s_release -d -r 'v1.23.2-rke2r1'
# RKE2
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools tag_rke2_release -d -m '1.23' -r 'v1.23.5-rc1+rke2r1'
# RKE2 packaging (rpms)
docker run --rm -it --env GITHUB_TOKEN=<TOKEN> rancher/ecm-distro-tools tag_rke2_packaging_release -d -t -r 'v1.22.6+rke2r1'
See seperate documentation for test-pad tool.
We welcome additions to this repo and are excited to keep expanding its functionality.
To contribute, please do the following:
- Open an issue explaining the feature(s) / bug(s) you are looking to add/fix.
- Fork the repo, create a branch, push your changes, and open a pull request.
- Request review
A set of patterns have been established with the Go and shell code that will need to be adhered to. Usage output and flags should be copied and pasted from other code files and adjusted to keep the UX as similar as possible to the rest of the utilities in the repo.
Library code has been written for Go and shell which to simpler access to Github, loggers, and means of validating common checks.
- Go code additions are expected to have been linted, vetted, and fmt'd prior to pushing the code.
- Prefer the standard library over 3rd party libraries when possible
- Shell scripts are expected to be POSIX compliant, avoiding specific shell features for portability. We are currently using
shellcheck
to perform these checks and validations.
ecm-distro-tools source code is available under the Apache Clause License.