Files

36 lines
1.2 KiB
YAML

# NOT APPLIED to a real cluster. Account id, OIDC provider id and names are examples.
# IRSA: the annotation is the whole link between the pod and the IAM role. The application sets no AWS key.
apiVersion: v1
kind: ServiceAccount
metadata:
name: spring-ai
namespace: ai
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/spring-ai-bedrock
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-ai
namespace: ai
spec:
replicas: 2
selector:
matchLabels: { app: spring-ai }
template:
metadata:
labels: { app: spring-ai }
spec:
serviceAccountName: spring-ai
containers:
- name: app
image: registry.example.com/spring-ai-cloud-providers:1.0.0
env:
- name: SPRING_PROFILES_ACTIVE
value: bedrock
# IRSA's webhook injects AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE (confirmed in AWS's docs); check with
# `kubectl describe pod` whether AWS_REGION is there too. Spring AI ignores AWS_REGION for Bedrock
# (output/02-bedrock-region-trap.txt), so set the region property explicitly:
- name: SPRING_AI_BEDROCK_AWS_REGION
value: us-east-1