--- 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.runtime name: Runtime 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 — параметры одноразового запуска функции. Самодостаточен: содержит всё для сборки образа и запуска Job. Отдельный Function CRD больше не требуется. properties: entrypoint: description: 'Entrypoint — точка входа в код функции (например: handler.handle)' type: string env: additionalProperties: type: string description: Env — переменные окружения, передаются в контейнер функции type: object eventJson: default: '{}' description: |- EventJSON — данные передаваемые в handle(event) в JSON формате. Если не задан — передаётся пустой объект {}. Пример: {"action": "migrate", "version": "002"} type: string memoryMB: default: 128 description: 'MemoryMB — лимит памяти в мегабайтах (default: 128)' format: int32 type: integer runId: default: 0 description: |- RunID — идентификатор запуска. 0 = не запускать. Каждое ненулевое значение уникально идентифицирует запуск. Увеличь RunID (1→2→3) для повторного запуска джоба. При RunID=0 FunctionJob создаётся в кластере, но k8s Job не запускается. format: int64 type: integer runtime: description: Runtime — язык и версия выполнения (go1.23, python3.11, nodejs20) enum: - go1.23 - python3.11 - nodejs20 type: string s3Bucket: description: S3Bucket — бакет S3 где хранится tar.gz контекст сборки type: string s3Key: description: S3Key — ключ объекта в S3 (путь до tar.gz контекста) type: string timeoutSec: default: 30 description: 'TimeoutSec — максимальное время выполнения в секундах (default: 30)' format: int32 type: integer required: - entrypoint - runId - runtime type: object status: description: FunctionJobStatus — наблюдаемое состояние (заполняет контроллер). properties: completionTime: description: CompletionTime — время завершения format: date-time type: string imageRef: description: |- ImageRef — полный путь к собранному Docker образу в registry Заполняется после успешной сборки (фаза Building → Running). type: string jobName: description: JobName — имя созданного k8s Job type: string message: description: Message — результат выполнения или сообщение об ошибке type: string phase: description: 'Phase — текущая фаза: Pending, Building, 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: {}