teleport machine ID kubernetes
- User
teleport machine ID kubernetes
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
teleport machine ID kubernetes
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Teleport Machine ID provides a secure method for machines and services to authenticate with Kubernetes clusters using short-lived certificates. Here's how to deploy and configure it:
Teleport's Machine ID uses the tbot daemon to manage credentials. The recommended approach for Kubernetes involves:
Standalone Deployment
Run tbot as a separate Kubernetes Deployment rather than a sidecar, due to Kubernetes' limited sidecar lifecycle management[1].
Kubernetes Join Method
Authenticate using JWT tokens signed by the Kubernetes API server. This method works with most clusters and verifies:
1. Prepare Kubernetes RBAC
# k8s-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: tbot
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: secrets-admin
namespace: default
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tbot-secrets-admin
namespace: default
subjects:
- kind: ServiceAccount
name: tbot
roleRef:
kind: Role
name: secrets-admin
Apply with: kubectl apply -f k8s-rbac.yaml[1]
2. Create Teleport Bot
# bot.yaml
kind: bot
version: v1
metadata:
name: k8s-access-bot
spec:
roles: [kubernetes-access]
Create with: tctl create -f bot.yaml[1][7]
3. Configure tbot Deployment
# tbot-deployment.yaml
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
serviceAccountName: tbot
containers:
- name: tbot
image: public.ecr.aws/gravitational/teleport:latest
args: ["start", "--config=/etc/tbot/tbot.yaml"]
volumeMounts:
- name: config
mountPath: /etc/tbot
volumes:
- name: config
secret:
secretName: tbot-config
4. Set Up Kubernetes Output
In tbot configuration:
outputs:
- type: kubernetes
destination:
type: kubernetes_secret
name: teleport-kubeconfig
roles: [kubernetes-access]
This generates a kubeconfig.yaml secret automatically renewed every 20 minutes[2][7].
Use the generated credentials with:
kubectl --kubeconfig /path/to/kubeconfig.yaml get pods
Or set environment variable:
export KUBECONFIG=/path/to/kubeconfig.yaml
gcp or iam join methods instead of Kubernetes JWT[1]resourceNames in Role definitions for production[1]This setup eliminates long-lived credentials while maintaining compatibility with Kubernetes tools like Helm, ArgoCD, and Lens[2][7]. The certificates automatically rotate every 20 minutes by default, significantly reducing exposure risk compared to static kubeconfig files[5][6].