Context:
With Rancher Manager version support ranging from k8s 1.23 to 1.31, we can't rely on a uniq kubectl version when building and running the security-scan. Since one kubectl can only cover up to three k8s versions. See kubectl version skew policy.
To do:
Alternative 1:
Alternative 2:
Develop a Go script to do the following:
- Connect to the server to check the version, then pick what kubectl version to choose.
- Have a place (and naming) for multiple kubectl binaries.
- Auto select the closest
kubectl version to the api server (semver helps there).
- Install kubectl version at runtime