@@ -284,6 +284,7 @@ Examples:
284284 // Add flags for build command
285285 buildCmd .Flags ().StringVar (& buildCfg .Image , "image" , "" , "Full image specification (e.g., ghcr.io/myorg/my-agent:v1.0.0)" )
286286 buildCmd .Flags ().BoolVar (& buildCfg .Push , "push" , false , "Push the image to the registry" )
287+ buildCmd .Flags ().StringVar (& buildCfg .Platform , "platform" , "" , "Target platform for Docker build (e.g., linux/amd64, linux/arm64)" )
287288
288289 deployCfg := & cli.DeployCfg {
289290 Config : cfg ,
@@ -295,26 +296,33 @@ Examples:
295296 Long : `Deploy an agent to Kubernetes.
296297
297298This command will read the kagent.yaml file from the specified project directory,
298- create or reference a Kubernetes secret with the API key , and create an Agent CRD.
299+ load environment variables from a .env file , and create an Agent CRD with necessary secrets .
299300
300301The command will:
3013021. Load the agent configuration from kagent.yaml
302- 2. Either create a new secret with the provided API key or verify an existing secret
303- 3. Create an Agent CRD with the appropriate configuration
303+ 2. Load environment variables from a .env file (including the model provider API key)
304+ 3. Create Kubernetes secrets for environment variables and API keys
305+ 4. Create an Agent CRD with the appropriate configuration
304306
305- API Key Options:
306- --api-key: Convenience option to create a new secret with the provided API key
307- --api-key-secret: Canonical way to reference an existing secret by name
307+ API Key Requirements:
308+ The .env file MUST contain the API key for your model provider:
309+ - Anthropic: ANTHROPIC_API_KEY=your-key-here
310+ - OpenAI: OPENAI_API_KEY=your-key-here
311+ - Gemini: GOOGLE_API_KEY=your-key-here
312+
313+ Environment Variables:
314+ --env-file: REQUIRED. Path to a .env file containing environment variables (including API keys).
315+ Variables will be stored in a Kubernetes secret and mounted as environment variables.
308316
309317Dry-Run Mode:
310318 --dry-run: Output YAML manifests without applying them to the cluster. This is useful
311319 for previewing changes or for use with GitOps workflows.
312320
313321Examples:
314- kagent deploy ./my-agent --api-key-secret "my-existing-secret"
315- kagent deploy ./my-agent --api-key "your-api-key-here" --image "myregistry/myagent:v1.0"
316- kagent deploy ./my-agent --api-key-secret "my-secret" --namespace "my-namespace"
317- kagent deploy ./my-agent --api-key "your-api-key" --dry-run > manifests.yaml` ,
322+ kagent deploy ./my-agent --env-file .env
323+ kagent deploy ./my-agent --env-file .env --image "myregistry/myagent:v1.0"
324+ kagent deploy ./my-agent --env-file .env --namespace "my-namespace"
325+ kagent deploy ./my-agent --env-file .env --dry-run > manifests.yaml` ,
318326 Args : cobra .ExactArgs (1 ),
319327 Run : func (cmd * cobra.Command , args []string ) {
320328 deployCfg .ProjectDir = args [0 ]
@@ -324,15 +332,15 @@ Examples:
324332 os .Exit (1 )
325333 }
326334 },
327- Example : `kagent deploy ./my-agent --api-key-secret "my-existing-secret" ` ,
335+ Example : `kagent deploy ./my-agent --env-file .env ` ,
328336 }
329337
330338 // Add flags for deploy command
331339 deployCmd .Flags ().StringVarP (& deployCfg .Image , "image" , "i" , "" , "Image to use (defaults to localhost:5001/{agentName}:latest)" )
332- deployCmd .Flags ().StringVar (& deployCfg .APIKey , "api-key" , "" , "API key for the model provider (convenience option to create secret)" )
333- deployCmd .Flags ().StringVar (& deployCfg .APIKeySecret , "api-key-secret" , "" , "Name of existing secret containing API key" )
340+ deployCmd .Flags ().StringVar (& deployCfg .EnvFile , "env-file" , "" , "Path to .env file containing environment variables (including API keys)" )
334341 deployCmd .Flags ().StringVar (& deployCfg .Config .Namespace , "namespace" , "" , "Kubernetes namespace to deploy to" )
335342 deployCmd .Flags ().BoolVar (& deployCfg .DryRun , "dry-run" , false , "Output YAML manifests without applying them to the cluster" )
343+ deployCmd .Flags ().StringVar (& deployCfg .Platform , "platform" , "" , "Target platform for Docker build (e.g., linux/amd64, linux/arm64)" )
336344
337345 // add-mcp command
338346 addMcpCfg := & cli.AddMcpCfg {Config : cfg }
0 commit comments