Deploy a Flow
This guide deploys a single Flow exposed at POST /greeter, backed by
Anthropic Claude.
1. Credentials
Section titled “1. Credentials”kubectl create secret generic anthropic-credentials \ --from-literal=ANTHROPIC_API_KEY=sk-ant-...2. Plugin
Section titled “2. Plugin”apiVersion: genkit.dev/v1alpha1kind: PluginConfigmetadata: name: anthropicspec: type: anthropic credentialsRef: name: anthropic-credentials credentialKeys: [ANTHROPIC_API_KEY]3. Model
Section titled “3. Model”apiVersion: genkit.dev/v1alpha1kind: Modelmetadata: name: claude-opusspec: provider: anthropic model: claude-opus-4-6 pluginConfigRef: name: anthropic defaultConfig: temperature: 0.3 maxOutputTokens: 10244. Prompt
Section titled “4. Prompt”apiVersion: genkit.dev/v1alpha1kind: Promptmetadata: name: greetingspec: content: | --- model: anthropic/claude-opus-4-6 temperature: 0.3 --- Greet the user named {{name}} in a single sentence.5. Flow
Section titled “5. Flow”apiVersion: genkit.dev/v1alpha1kind: Flowmetadata: name: greeterspec: image: ghcr.io/xavidop/genkit-runner:v0.4.1 modelRef: { name: claude-opus } promptRefs: - { name: greeting } port: 80806. Apply and verify
Section titled “6. Apply and verify”kubectl apply -f .kubectl get gfl greeterkubectl describe gfl greeter # check ConditionsWhen Ready=True:
kubectl port-forward svc/greeter 8080:8080 &curl -s -X POST http://localhost:8080/greeter \ -H 'content-type: application/json' \ -d '{"name":"Ada"}'7. Iterate
Section titled “7. Iterate”Edit the Prompt, reapply, and watch the rolling update:
kubectl edit prompt greetingkubectl rollout status deploy/greeterYou don’t need to bump anything else — the controller recomputes the content hash and patches the Deployment’s Pod template annotation automatically.
Inline model spec and prompts (no Model or Prompt CRs)
Section titled “Inline model spec and prompts (no Model or Prompt CRs)”If you prefer to keep everything in one manifest — or want to avoid
creating separate Model and Prompt CRs — you can embed both the
model definition and the prompt content directly in the Flow.
You still need a PluginConfig (and its Secret) for credentials;
only the Model and Prompt CRs become optional.
1. Credentials and plugin (same as before)
Section titled “1. Credentials and plugin (same as before)”kubectl create secret generic anthropic-credentials \ --from-literal=ANTHROPIC_API_KEY=sk-ant-...apiVersion: genkit.dev/v1alpha1kind: PluginConfigmetadata: name: anthropic-configspec: type: anthropic credentialsRef: name: anthropic-credentials credentialKeys: [ANTHROPIC_API_KEY]2. Flow with inline model spec and inline prompt
Section titled “2. Flow with inline model spec and inline prompt”apiVersion: genkit.dev/v1alpha1kind: Flowmetadata: name: greeterspec: image: ghcr.io/xavidop/genkit-runner:v0.4.1 modelSpec: provider: anthropic model: claude-opus-4-7 pluginConfigRef: name: anthropic-config defaultConfig: temperature: 0.3 maxOutputTokens: 1024 prompts: - prompt: name: greeting content: | --- model: anthropic/claude-opus-4-7 --- Greet the user named {{name}} in a single sentence. port: 8080modelSpec and modelRef are mutually exclusive — pick one. Likewise,
each item in prompts uses either promptRef (a reference to a
Prompt CR) or prompt (inline content), not both.
3. Apply and call
Section titled “3. Apply and call”kubectl apply -f plugin-config.yaml -f flow-inline.yamlkubectl get gfl greeter
kubectl port-forward svc/greeter 8080:8080 &curl -s -X POST http://localhost:8080/greeter \ -H 'content-type: application/json' \ -d '{"name":"Ada"}'