Files
sless/config/crd/bases/sless.kube5s.ru_triggers.yaml
T
“Naeel” d67b9745a8 feat: trigger.enabled + job.run_id lifecycle control (operator v0.1.6, provider v0.1.4)
- TriggerSpec.Enabled bool (default=true): enabled=false масштабирует Deployment до 0
- FunctionJobSpec.RunID int64 (default=0): run_id=0 = skip, >0 = run
- API: PATCH /v1/namespaces/{ns}/triggers/{name} (UpdateTrigger)
- Provider: enabled attribute (Optional, Computed, in-place update)
- Provider: run_id attribute (Optional, Computed, default=0, RequiresReplace)
- operator image: naeel/sless-operator:v0.1.6
- provider: terra.k8c.ru/naeel/sless v0.1.4
2026-03-08 10:10:32 +04:00

114 lines
4.5 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:
enabled:
default: true
description: |-
Enabled — если false, Deployment функции масштабируется до 0 (функция не принимает запросы).
При true — функция запускается. По умолчанию true.
Позволяет "заморозить" функцию без удаления ресурса.
type: boolean
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:
- enabled
- 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: {}