k8sgpt-ai / k8sgpt

Giving Kubernetes Superpowers to everyone
http://k8sgpt.ai
Apache License 2.0
5.22k stars 596 forks source link

k8sgpt analyze --explain --backend amazonbedrock fails with AccessDeniedException error #1022

Open gladwinz opened 3 months ago

gladwinz commented 3 months ago

Checklist

Affected Components

K8sGPT Version

0.3.28

Kubernetes Version

v1.28.0

Host OS and its Version

MacOS

Steps to reproduce

  1. Run k8sgpt auth add --backend amazonbedrock --model anthropic.claude-v2 to add the amazonbedrock provider
  2. Run k8sgpt analyze --explain --backend amazonbedrock to analyze issues within the cluster using Amazon Bedrock

Expected behaviour

The k8sgpt should analyze and explain any failures within the cluster with recommendations on how to rectify the issues.

Actual behaviour

Error message of Error: failed while calling AI provider amazonbedrock: AccessDeniedException: You don't have access to the model with the specified model ID.

Additional Information

The above error will be rectified if we run this command k8sgpt auth add --backend amazonbedrock --model anthropic.claude-v2 -r us-west-2 to add the amazonbedrock provider while providing the region.

JuHyung-Son commented 3 months ago

can you call bedrock request outside k8sgpt?

gladwinz commented 3 months ago

can you call bedrock request outside k8sgpt?

Yeap. I was able to call the bedrock API with no issue outside of k8sgpt.

AlexsJones commented 3 months ago

This is due to the region I believe. Iastest build has a fix, can you please try the new release? v0.3.29

  k8sgpt auth add -b amazonbedrock -h
  k8sgpt auth add -b amazonbedrock --providerRegion eu-central-1 -m anthropic.claude-v2
  k8sgpt analyze -b amazonbedrock -e

Should work as expected

Screenshot 2024-03-22 at 13 58 29