simplify README.md

This commit is contained in:
2026-01-13 21:22:52 +08:00
parent 6a2a0f7683
commit b8fed8a62a

View File

@@ -70,27 +70,39 @@ kubectl apply -f secret.yaml
## Configuration ## Configuration
The core resource is the `RunnerGroup`. Below are examples for different scopes. The core resource is the `RunnerGroup`. Use the `scope` field to control which jobs the runner picks up.
### 1. Repository Scope
Spawns runners only for jobs in a specific repository.
```yaml ```yaml
apiVersion: gitea.bpg.pw/v1alpha1 apiVersion: gitea.bpg.pw/v1alpha1
kind: RunnerGroup kind: RunnerGroup
metadata: metadata:
name: my-repo-runner name: example-runner
namespace: gitea-runner-operator-system namespace: gitea-runner-operator-system
spec: spec:
scope: repo # Base Gitea URL
org: myorg
repo: myrepo
giteaURL: https://gitea.example.com giteaURL: https://gitea.example.com
# Scope configuration:
# - global: Runs all jobs (requires instance admin token)
# - org: Runs jobs for a specific organization (requires `org` field)
# - user: Runs jobs for a specific user (requires `user` field)
# - repo: Runs jobs for a specific repository (requires `org` and `repo` fields)
scope: repo
# Scope-specific fields (uncomment as needed based on scope):
org: my-org # Required for 'org' or 'repo' scopes
repo: my-repo # Required for 'repo' scope
# user: my-user # Required for 'user' or 'repo' scope
# Maximum concurrent runners
maxActiveRunners: 5 maxActiveRunners: 5
# Labels supported by this runner group
labels: labels:
- "ubuntu-latest" - "ubuntu-latest"
- "custom-label" - "custom-label:docker://node:16"
# Credentials
registrationToken: registrationToken:
secretRef: secretRef:
name: gitea-runner-secret name: gitea-runner-secret
@@ -101,62 +113,6 @@ spec:
key: authToken key: authToken
``` ```
### 2. Organization Scope
Spawns runners for any repository within the organization.
```yaml
apiVersion: gitea.bpg.pw/v1alpha1
kind: RunnerGroup
metadata:
name: my-org-runner
namespace: gitea-runner-operator-system
spec:
scope: org
org: myorg
# repo is omitted
giteaURL: https://gitea.example.com
maxActiveRunners: 10
# ... (tokens)
```
### 3. User Scope
Spawns runners for any repository owned by the specified user.
```yaml
apiVersion: gitea.bpg.pw/v1alpha1
kind: RunnerGroup
metadata:
name: my-user-runner
namespace: gitea-runner-operator-system
spec:
scope: user
user: myusername
# org and repo are omitted
giteaURL: https://gitea.example.com
maxActiveRunners: 3
# ... (tokens)
```
### 4. Global Scope
Spawns runners for any job in the Gitea instance (Admin level).
```yaml
apiVersion: gitea.bpg.pw/v1alpha1
kind: RunnerGroup
metadata:
name: global-runner
namespace: gitea-runner-operator-system
spec:
scope: global
# org, user, and repo are omitted
giteaURL: https://gitea.example.com
maxActiveRunners: 20
# ... (tokens)
```
## How it works ## How it works
1. The **Controller** polls the Gitea API (using the `authToken`) to check for queued jobs matching the scope and labels. 1. The **Controller** polls the Gitea API (using the `authToken`) to check for queued jobs matching the scope and labels.