Files
sless/config/crd/bases/sless.kube5s.ru_triggers.yaml
T
“Naeel” d9f5ab56bb feat: define Function and Trigger CRD types
Function:
  - runtime (go1.21/python3.11/nodejs20)
  - entrypoint, s3Bucket, s3Key
  - memoryMB (default 128), timeoutSec (default 30)
  - env map
  - status: phase (Pending/Building/Ready/Failed), imageRef, conditions

Trigger:
  - type (http/cron), functionRef
  - schedule (cron only)
  - preWarmSeconds (default 300) - pre-warm before cron run
  - status: active, url, lastScheduleTime

printcolumns for kubectl get output
2026-03-07 08:24:33 +04:00

106 lines
4.0 KiB
YAML

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: triggers.sless.kube5s.ru
spec:
group: sless.kube5s.ru
names:
kind: Trigger
listKind: TriggerList
plural: triggers
singular: trigger
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.type
name: Type
type: string
- jsonPath: .spec.functionRef
name: Function
type: string
- jsonPath: .status.active
name: Active
type: boolean
- jsonPath: .status.url
name: URL
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Trigger — ресурс для управления способом вызова Function.
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: TriggerSpec — желаемое состояние триггера.
properties:
functionRef:
description: FunctionRef — имя Function ресурса в том же namespace
type: string
preWarmSeconds:
default: 300
description: |-
PreWarmSeconds — за сколько секунд до запуска прогреть контейнер.
Актуально для cron: запускаем pod заранее чтобы избежать cold start.
format: int32
type: integer
schedule:
description: 'Schedule — расписание в формате cron (только для type=cron,
например: "0 2 * * *")'
type: string
type:
description: 'Type — тип триггера: http или cron'
enum:
- http
- cron
type: string
required:
- functionRef
- type
type: object
status:
description: TriggerStatus — наблюдаемое состояние триггера (заполняет
контроллер).
properties:
active:
description: Active — активен ли триггер в данный момент
type: boolean
lastScheduleTime:
description: LastScheduleTime — время последнего запуска по расписанию
(только для type=cron)
format: date-time
type: string
message:
description: Message — человекочитаемое сообщение об ошибке или статусе
type: string
url:
description: URL — публичный URL для вызова функции (только для type=http)
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}