Commit Graph

1759 Commits

Author SHA1 Message Date
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
Moto Ishizawa 10f6cb5e90 Add additional printer columns 2020-02-03 17:37:48 +09:00
Moto Ishizawa 13ef78ce20 Sync runner status with pod status 2020-02-03 17:25:38 +09:00
Moto Ishizawa 0061979e3e Add '-github-token' flag 2020-02-03 17:02:27 +09:00
Moto Ishizawa e6952f5ca1 Add '-runner-image' and '-docker-image' flags 2020-02-03 16:56:52 +09:00
Moto Ishizawa ffdbe5cee9 Set container image version properly in the release task 2020-02-03 16:55:38 +09:00
Moto Ishizawa 4970814b6c Do not run build workflow when .github changed 2020-02-03 16:54:49 +09:00
Moto Ishizawa fabcddb3df Fix version format 2020-02-03 12:09:34 +09:00
Moto Ishizawa c2e6438483 Fix kustomize install command 2020-02-03 12:06:34 +09:00
Moto Ishizawa 80ebb57a81 Install kustomize in release workflow 2020-02-03 12:00:05 +09:00
Moto Ishizawa c33cc6b245 Fix ghr install command 2020-02-03 11:53:24 +09:00
Moto Ishizawa cab4d3811a Update .gitignore 2020-02-03 10:52:07 +09:00
Moto Ishizawa 1a7c9677ac Add release workflow 2020-02-03 10:51:57 +09:00
Moto Ishizawa 4635a10778 Add tasks for releasing 2020-02-03 10:28:50 +09:00
Moto Ishizawa 56fc3bcb2b Fix tag name 2020-02-03 10:27:37 +09:00
Moto Ishizawa 6d8f833d4f Update README 2020-02-03 10:10:40 +09:00
Moto Ishizawa b2b235f6a5 Enable build workflow 2020-02-02 21:38:11 +09:00
Moto Ishizawa 6e400a70ed Enable build runner workflow 2020-02-02 21:29:33 +09:00
Moto Ishizawa d554f4e3f4 Set GITHUB_TOKEN environment variable from secret resource 2020-02-02 19:55:11 +09:00
Moto Ishizawa c6a591d3fe Change namespace name 2020-02-02 19:51:21 +09:00
Moto Ishizawa 2f69329fce Fix permission for pods 2020-02-02 19:49:10 +09:00
Moto Ishizawa 7db5340595 Update CRD validation and RBAC 2020-02-02 10:30:42 +09:00
Moto Ishizawa 127a601fb7 Improve error message 2020-02-01 20:18:16 +09:00
Moto Ishizawa a86f2db2dc Update container name 2020-02-01 00:07:15 +09:00
Moto Ishizawa 960befeade Restart runner pod on completion 2020-02-01 00:06:30 +09:00
Moto Ishizawa 65f479d749 Always restart container 2020-01-31 22:50:08 +09:00
Moto Ishizawa 3f02153257 Ignore pods being deleted 2020-01-31 22:47:53 +09:00
Moto Ishizawa d0d6238963 Run once 2020-01-31 19:29:29 +09:00
Moto Ishizawa bd0d276347 Remove archive file 2020-01-31 19:29:15 +09:00