Fix additionalPrinterColumns (#556)

This fixes human-readable output of `kubectl get` on `runnerdeployment`, `runnerreplicaset`, and `runner`.

Most notably, CURRENT and READY of runner replicasets are now computed and printed correctly. Runner deployments now have UP-TO-DATE and AVAILABLE instead of READY so that it is consistent with columns of K8s deployments.

A few fixes has been also made to runner deployment and runner replicaset controllers so that those numbers stored in Status objects are reliably updated and in-sync with actual values.

Finally, `AGE` columns are added to runnerdeployment, runnerreplicaset, runnner to make that more visible to users.

`kubectl get` outputs should now look like the below examples:

```
# Immediately after runnerdeployment updated/created
$ k get runnerdeployment
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
example-runnerdeploy   0         0         0            0           8d
org-runnerdeploy       5         5         5            0           8d

# A few dozens of seconds after update/create all the runners are registered that "available" numbers increase
$ k get runnerdeployment
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
example-runnerdeploy   0         0         0            0           8d
org-runnerdeploy       5         5         5            5           8d
```

```
$ k get runnerreplicaset
NAME                         DESIRED   CURRENT   READY   AGE
example-runnerdeploy-wnpf6   0         0         0       61m
org-runnerdeploy-fsnmr       2         2         0       8m41s
```

```
$ k get runner
NAME                                           ENTERPRISE   ORGANIZATION                REPOSITORY                                       LABELS                      STATUS    AGE
example-runnerdeploy-wnpf6-registration-only                                            actions-runner-controller/mumoshu-actions-test                               Running   61m
org-runnerdeploy-fsnmr-n8kkx                                actions-runner-controller                                                    ["mylabel 1","mylabel 2"]             21s
org-runnerdeploy-fsnmr-sq6m8                                actions-runner-controller                                                    ["mylabel 1","mylabel 2"]             21s
```

Fixes #490
This commit is contained in:
Yusuke Kuoka
2021-05-21 09:10:47 +09:00
committed by GitHub
parent a4631f345b
commit 0b88b246d3
12 changed files with 209 additions and 49 deletions

View File

@@ -10,12 +10,18 @@ spec:
- JSONPath: .spec.replicas
name: Desired
type: number
- JSONPath: .status.availableReplicas
- JSONPath: .status.replicas
name: Current
type: number
- JSONPath: .status.readyReplicas
name: Ready
- JSONPath: .status.updatedReplicas
name: Up-To-Date
type: number
- JSONPath: .status.availableReplicas
name: Available
type: number
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: actions.summerwind.dev
names:
kind: RunnerDeployment
@@ -1631,15 +1637,20 @@ spec:
status:
properties:
availableReplicas:
description: AvailableReplicas is the total number of available runners which have been sucessfully registered to GitHub and still running. This corresponds to the sum of status.availableReplicas of all the runner replica sets.
type: integer
desiredReplicas:
description: Replicas is the total number of desired, non-terminated and latest pods to be set for the primary RunnerSet This doesn't include outdated pods while upgrading the deployment and replacing the runnerset.
description: DesiredReplicas is the total number of desired, non-terminated and latest pods to be set for the primary RunnerSet This doesn't include outdated pods while upgrading the deployment and replacing the runnerset.
type: integer
readyReplicas:
description: ReadyReplicas is the total number of available runners which have been sucessfully registered to GitHub and still running. This corresponds to the sum of status.readyReplicas of all the runner replica sets.
type: integer
replicas:
description: Replicas is the total number of replicas
type: integer
updatedReplicas:
description: ReadyReplicas is the total number of available runners which have been sucessfully registered to GitHub and still running. This corresponds to status.replicas of the runner replica set that has the desired template hash.
type: integer
required:
- availableReplicas
- readyReplicas
type: object
type: object
version: v1alpha1