Install the operator
Goal: install the AgentFlowEngine operator and bring up an engine from one custom resource.
Prerequisites
- A cluster you can
kubectl applyto, with akubeconfig. - The
afeimage published on GitHub Container Registry (ghcr.io/agentflowengine/afe), or loaded where the cluster can pull it. kubectlon your machine.
The operator is namespace-scoped and reference-first. It creates and owns the stateless objects: the
serve and worker Deployments, the Services, the config ConfigMap, the Ingress and the
ScaledObject. The namespaces, the worker's RBAC, the envSecret, the data Secrets and the
storage, runtime and ingress classes are your manifests. They ship as examples under
deploy/operator/admin/.
On kind, make kind-up does all of this for you. It installs the operator and applies the one
AgentFlowEngine of deploy/kind/engine.yaml, and deploy/operator/admin/ is that cluster's admin
source too. The steps below are the manual path on any other cluster.
Steps
-
Apply your admin manifests:
kubectl apply -f deploy/operator/admin/namespace.yamlkubectl apply -f deploy/operator/admin/rbac.yamlkubectl apply -f deploy/operator/admin/env-secret.yamlkubectl apply -f deploy/operator/admin/data-secrets.yamlkubectl apply -f deploy/operator/admin/classes.yamlFill the
Secrets first. The repository commits empty values, never a credential. Keep the classes your cluster already provides. -
Install the operator, its CRDs and its RBAC:
make operator-install AFE_IMAGE_TAG=0.0.0-test.1kubectl -n afe rollout status deployment/afe-operatorThe operator image is an explicit install switch.
make operator-installrendersdeploy/operatorwith the tag and refuses to run without one. Withkustomizeon your machine you can set the same value by hand withkustomize edit set image ghcr.io/agentflowengine/afe=ghcr.io/agentflowengine/afe:<tag>.The
ghcr.io/agentflowengine/afepackage is private: the operator Pod needs a pull credential withread:packages. Create aghcr-pullSecret of typekubernetes.io/dockerconfigjsonin the operator's namespace and attach it to theafe-operatorServiceAccount, or the Pod stays onImagePullBackOff(401). Keep the token off the command line: build the.dockerconfigjsonand pipe it tokubectl create secret generic ghcr-pull --type=kubernetes.io/dockerconfigjson --from-file=.dockerconfigjson=/dev/stdin. -
Create the source ConfigMap from your flow folder. A prompt must be inline text or a file in the same ConfigMap, because a ConfigMap has no folders:
kubectl -n afe create configmap afe-source --from-file=config/ -
Write the
AgentFlowEngineand apply it. Every secret is a reference, never a value:apiVersion: afe.dev/v1alpha1kind: AgentFlowEnginemetadata:name: afenamespace: afespec:config:configMapRef:name: afe-sourceafe:store:external:secretRef:name: afe-postgreskey: dsnbroker:external:secretRef:name: afe-rediskey: AFE_REDIS_URLsandbox:namespace: afe-sandboxenvSecret: afe-sandbox-envdeployment:image:repository: ghcr.io/agentflowengine/afetag: "X.Y.Z" # a published release tagapi:replicas: 2apiTokenSecretRef:name: afe-secretskey: AFE_API_TOKENworkers:replicas: 2concurrency: 4# The model key and the Git token both stay worker-only; serve never holds a credential.envSecretRefs:- { name: afe-secrets, key: OPENROUTER_API_KEY }- { name: afe-secrets, key: GITHUB_TOKEN } -
Watch the installation become ready:
kubectl -n afe get agentflowengine afe -o widekubectl -n afe get podskubectl -n afe get agentflowengine afe \-o jsonpath='{.status.conditions[*].type}{"\n"}'The
Readycondition is the AND of the required ones.status.revisionis the configuration revision the workloads run. -
Reach the API. Without an Ingress, forward the Service:
kubectl -n afe port-forward svc/afe-api 8765:8765export AFE_API_TOKEN=$(kubectl -n afe get secret afe-secrets \-o jsonpath='{.data.AFE_API_TOKEN}' | base64 -d)afe tickets
Verify the image
Every published image is signed keyless with
cosign and carries an SPDX SBOM
and a provenance attestation from docker buildx. The SBOM is attached as a cosign attestation, so
the same identity that signs the image also covers it and cosign verify-attestation finds it. No
signing key and no secret is stored. The signature is bound to the release workflow's own identity.
cosign verify \
--certificate-identity-regexp 'https://github.com/agentflowengine/afe/.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/agentflowengine/afe:X.Y.Z
cosign verify-attestation --type spdxjson \
--certificate-identity-regexp 'https://github.com/agentflowengine/afe/.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/agentflowengine/afe:X.Y.Z
The cosign verify-attestation command exits with code 0 when the SPDX attestation verifies. A
non-zero code means the image does not carry the attestation the release published.
Troubleshooting
ConfigValidated=False
The operator could not validate the folder it built from the ConfigMap and the generated Runtime.
The condition message carries the same per-field messages afe validate prints. Fix the manifests in
the ConfigMap and re-apply, or update the CR if the error is in spec.afe.
RevisionPinned=False, reason RevisionMismatch
spec.config.revision does not match the computed revision. The operator names both hashes and
publishes nothing, so the running workloads stay as they are. Set the pin to the computed revision,
or remove it.
Ready=False, reason ResourceConflict
An object with a desired name exists without the operator's ownerReference. The operator adopts
nothing. Delete the foreign object, or rename it, then let the next reconcile run.
StoreReady=False, reason CloudNativePGMissing
The CR asks for a managed store but the postgresql.cnpg.io CRD is not installed. Install
CloudNativePG, or switch spec.afe.store to external.
Switched from managed to external, and the database is still running
The operator keeps the managed Cluster, StatefulSet and Service, since they hold your data.
The StoreReady or BrokerReady condition names them, and its reason stays External. Delete
them by hand with kubectl delete. Deleting the CR itself still deletes them.
operator-install needs AFE_IMAGE_TAG
make operator-install ran without a tag. Pick a published tag and run it again:
make operator-install AFE_IMAGE_TAG=X.Y.Z. A raw kubectl apply -k deploy/operator renders the
placeholder __AFE_IMAGE_TAG__. The operator Pod then stops at ImagePullBackOff, naming the tag
it could not pull.
The worker Pod crash-loops with invalid configuration: model '…': set …
The worker resolves the model providers, so it needs every model key. Name the key in
deployment.workers.envSecretRefs: the operator projects it into the workers only. serve runs no
harness and calls no provider, so no credential reaches it, neither the model keys nor the Git token.