cat >my-deployment.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
serviceAccountName: pod-identity-sa-test
containers:
- name: my-app
image: amazon/aws-cli:latest
command: ["sleep", "100000000"]
EOF
kubectl apply -f my-deployment.yaml
cat >test.py <<EOF
import boto3
# Create an S3 client
s3 = boto3.client('s3')
# List all S3 buckets
response = s3.list_buckets()
# Print the names of each bucket
print("S3 Buckets:")
for bucket in response['Buckets']:
print(bucket['Name'])
EOF