Skip to content

Add documentation for FunctionConfig CRD and reconciler#976

Draft
mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:fnconf-docs
Draft

Add documentation for FunctionConfig CRD and reconciler#976
mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:fnconf-docs

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Collaborator

@mozesl-nokia mozesl-nokia commented May 8, 2026

Title

Add documentation for FunctionConfig CRD and reconciler


Description

  • What changed: Added documentation for the new FunctionConfig CRs
  • Why it’s needed: Because it was not done as part of the implementation PR
  • How it works: Used Dosu's suggestions with some changes

Related Issue(s)


Type of Change

  • Documentation

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

Additional Notes (Optional)

  • Known issues:
  • Further improvements:
  • Review notes:

AI Disclosure

[x] I have used AI in the creation of this PR.

  • The suggestions made by Dosu were used as a baseline

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for porch ready!

Name Link
🔨 Latest commit e0cfc0d
🔍 Latest deploy log https://app.netlify.com/projects/porch/deploys/6a02f86f6900910008764a99
😎 Deploy Preview https://deploy-preview-976--porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@mozesl-nokia mozesl-nokia marked this pull request as ready for review May 8, 2026 12:05
@mozesl-nokia mozesl-nokia added the documentation Improvements or additions to documentation label May 8, 2026
Comment thread docs/content/en/docs/2_concepts/functions.md Outdated
Comment thread docs/content/en/docs/2_concepts/functions.md Outdated
Comment thread docs/content/en/docs/2_concepts/functions.md Outdated
Comment thread docs/content/en/docs/2_concepts/functions.md Outdated
Comment thread docs/content/en/docs/2_concepts/functions.md Outdated

The catalog package includes:
- FunctionConfig and ServiceTemplate CRDs for configuring KRM function execution
- Multiple pre-configured FunctionConfig resources for common KRM functions (apply-replacements, set-namespace, starlark, etc.)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the yaml or the like?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean a github link?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye maybe not the code but the catalog artefact on the release page. What do you think?

We prob also need to move away from referencing the nephio catalog here but not in this PR
https://docs.porch.nephio.org/docs/6_configuration_and_deployments/deployments/catalog-deployment/

Copy link
Copy Markdown
Contributor

@lovesprung lovesprung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly de-bulleting comments

**Pod Executor**: Runs functions in isolated containerized pods (the traditional approach):
- Functions execute in Kubernetes pods managed by the `function-runner` microservice
- Configurable with pod templates, resource limits, TTL settings, and maximum parallel executions
- Suitable for functions requiring container isolation or external dependencies
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pod Executor runs functions in isolated containerized pods (the traditional approach). The functions are executed in Kubernetes pods managed by the function-runner microservice. The executor/functions (not sure which) are configurable with pod templates, resource limits, TTL settings, and maximum parallel executions. This executor is suitable for functions requiring container isolation or external dependencies.

**Binary Executor**: Substitutes specific function image tags with local binary executables:
- Executes pre-built function binaries directly on the host system
- Provides improved performance by avoiding container overhead
- Configured with the file path to the function binary
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Binary Executor substitutes specific function image tags with local binary executables. It executes re-built function binaries directly on the host system and provides improved performance by avoiding container overhead. You can configure this executor with the file path to the function binary.

**Go Executor**: Executes certain functions as native Go function calls within the porch-server process:
- Functions run in-process for maximum efficiency
- Only available for functions integrated as Go libraries
- No container or process overhead
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go Executor executes certain functions as native Go function calls within the porch-server process. Functions executed under this executer run in-process for maximum efficiency. Go Executor is only available for functions integrated as Go libraries. No containers or process overhead is included(?).

### Function Configuration Management

Provides declarative configuration of function executors through Kubernetes CRDs:
- **FunctionConfig Reconciler**: Embedded controller watches FunctionConfig resources and maintains internal cache
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **FunctionConfig Reconciler**: Embedded controller watches FunctionConfig resources and maintains internal cache
- **FunctionConfig Reconciler**: Embedded controller that watches FunctionConfig resources and maintains internal cache

- FunctionConfig CRDs define pod execution settings
- PodExecutor section specifies TTL, templates, and resources
- Multiple tags can share pod configuration
- Template overrides customize pod and container specs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration structure: FunctionConfig CRDs hold the pod execution settings and the PodExecutor section specifies TTL, templates, and resources. The same pod configuration can be shared across multiple tags. Template overrides customize pod and container specs.

- Render pipeline orchestration
- Function sequencing
- Result aggregation
- RenderStatus creation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for task handler responsibilites, it rendes ppipeline orchestration, it's responsible for function sequencing, result aggregation, and RenderStatus creation.

- Pod cache is ephemeral (TTL-based)
- Image cache is in-memory only
- Executor configuration cache populated from FunctionConfig CRs
- Evaluators are stateless
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When it comes to stateless service, there is no persistent state between requests. The pod cache is ephemeral (TTL-based) and the image cache is in-memory only. The executor configuration cache is populated from FunctionConfig CRs. Additionally, the evaluators are stateless.

**Benefits:**
- Horizontal scaling possible
- Restart-safe (no state loss)
- Simple deployment model
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has many benefits. It is possible to use horizontal scaling, it is restart safe, which means no state loss, and it has a simple deployment model.

- Garbage collection runs periodically
- TTL updates are asynchronous patches
- Cache warming at startup is concurrent
- FunctionConfig reconciliation is event-driven
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tod creation happens in background goroutines while garbage collection runs periodically. The TTL updates are asynchronous patches. The cache warming at startup is concurrent and FunctionConfig reconciliation is event-driven.

The function-runner includes an embedded reconciler that:
- Watches FunctionConfig resources in the configured namespace
- Maintains an internal cache of function configurations
- Uses the cached configuration to determine executor selection and execution parameters
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function-runner includes an embedded reconciler that watches FunctionConfig resources in the configured namespace, maintains an internal cache of function configurations, and uses the cached configuration to determine executor selection and execution parameters.

@mozesl-nokia mozesl-nokia marked this pull request as draft May 13, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation for the new FunctionConfig CRD and controller

3 participants