- 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
104 lines
4.3 KiB
YAML
104 lines
4.3 KiB
YAML
---
|
|
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
annotations:
|
|
controller-gen.kubebuilder.io/version: v0.14.0
|
|
name: functionjobs.sless.kube5s.ru
|
|
spec:
|
|
group: sless.kube5s.ru
|
|
names:
|
|
kind: FunctionJob
|
|
listKind: FunctionJobList
|
|
plural: functionjobs
|
|
singular: functionjob
|
|
scope: Namespaced
|
|
versions:
|
|
- additionalPrinterColumns:
|
|
- jsonPath: .spec.functionRef
|
|
name: Function
|
|
type: string
|
|
- jsonPath: .status.phase
|
|
name: Phase
|
|
type: string
|
|
- jsonPath: .metadata.creationTimestamp
|
|
name: Age
|
|
type: date
|
|
name: v1alpha1
|
|
schema:
|
|
openAPIV3Schema:
|
|
description: |-
|
|
FunctionJob — ресурс для одноразового запуска serverless функции.
|
|
Создаётся пользователем через terraform ресурс sless_job.
|
|
После завершения (Succeeded/Failed) ресурс остаётся в кластере для аудита.
|
|
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: FunctionJobSpec — параметры одноразового запуска функции.
|
|
properties:
|
|
eventJson:
|
|
default: '{}'
|
|
description: |-
|
|
EventJSON — данные передаваемые в handle(event) в JSON формате.
|
|
Если не задан — передаётся пустой объект {}.
|
|
Пример: {"action": "migrate", "version": "002"}
|
|
type: string
|
|
functionRef:
|
|
description: FunctionRef — имя Function ресурса в том же namespace
|
|
type: string
|
|
runId:
|
|
default: 0
|
|
description: |-
|
|
RunID — идентификатор запуска. 0 = не запускать.
|
|
Каждое ненулевое значение уникально идентифицирует запуск.
|
|
Увеличь RunID (1→2→3) для повторного запуска джоба.
|
|
При RunID=0 FunctionJob создаётся в кластере, но k8s Job не запускается.
|
|
format: int64
|
|
type: integer
|
|
required:
|
|
- functionRef
|
|
- runId
|
|
type: object
|
|
status:
|
|
description: FunctionJobStatus — наблюдаемое состояние (заполняет контроллер).
|
|
properties:
|
|
completionTime:
|
|
description: CompletionTime — время завершения
|
|
format: date-time
|
|
type: string
|
|
jobName:
|
|
description: JobName — имя созданного k8s Job
|
|
type: string
|
|
message:
|
|
description: Message — результат выполнения или сообщение об ошибке
|
|
type: string
|
|
phase:
|
|
description: 'Phase — текущая фаза: Pending, Running, Succeeded, Failed'
|
|
type: string
|
|
startTime:
|
|
description: StartTime — время запуска k8s Job
|
|
format: date-time
|
|
type: string
|
|
type: object
|
|
type: object
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|