- FunctionJobReconciler: added KubeClient field (kubernetes.Interface) - getJobPodOutput(): reads pod logs via typed client after job succeeds - main.go: inject kubernetes.NewForConfigOrDie into FunctionJobReconciler - rbac.yaml: add pods/pods/log get/list/watch permissions - examples/simple-python/: job->function chain demo (Python) - examples/simple-node/: job->function chain demo (Node.js) sless_job.X.message now contains the return value of the function
24 lines
700 B
HCL
24 lines
700 B
HCL
# Создано: 2026-03-09
|
||
# main.tf — точка входа для примера simple-python.
|
||
# Демонстрирует цепочку: sless_job (one-shot) → sless_function (http).
|
||
# Джоб запускается при terraform apply, его stdout (JSON) попадает в
|
||
# sless_job.run_getter.message и передаётся функции через env_vars.
|
||
|
||
terraform {
|
||
required_providers {
|
||
sless = {
|
||
source = "terra.k8c.ru/naeel/sless"
|
||
version = "~> 0.1.8"
|
||
}
|
||
archive = {
|
||
source = "hashicorp/archive"
|
||
version = "~> 2.0"
|
||
}
|
||
}
|
||
}
|
||
|
||
provider "sless" {
|
||
endpoint = "https://sless-api.kube5s.ru"
|
||
token = "dev-token-change-me"
|
||
}
|