Configure API credentials and connection settings for OpenAI, Anthropic, Google, and AWS Bedrock so agents across your cluster can access LLMs.
The ModelProvider CRD stores the connection configuration that Flokoa uses to reach a Large Language Model provider. It separates authentication and endpoint settings from model parameters, so you can share a single provider across many Model resources without duplicating credentials. When you create a ModelProvider, the operator reads the referenced Kubernetes Secret, validates the configuration, and marks the resource ready for use by any Model in the cluster.
Google supports two authentication modes depending on whether you are using the Google AI API (API key) or Vertex AI (service account).Google AI — API key:
Vertex AI does not use apiKeySecretRef. Authentication is handled entirely through the service account key referenced in google.serviceAccountKeySecretRef.
AWS Bedrock does not require an API key field. AWS credentials are resolved from the environment — IAM Roles for Service Accounts (IRSA) is the recommended approach on EKS.
Configure AWS credentials via IRSA (recommended), EC2 instance profiles, or environment variables injected into the operator pod. Do not store AWS access keys in the ModelProvider spec.
Use defaultHeaders to attach arbitrary HTTP headers to every request made through this provider. This is useful for routing, tenant identification, or custom authentication schemes:
For custom or internal endpoints that use self-signed certificates, configure the tls block:
spec: apiKeySecretRef: name: api-credentials key: api-key openai: baseURL: "https://internal-llm.company.local/v1" tls: # Provide a custom CA certificate caSecretRef: name: custom-ca-cert key: ca.crt # Also trust the system CA bundle alongside your custom CA useSystemCAs: true # Only set insecureSkipVerify: true in non-production environments insecureSkipVerify: false
# Create the CA certificate secretkubectl create secret generic custom-ca-cert \ --from-file=ca.crt=/path/to/ca.crt
Setting insecureSkipVerify: true disables certificate validation entirely. Never use this in production — it exposes your API traffic to man-in-the-middle attacks.
Never commit API keys to version control — always store them in Kubernetes Secrets.
Restrict Secret access with RBAC — grant get on specific Secret names only to the service accounts that need them.
Rotate keys regularly and update the Secret; the operator detects the secretHash change and reconciles automatically.
Isolate environments with namespaces — keep development, staging, and production providers in separate namespaces.
Always verify TLS for custom endpoints — do not use insecureSkipVerify: true in production.
Prefer IRSA or Workload Identity over long-lived API keys wherever your provider supports it (e.g., AWS Bedrock with IRSA, Vertex AI with Workload Identity).
Enable Kubernetes audit logging to track all Secret access events.
Consider an external secrets operator (e.g., External Secrets Operator with AWS Secrets Manager or HashiCorp Vault) for centralised secret rotation.
# Inspect status conditionskubectl describe modelprovider <name># Verify the Secret exists with the correct keykubectl get secret openai-credentials -o jsonpath='{.data.api-key}' | base64 -d
Common causes:
The Secret named in apiKeySecretRef.name does not exist.
The Secret key does not match apiKeySecretRef.key.
The API key stored in the Secret is invalid or has been revoked.
Authentication errors when calling the LLM
# Check the current provider configurationkubectl get modelprovider openai-provider -o yaml# Update the Secret with a fresh keykubectl create secret generic openai-credentials \ --from-literal=api-key=sk-proj-new-key \ --dry-run=client -o yaml | kubectl apply -f -
After updating the Secret the operator automatically re-reads it and re-reconciles the provider. No changes to the ModelProvider manifest are needed.
Connection timeouts to the provider API
Increase timeoutSeconds in the provider block (e.g., timeoutSeconds: 120).
Check that egress NetworkPolicies allow traffic from the operator pod to the provider’s HTTPS endpoint.
Verify DNS resolves correctly from within the cluster for custom baseURL values.
If you are behind a corporate HTTP proxy, ensure HTTP_PROXY and NO_PROXY are set on the operator Deployment.
Verifying connectivity end-to-end
Create a minimal Model resource that references the provider and watch whether it transitions to ready: