Commit Graph

87 Commits

Author SHA1 Message Date
Rui Chen 79f15b4906
Make defaultDockerImage to 19.03.8 2020-04-15 19:47:07 -04:00
Moto Ishizawa 5714459c24
Merge pull request #31 from summerwind/github-package
Use github package to access the GitHub API
2020-04-14 16:30:26 +09:00
Moto Ishizawa ab28dde0ec Add github package to container image 2020-04-13 22:29:48 +09:00
Moto Ishizawa 3ccc51433f Use github package to access the GitHub API 2020-04-13 22:28:07 +09:00
Moto Ishizawa 5f608058cd Add github package 2020-04-13 22:27:05 +09:00
Moto Ishizawa a91df5c564
Merge pull request #29 from summerwind/add-github-apps-doc
Add section to use GitHub App
2020-04-11 21:33:37 +09:00
Moto Ishizawa 0bb6f64470 Add section to use GitHub App 2020-04-10 15:42:27 +09:00
Moto Ishizawa ce40635d1e
Merge pull request #28 from chenrui333/update-default-base-image
Update defaultRunnerImage to v2.168.0
2020-04-10 14:12:07 +09:00
Rui Chen 52c0f2e4f3
Update defaultRunnerImage to v2.168.0 2020-04-09 20:16:52 -04:00
Yusuke Kuoka b411d37f2b fix: RunnerDeployment should clean up old RunnerReplicaSets ASAP
Since the initial implementation of RunnerDeployment and until this change, any update to a runner deployment has been leaving old runner replicasets until the next resync interval. This fixes that, by continusouly retrying the reconcilation 10 seconds later to see if there are any old runner replicasets that can be removed.

In addition to that, the cleanup of old runner replicasets has been improved to be deferred until all the runners of the newest replica set to be available. This gives you hopefully zero or at less downtime updates of runner deployments.

