79311250

Date: 2024-12-27 08:05:20
Score: 0.5
Natty:
Report link

The primary error: [Errno 2] No such file or directory: 'aws' This appears before the 403 error and this is a indication that the Lambda function can't find the AWS CLI, which is needed for the token generation in your kubeconfig. This is why you're being identified as system:anonymous

Hence Suggest to removed the AWS CLI dependency *in the kube_config dictionary under the users section *

Please Replace this with direct boto3 token generation

'users': [{ 'name': cluster_name, 'user': { 'exec': { # This part tries to execute the AWS CLI 'apiVersion': 'client.authentication.k8s.io/v1beta1', 'command': 'aws', # <-- This is trying to use the AWS CLI command 'args': ['eks', 'get-token', '--cluster-name', cluster_name] } } }]

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: gayan ranasinghe