mirror of
https://github.com/bapung/gitea-runner-operator.git
synced 2026-06-21 23:48:43 +00:00
api definition and crd generate
This commit is contained in:
140
config/crd/bases/gitea.bpg.pw_runnergroups.yaml
Normal file
140
config/crd/bases/gitea.bpg.pw_runnergroups.yaml
Normal file
@@ -0,0 +1,140 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.18.0
|
||||
name: runnergroups.gitea.bpg.pw
|
||||
spec:
|
||||
group: gitea.bpg.pw
|
||||
names:
|
||||
kind: RunnerGroup
|
||||
listKind: RunnerGroupList
|
||||
plural: runnergroups
|
||||
singular: runnergroup
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: RunnerGroup is the Schema for the runnergroups API.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: RunnerGroupSpec defines the desired state of RunnerGroup.
|
||||
properties:
|
||||
authToken:
|
||||
description: AuthTokenRef references the secret containing the Gitea
|
||||
API token for polling
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be a
|
||||
valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
giteaURL:
|
||||
description: GiteaURL is the base URL of the Gitea instance
|
||||
type: string
|
||||
labels:
|
||||
description: Labels to assign to the runner
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
maxActiveRunners:
|
||||
description: MaxActiveRunners is the maximum number of concurrent
|
||||
jobs
|
||||
minimum: 1
|
||||
type: integer
|
||||
org:
|
||||
description: Org is required if scope is 'org'
|
||||
type: string
|
||||
registrationToken:
|
||||
description: RegistrationTokenRef references the secret containing
|
||||
the runner registration token
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be a
|
||||
valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
repo:
|
||||
description: Repo is required if scope is 'repo'
|
||||
type: string
|
||||
scope:
|
||||
description: Scope defines the scope of the runner (global, org, repo)
|
||||
enum:
|
||||
- global
|
||||
- org
|
||||
- repo
|
||||
type: string
|
||||
required:
|
||||
- authToken
|
||||
- giteaURL
|
||||
- maxActiveRunners
|
||||
- registrationToken
|
||||
- scope
|
||||
type: object
|
||||
status:
|
||||
description: RunnerGroupStatus defines the observed state of RunnerGroup.
|
||||
properties:
|
||||
activeRunners:
|
||||
description: ActiveRunners is the current number of running jobs
|
||||
type: integer
|
||||
lastCheckTime:
|
||||
description: LastCheckTime is the timestamp of the last poll to Gitea
|
||||
format: date-time
|
||||
type: string
|
||||
required:
|
||||
- activeRunners
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
@@ -1,11 +1,32 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: gitea-runner-operator
|
||||
app.kubernetes.io/managed-by: kustomize
|
||||
name: manager-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups:
|
||||
- gitea.bpg.pw
|
||||
resources:
|
||||
- runnergroups
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- gitea.bpg.pw
|
||||
resources:
|
||||
- runnergroups/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- gitea.bpg.pw
|
||||
resources:
|
||||
- runnergroups/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
|
||||
Reference in New Issue
Block a user