[PoC] Teleport - Database 연결해보기

jeonghyun yu·2025년 9월 19일

공부

목록 보기
4/4

agent 설치에 필요한 정보들 수집하기

$ k get svc
NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                                                                     AGE
teleport-cluster            LoadBalancer   10.96.117.182   172.20.11.107   443:30521/TCP,3023:31547/TCP,3026:31177/TCP,3024:30681/TCP,3036:31116/TCP   24h
teleport-cluster-auth       ClusterIP      10.109.128.40   <none>          3025/TCP,3026/TCP                                                           24h

$ kubectl exec -it teleport-cluster-auth-55678fdc5c-p68bc -- tctl tokens add --type=db
The invite token: 8b3ce895394f17470284b9836c5f700d
This token will expire in 30 minutes.

Generate the configuration and start a Teleport agent using it:

> teleport db configure create \
   --token=8b3ce895394f17470284b9836c5f700d \
   --ca-pin=sha256:a52c3af65a555028d362f23e0f5d6ed0a7cc260200be296953cf026e6c47d285 \
   --proxy=lit.teleport.com:443 \
   --name= \
   --protocol= \
   --uri= \
   --output file:///etc/teleport.yaml

> teleport start -c /etc/teleport.yaml

Please note:

  - This invitation token will expire in 30 minutes.
  - Database address  must be reachable from the new database
    service.
  - When proxying an on-prem database, it must be configured with Teleport CA
    and key pair issued by "tctl auth sign --format=db" command.
  - When proxying an AWS RDS or Aurora database, the region must also be
    specified with --db-aws-region flag.

0개의 댓글