in tools/scaler/scaler.go [93:125]
func main() {
app := kingpin.New(filepath.Base(os.Args[0]), "The Prombench-Scaler tool")
app.HelpFlag.Short('h')
s := newScaler()
k8sApp := app.Command("scale", "Scale a Kubernetes deployment object periodically up and down. \nex: ./scaler scale -v NAMESPACE:scale -f fake-webserver.yaml 20 1 15m").
Action(s.k8sClient.DeploymentsParse).
Action(s.scale)
k8sApp.Flag("file", "yaml file or folder that describes the parameters for the deployment.").
Required().
Short('f').
ExistingFilesOrDirsVar(&s.k8sClient.DeploymentFiles)
k8sApp.Flag("vars", "When provided it will substitute the token holders in the yaml file. Follows the standard golang template formating - {{ .hashStable }}.").
Short('v').
StringMapVar(&s.k8sClient.DeploymentVars)
k8sApp.Arg("max", "Number of Replicas to scale up.").
Required().
Int32Var(&s.max)
k8sApp.Arg("min", "Number of Replicas to scale down.").
Required().
Int32Var(&s.min)
k8sApp.Arg("interval", "Time to wait before changing the number of replicas.").
Required().
DurationVar(&s.interval)
if _, err := app.Parse(os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, errors.Wrapf(err, "Error parsing commandline arguments"))
app.Usage(os.Args[1:])
os.Exit(2)
}
}