📘 Teleport Kube Agent Setup on AWS with Multi-Account, Discovery, and IAM #55537
pnrao1983
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This guide documents the full journey of deploying the Teleport Kube Agent using Helm with AWS IAM joining and auto-discovery features enabled. It includes real errors encountered, resolution steps, and how to verify AWS IAM setup.
🛠️ Setup Overview
Helm Values Used (aws-agent-values.yaml)
Token (Required for teleport Join)
📂 Sample Discovered Resources
Kubernetes Clusters
Databases
SSH Nodes
🧺s Helm Commands & Errors
First Attempt – Chart Not Found
helm upgrade teleport teleport/teleport-kluster -n teleport -f aws-values.yaml
Error: chart "teleport-kluster" matching not found in teleport index.
✅ Fixed by using the correct chart name:
helm search repo teleport
Found teleport/teleport-cluster
Release Not Found
helm upgrade teleport teleport/teleport-cluster -n teleport -f aws-values.yaml
Error: UPGRADE FAILED: "teleport" has no deployed releases
✅ Fixed by using --install:
helm upgrade --install teleport teleport/teleport-cluster -n teleport -f aws-values.yaml
❌ ServiceAccount Conflict
Error: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount "nara-k8s-role" in namespace "teleport" exists and cannot be imported into the current release:
invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "teleport": current value is "nara-kluster"
✅ Fix: Either delete the existing ServiceAccount or reuse the same Helm release name (nara-kluster).
✅ Successful Agent Install
helm upgrade teleport-kube-agent teleport/teleport-kube-agent -n teleport-kube-agent -f aws-agent-values.yaml
Status: deployed
Validate:
kubectl describe cm teleport-kube-agent -n teleport-kube-agent
Confirmed config map includes all db_service, ssh_service, discovery_service, and kube_service settings
🔐 AWS IAM Role Setup
IAM Role: teleport-kube-role
Trust Relationship
IAM Policy Permissions Example
📟 Sample IAM-Related Logs
❌ Role Assumption Failure (in agent logs)
time="2025-06-05T12:34:56Z" level=error msg="Failed to assume IAM role: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource arn:aws:iam::123456789:role/teleport-kube-role"
❌ EC2 AutoEnroll Error (SSM missing permission)
time="2025-06-05T12:35:20Z" level=error msg="SSM document execution failed: AccessDeniedException: User: arn:aws:sts::123456789:assumed-role/teleport-kube-role/i-0abcde123456 is not authorized to perform: ssm:SendCommand"
❌ OIDC Role Binding Issue
Error: WebIdentityErr: failed to retrieve credentials caused by: AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity
🧩 Tips for Troubleshooting IAM & Assumed Role Permissions
aws sts assume-role --role-arn arn:aws:iam::123456789:role/teleport-kube-role --role-session-name teleport-test
aws eks describe-cluster --name <your-cluster> --query "cluster.identity.oidc.issuer"
If the agent pod fails to assume the role:
kubectl exec -it <teleport-agent-pod> -- curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
🧹 Summary
This deployment configures a Teleport Kube Agent that:
Joins using IAM with no tokens required
Discovers EKS, EC2, and RDS resources across regions
Uses a shared IAM role and labels for multi-account resource targeting
✅ Ensure your IAM trust and policies are validated. Any mismatch between assume_role_arn, OIDC, or permissions can silently fail discovery.
Beta Was this translation helpful? Give feedback.
All reactions