Fixes #24
2020-04-04 07:55:12 +09:00
Vito Botta a19cd373db Bump Docker version 2020-04-02 08:32:27 +09:00
Vito Botta f2dcb5659d Add runner user to sudo group 2020-04-02 08:32:27 +09:00
Moto Ishizawa b8b4ef4b60
Merge pull request #21 from summerwind/add-permission-events
Add permission to create/patch events resource
2020-03-28 22:18:58 +09:00
Moto Ishizawa cac199f16e
Merge pull request #20 from summerwind/github-apps-support
Add support of GitHub Apps authentication
2020-03-28 22:18:36 +09:00
Moto Ishizawa 5efdc6efe6 Add permission to create/patch events resource 2020-03-27 23:25:37 +09:00
Moto Ishizawa af81c7f4c9 Add environment variables and volumes for GitHub Apps credentials 2020-03-26 23:12:54 +09:00
Moto Ishizawa 80122a56d7 Add flags for GitHub Apps credentials 2020-03-26 23:12:11 +09:00
Adam Jensen 934ec7f181
Clarify instructions for getting a token (#18)
* Clarify instructions for getting a token

* Fix typo
2020-03-25 21:22:19 +09:00
Moto Ishizawa 49160138ab
Merge pull request #19 from summerwind/actions-runner-v2.168.0
Update runner to v2.168.0
2020-03-25 17:25:07 +09:00
Moto Ishizawa fac211f5d9 Update runner to v2.168.0 2020-03-25 17:10:25 +09:00
Aleksandr Stepanov d4c849ee09
Add variants of PodTemplate spec fields into the Runner spec (#7)
Resolves #5
Fixes #11
Fixes #12

Changes:

* Added podtemplate spec

* Rework pod creation logic

* Added most using podspecs

* Added copy of podspec

* Fixed Github List method

* Fixed containers

* Added ability to override runner's containers

* Added ability to override runner's containers

* Added ability to override runner's containers

* Update controllers/runner_controller.go

Co-Authored-By: Moto Ishizawa <summerwind.jp@gmail.com>

* Remove optional restartpolicy

* Changed naming convention

Co-authored-by: Moto Ishizawa <summerwind.jp@gmail.com>
2020-03-20 22:50:50 +09:00
Moto Ishizawa 23538d43b3
Merge pull request #9 from jorge07/patch-1
Readme fix requirements
2020-03-18 19:52:15 +09:00
Jorge Arco d3aa21f583
Readme fix requirements 2020-03-17 11:48:41 +01:00
Moto Ishizawa ccce752259 Add sample manifest of RunnerDeployment and RunnerReplicaSet 2020-03-15 22:08:01 +09:00
Moto Ishizawa bbcfa10459 Update custom resource information 2020-03-15 22:07:27 +09:00
Moto Ishizawa 9ad8064db6 Split files according to the kubebuilder style 2020-03-15 22:06:50 +09:00
Moto Ishizawa b1da3092fb Revert test comment 2020-03-15 21:55:38 +09:00
Moto Ishizawa 5aeae6a152 Fix generate name 2020-03-15 21:50:45 +09:00
Moto Ishizawa a897eee402 Fix RBAC role for RunnerDeployment and RunnerReplicaSet 2020-03-15 18:08:11 +09:00
Moto Ishizawa 2e9fecb983 Includes RunnerReplicaSet and RunnerDeployment 2020-03-14 22:57:33 +09:00
Moto Ishizawa ce3011fe1b
Merge pull request #6 from mumoshu/rename-runnerset
Rename RunnerSet to RunnerReplicaSet
2020-03-11 21:29:55 +09:00
Yusuke Kuoka c19a1b3ffe Rename RunnerSet to RunnerReplicaSet
To hand over the name `RunnerSet` to the new StatefulSet-based implementation of that being developed at #4
2020-03-10 09:14:34 +09:00
Moto Ishizawa de85823c81
Merge pull request #3 from mumoshu/manual-test-feedbacks
Manual test feedbacks
2020-03-09 23:41:16 +09:00
Yusuke Kuoka d12eca268d Fix validation error on nil for optional slice field (runner.spec.env)
I had observed athe exact issue seen for the 4th option described in https://github.com/elastic/cloud-on-k8s/issues/1822, which resulted in actions-runner-controller is unable to create nor update runners. This fixes that.

I've also updated README to introduce RunnerDeployment and manually tested it to work after the fix.

---

`actions-runner-controller` has been failing while creating and updating runners:

```
2020-03-05T11:05:16.610+0900    ERROR   controllers.Runner      Failed to update runner {"runner": "default/example-runner", "error": "Runner.actions.summerwind.dev \"example-runner\" is invalid: []: Invalid value: map[string]interface {}{\"apiVersion\":\"actions.summerwind.dev/v1alpha1\", \"kind\":\"Runner\", \"metadata\":map[string]interface {}{\"creationTimestamp\":\"2020-03-05T02:05:16Z\", \"finalizers\":[]interface {}{\"runner.actions.summerwind.dev\"}, \"generation\":2, \"name\":\"example-runner\", \"namespace\":\"default\", \"resourceVersion\":\"911496\", \"selfLink\":\"/apis/actions.summerwind.dev/v1alpha1/namespaces/default/runners/example-runner\", \"uid\":\"48b62d07-ff2c-42d6-878c-d3f951202209\"}, \"spec\":map[string]interface {}{\"env\":interface {}(nil), \"image\":\"\", \"repository\":\"mumoshu/actions-runner-controller-ci\"}}: validation failure list:\nspec.env in body must be of type array: \"null\""}
github.com/go-logr/zapr.(*zapLogger).Error
        /Users/c-ykuoka/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
github.com/summerwind/actions-runner-controller/controllers.(*RunnerReconciler).Reconcile
        /Users/c-ykuoka/p/actions-runner-controller/controllers/runner_controller.go:88
```

This seems like the exact issue seen in the 4th option in https://github.com/elastic/cloud-on-k8s/issues/1822

I also observed the same issue is failing while the runnerset controller is trying to create/update runners:

```

Also while creating runner in the runnerset controller:

2020-03-05T11:15:01.223+0900    ERROR   controller-runtime.controller   Reconciler error        {"controller": "runnerset", "request": "default/example-runnerset", "error": "Runner.actions.summerwind.dev \"example-runnersetgp56m\" is invalid: []: Invalid value: map[string]interface {}{\"apiVersion\":\"actions.summerwind.dev/v1alpha1\", \"kind\":\"Runner\", \"metadata\":map[string]interface {}{\"creationTimestamp\":\"2020-03-05T02:15:01Z\", \"generateName\":\"example-runnerset\", \"generation\":1, \"name\":\"example-runnersetgp56m\", \"namespace\":\"default\", \"ownerReferences\":[]interface {}{map[string]interface {}{\"apiVersion\":\"actions.summerwind.dev/v1alpha1\", \"blockOwnerDeletion\":true, \"controller\":true, \"kind\":\"RunnerSet\", \"name\":\"example-runnerset\", \"uid\":\"e26f7d01-3168-496d-931b-8e6f97b776ea\"}}, \"uid\":\"4ee490f5-9a8c-4f30-86f9-61dea799b972\"}, \"spec\":map[string]interface {}{\"env\":interface {}(nil), \"image\":\"\", \"repository\":\"mumoshu/actions-runner-controller-ci\"}}: validation failure list:\nspec.env in body must be of type array: \"null\""}
github.com/go-logr/zapr.(*zapLogger).Error
```

and while the runnerdeployment controller is trying to create/update runners.

I've fixed it so that the new `RunnerDeployment` example added to README just works.
2020-03-09 22:03:07 +09:00
Yusuke Kuoka 4b6806fda3 fix: RunnerDeployment was not working at all after field indexing enhancement 2020-03-06 08:53:46 +09:00
Moto Ishizawa 0edf0d59f7
Merge pull request #2 from mumoshu/runnerdeployment
feat: RunnerDeployments
2020-03-04 22:57:40 +09:00
Yusuke Kuoka 70a8c3db0d chore: Tidy up the deployment controller code
Removes an unnecessary condition from the deployment controller code. We assumed that the client would return a not-found error on an empty runnerset list  it is clearly not the case.
2020-03-03 10:50:52 +09:00
Yusuke Kuoka 31fb7cc113 feat: Efficient runner set looks up for the deployment controller
Enhances the deployment controller to use indexed lookups against runner sets for more scalability.
2020-03-03 10:45:39 +09:00
Moto Ishizawa 338da818be
Merge pull request #1 from mumoshu/runnerset
feat: RunnerSets
2020-03-01 19:35:40 +09:00
Yusuke Kuoka 9d634d88ff 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.
2020-02-27 10:46:23 +09:00
Yusuke Kuoka d8d829b734 feat: RunnerSets
RunnerSet is basically ReplicaSet for Runners.

It is responsible for maintaining number of runners to match the desired one. That is, it creates missing runners from `.Spec.Template` and deletes redundant runners.

Similar to ReplicaSet, this does not support rolling update of runners on its own. We might want to later add `RunnerDeployment` for that. But that's another story.
2020-02-24 10:32:44 +09:00
Moto Ishizawa 7dd3ab43d7 Update default container image 2020-02-19 22:41:11 +09:00
Moto Ishizawa 58cac20109 Docker CLI v19.03.6 2020-02-19 22:39:58 +09:00
Moto Ishizawa cac45f284a actions/runner v2.165.2 2020-02-19 22:37:38 +09:00
Moto Ishizawa f2d3ca672f Unset environment variables for runner config 2020-02-06 22:15:26 +09:00
Moto Ishizawa 829a167303 Add 'env' field to runner resource 2020-02-06 22:09:07 +09:00
Moto Ishizawa c66916a4ee Use dumb-init to handle signal properly 2020-02-06 18:47:50 +09:00
Moto Ishizawa f5c8a0e655 Update README 2020-02-03 21:52:28 +09:00
Moto Ishizawa a436216d5e Implement finalizer 2020-02-03 21:35:01 +09:00
Moto Ishizawa 497ddba82d Record event of runner resource 2020-02-03 18:40:59 +09:00