feat: RunnerDeployment

Adds the initial version of RunnerDeployment that is intended to manage RunnerSets(#1), like Deployment manages ReplicaSets.

This is the initial version and therefore is bare bone. The only update strategy it supports is `Recreate`, which recreates the underlying RunnerSet when the runner template changes. I'd like to add `RollingUpdate` strategy once this is merged.

This depends on #1 so the diff contains that of #1, too. Please see only the latest commit for review.

Also see https://github.com/mumoshu/actions-runner-controller-ci/runs/471329823?check_suite_focus=true to confirm that `make tests` is passing after changes made in this commit.
This commit is contained in:
Yusuke Kuoka
2020-02-26 21:23:23 +09:00
parent d8d829b734
commit 9d634d88ff
11 changed files with 947 additions and 120 deletions

11
main.go
View File

@@ -121,6 +121,17 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "RunnerSet")
os.Exit(1)
}
runnerDeploymentReconciler := &controllers.RunnerDeploymentReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("RunnerDeployment"),
Scheme: mgr.GetScheme(),
}
if err = runnerDeploymentReconciler.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "RunnerDeployment")
os.Exit(1)
}
// +kubebuilder:scaffold:builder
setupLog.Info("starting manager")