“Naeel”
d6212d1cee
doc: обновлена документация — FunctionJob, proxy /fn/, operator v0.1.5, provider v0.1.3
2026-03-07 18:40:36 +04:00
“Naeel”
2ee9cae6d2
feat: proxy /fn/{namespace}/{name} — обход wildcard DNS
...
Проблема: wildcard DNS *.fn.kube5s.ru недоступен.
Решение: прокси через sless-api.kube5s.ru/fn/{ns}/{name}.
- handler/invoke.go: прокси к Service функции внутри кластера
- router.go: /fn/ без auth токена, /v1/ с auth (gorilla Use())
- config.go: поле ExternalURL (EXTERNAL_URL env)
- trigger_controller.go: если ExternalURL задан — URL = ExternalURL/fn/{ns}/{fn}
иначе fallback: Ingress + поддомен (прежнее поведение)
- operator.yaml: EXTERNAL_URL=https://sless-api.kube5s.ru , image v0.1.5
Оператор v0.1.5 задеплоен.
E2E: curl https://sless-api.kube5s.ru/fn/default/hello-node → {"message":"Hello, Naeel! (nodejs20)"}
2026-03-07 18:36:03 +04:00
“Naeel”
a6bc67de05
feat: configurable timeouts for sless_function and sless_job
...
- sless_function: build_timeout_sec (optional, default 300s = 5 min)
- sless_job: wait_timeout_sec (optional, default 600s = 10 min)
- provider v0.1.3 published to terra.k8c.ru
2026-03-07 17:49:07 +04:00
“Naeel”
f405596d42
feat: sless_job terraform resource + jobs REST API
...
Operator (v0.1.4):
- internal/api/handler/jobs.go: CreateJob/GetJob/DeleteJob handlers
- internal/api/router.go: POST/GET/DELETE /v1/namespaces/{ns}/jobs/{name}
Terraform provider (v0.1.2):
- client.go: JobRequest/JobResponse + CreateJob/GetJob/DeleteJob/WaitJobDone
- resources/job_resource.go: sless_job resource (Create blocks until Succeeded/Failed)
- provider.go: register NewJobResource
Deploy:
- operator:v0.1.4 deployed and running in cluster
- provider v0.1.2 published to terra.k8c.ru
2026-03-07 17:43:26 +04:00
“Naeel”
22685a72a9
feat: add FunctionJob CRD for one-shot function runs
...
- api/v1alpha1/job_types.go: new CRD FunctionJob (Pending/Running/Succeeded/Failed)
- controllers/functionjob_controller.go: reconciler creates k8s Job from FunctionRef + EventJSON
- zz_generated.deepcopy.go: DeepCopy methods for FunctionJob types
- config/crd/bases: generated CRD YAML, applied to cluster
- main.go: register FunctionJobReconciler
- rbac.yaml: add functionjobs permissions
- operator.yaml: v0.1.2 -> v0.1.3
- operator:v0.1.3 deployed and running in cluster
2026-03-07 17:20:21 +04:00
“Naeel”
d6dc676dfd
doc: document operator deploy, nodejs20 runtime, Dockerfile fixes, go.mod fix
2026-03-07 17:02:28 +04:00
“Naeel”
22c7e92590
feat: add nodejs20 runtime
...
- runtimes/nodejs20/server.js: HTTP wrapper, exports.handle(event)
- runtimes/nodejs20/Dockerfile: node:20-alpine base image
- naeel/sless-runtime-nodejs20:v0.1.0 pushed to DockerHub
- upload.go: nodejs20 in runtimeBaseImage(), package.json → npm install
- upload.go: python3.11 now uses v0.1.0 tag (no more latest)
- operator v0.1.2 deployed in cluster
- E2E: hello-node-default.fn.kube5s.ru → {"message":"Hello, Naeel! (nodejs20)"}
2026-03-07 17:00:29 +04:00
“Naeel”
97f38c1f72
chore: switch pg-query example to remote endpoint sless-api.kube5s.ru
2026-03-07 16:50:05 +04:00
“Naeel”
b338192cbf
chore: go mod tidy — fix direct/indirect annotations
2026-03-07 16:31:54 +04:00
“Naeel”
3fdf342115
feat: deploy operator in-cluster v0.1.1
...
- Dockerfile: fix golang 1.23→1.25, add internal/ + migrations/ to image
- deployments/k8s/operator.yaml: ConfigMap + Secret + Deployment + Service + Ingress
- Ingress: sless-api.kube5s.ru, TLS via cert-manager letsencrypt-prod
- naeel/sless-operator:v0.1.1 — running in namespace sless
- E2E: https://sless-api.kube5s.ru → HTTP/2 200
2026-03-07 16:30:14 +04:00
“Naeel”
0856fbc454
doc: decisions — scale-to-zero v2, replicas todo, postgres optional
2026-03-07 11:10:37 +04:00
“Naeel”
0268ef0523
fix: multiple fixes + pg-query e2e passed
...
upload.go:
- Update → Patch (MergeFrom) to avoid resourceVersion conflict when operator
modifies Function between Get() and Update()
terraform provider v0.1.1:
- trigger_resource.go: trToModel returns StringNull() for empty schedule
(fixes 'provider produced inconsistent result' for http triggers)
- main.go: bump version to 0.1.1
examples/pg-query:
- handler.py: fix column name started_at → created_at (matches migrations/001)
- main.tf: pin provider to ~> 0.1.1
.gitignore: add terraform state, lock, .terraform/, handler.zip
doc/errors/log.md: documented all 5 errors from this session:
- resourceVersion conflict → use Patch
- terraform inconsistent result for schedule → StringNull
- terraform import not implemented → delete+recreate workaround
- wrong column name → check migrations before writing handlers
- Deployment not restarting after image rebuild → rollout restart / TODO: restartedAt annotation
doc/progress.md: terraform apply e2e ✅
2026-03-07 10:52:29 +04:00
“Naeel”
4e59d79884
feat: add pg-query example + upload.go supports requirements.txt
...
- examples/pg-query/handler.py: Python function querying PostgreSQL invocations table
- examples/pg-query/requirements.txt: psycopg2-binary==2.9.9
- examples/pg-query/main.tf: terraform config for sless_function + sless_trigger
- internal/api/handler/upload.go: generateDockerfile() now accepts hasRequirements bool
- scans zip for requirements.txt at upload time
- adds RUN pip install --no-cache-dir to Dockerfile when requirements.txt present
- doc/progress.md: updated status for pg-query e2e task
2026-03-07 10:30:50 +04:00
“Naeel”
dc7542148e
docs: обновить всю документацию по результатам сессии 2026-03-07
...
- infrastructure/overview.md: исправить S3 URL, Container Registry (DockerHub),
namespace sless, Terraform Registry terra.k8c.ru
- errors/log.md: добавить 3 ошибки — kaniko S3 scheme, бесконечный цикл сборки,
docker credStore desktop.exe
- decisions/log.md: добавить решения — DockerHub, terraform провайдер в той же
репе, WaitReady паттерн, code_hash для версионирования кода
- api/design.md: обновить базовый URL, добавить upload endpoint с описанием
процесса, исправить runtime список
2026-03-07 10:26:13 +04:00
“Naeel”
19c9e016a8
feat: Terraform провайдер sless v0.1.0 + обновление doc/progress.md
...
Независимый Go-модуль terraform/provider/ для управления функциями через REST API.
Ресурсы:
- sless_function: CRUD + upload zip + WaitReady (kaniko build 5 мин)
- sless_trigger: CRUD (http/cron)
Компоненты:
- internal/client/client.go — HTTP-клиент, готов к переносу в nubes
- internal/provider/provider.go — паттерн идентичен nubes NubesProvider
- internal/resources/ — function_resource.go, trigger_resource.go
- hack/build-and-publish.sh — GPG-подпись + mc upload в S3
Опубликовано: terra.k8c.ru/naeel/sless v0.1.0
Проверено: terraform init успешен
2026-03-07 10:23:52 +04:00
“Naeel”
4115e0f172
fix: бесконечный цикл сборки — idempotency guard через last-built-s3key аннотацию
...
Проблема: upload handler сбрасывал phase в Pending ПОСЛЕ того как
контроллер уже выставил Building → бесконечный цикл (94 job'а).
Решение:
- controllers/function_controller.go: startBuild сначала ставит аннотацию
last-built-s3key = spec.S3Key (idempotency guard), потом status.
Reconcile стартует сборку только если spec.S3Key != last-built-s3key.
- handler/upload.go: убран Status().Update() — контроллер сам управляет фазой.
- builder.go: IsAlreadyExists при создании job не ошибка (parallel reconcile).
2026-03-07 09:50:24 +04:00
“Naeel”
8bae4ca69c
fix: kaniko S3 endpoint — добавить https:// схему и S3_FORCE_PATH_STYLE=true
...
Kaniko AWS SDK требует полный URL с протоколом.
Ceph не поддерживает virtual-hosted style — нужен path style.
2026-03-07 09:39:53 +04:00
“Naeel”
74458f848d
feat: upload endpoint POST /v1/namespaces/{ns}/functions/{name}/upload
...
- s3/client.go: Bucket() accessor + UploadContext() для tar.gz build context
- handler/upload.go: принимает zip, генерирует Dockerfile (FROM naeel/sless-runtime-{runtime}),
перепаковывает в tar.gz, загружает в S3, обновляет Function CRD → kaniko запускается
- router.go: маршрут POST .../upload зарегистрирован
2026-03-07 09:36:32 +04:00
“Naeel”
c61e822308
feat: python3.11 base runtime image + DockerHub registry support
...
- runtimes/python3.11/: Dockerfile + server.py (HTTP wrapper на :8080)
- builder.go: RegistrySecret field, volume mount docker-creds для kaniko, убран --skip-tls-verify
- config.go: добавлен RegistrySecret (env REGISTRY_SECRET, default sless-registry-auth)
- main.go: передаём RegistrySecret в builder.Config
- hack/create-registry-secret.sh: создаёт k8s Secret из DockerHub токена
Образ наружу: naeel/sless-runtime-python3.11:latest (DockerHub)
K8s secret: sless-registry-auth в namespace sless
2026-03-07 09:32:59 +04:00
“Naeel”
33ee17729f
docs: обновить progress.md по фактическому состоянию
...
- отражён реальный статус всех компонентов кода
- отражено состояние кластера (CRD, RBAC, postgres)
- добавлен список что ещё не сделано
- добавлены deployments/k8s/rbac.yaml, postgres.yaml
2026-03-07 08:57:54 +04:00
“Naeel”
43e7d0ea48
feat: REST API (gorilla/mux + slog) + trigger controller + main.go wiring
...
- controllers/trigger_controller.go: полная реализация, HTTP->Ingress+Service, Cron->CronJob
- internal/config: добавлены IngressHost, APIToken
- internal/api/router.go: gorilla/mux роутер /v1/namespaces/{ns}/...
- internal/api/handler/: functions, triggers, invocations, base handler с slog
- internal/api/middleware/: auth (Bearer token) + logging (slog)
- main.go: запуск operator + HTTP сервера параллельно
- go.sum: добавлен gorilla/mux v1.8.1
2026-03-07 08:46:10 +04:00
“Naeel”
5f25f61948
chore: ignore .s3cfg* files
2026-03-07 08:28:33 +04:00
“Naeel”
a5154c21de
chore: remove .s3cfg_registry from repo
2026-03-07 08:28:19 +04:00
“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
“Naeel”
3e10ac1d63
feat: operator-sdk scaffold with Function and Trigger CRDs
...
- operator-sdk init --domain kube5s.ru
- CRD: Function, Trigger (sless.kube5s.ru)
- controllers: FunctionReconciler, TriggerReconciler (stubs)
- internal/ structure: api, storage/postgres, storage/s3, builder, config
- fix: controller-tools bumped v0.11.1→v0.14.0 (Go 1.23 compat)
2026-03-07 08:16:39 +04:00
“Naeel”
205aecae50
chore: add comments rules to copilot instructions
2026-03-06 09:56:02 +04:00
“Naeel”
3ffc8da373
chore: add copilot instructions
2026-03-06 09:53:10 +04:00
“Naeel”
b29b6c3d10
docs: initial project documentation
...
- architecture overview and stack
- project structure and development order
- API design (endpoints, models, runtimes)
- infrastructure overview (k8s cluster, S3, registry)
- decisions log with rationale
- progress tracker v1/v2
2026-03-06 09:51:01 +04:00