Gravitational Teleport docker-compose简单运行

Gravitational Teleport 可以作为堡垒机进行使用,为了测试方便使用docker-compose
运行一个all in one 的demo
备注: 官方提供的docker-compose 文件版太旧,而且复杂

环境准备

  • docker-compose 文件
 
version: '2'
services:
  one:
    image: quay.io/gravitational/teleport:2.7.3
    container_name: one
    mem_limit: 300m
    memswap_limit: 0
    ports:
      - "3080:3080"
      - "3023:3023"
      - "3025:3025"
      - "3024:3024"
    volumes:
      - ./one.yaml:/etc/teleport/teleport.yaml
      - ./data/one:/var/lib/teleport
      - certs:/mnt/shared/certs
    networks:
      teleport:
        ipv4_address: 172.10.1.1
        aliases:
          - one-lb
networks:
  teleport:
    driver: bridge
    ipam:
      driver: default
      config:
      - subnet: 172.10.1.0/16
        ip_range: 172.10.1.0/24
        gateway: 172.10.1.254
volumes:
  certs:
 
 
  • Teleport 配置文件
    为了方便,关闭了2f,同时包好的node proxy auth 的role
 
teleport:
  nodename: one
  advertise_ip: 172.10.1.1
  log:
    output: /var/lib/teleport/teleport.log
    severity: INFO
  data_dir: /var/lib/teleport
  storage:
      path: /var/lib/teleport/backend
      type: dir
auth_service:
  enabled: yes
  authentication:
    type: local
    second_factor: off
  cluster_name: one
  tokens: 
       - "node,auth,proxy:foo"
       - "trustedcluster:bar"
ssh_service:
  enabled: yes
  labels:
      cluster: one
  commands:
      - name: kernel
        command: [/bin/uname, -r]
        period: 5m
proxy_service:
  enabled: yes
 
 

运行&&测试

  • 启动
docker-compose up -d
 
  • 添加用户
    因为使用的local ,inside 容器
 
tctl users add root
Signup token has been created and is valid for 1 hours. Share this URL with the user:
https://one:3080/web/newuser/f14e192e8adc32a01d1f7ca945225ace
NOTE: Make sure one:3080 points at a Teleport proxy which users can access.
 

说明

这个只是一个简单的all in one 的demo,实际上也可以管理k8s

参考资料

https://github.com/rongfengliang/teleport-docker-compose
https://gravitational.com/teleport/docs/quickstart/
https://gravitational.com/teleport/docs/admin-guide/#configuration
https://quay.io/repository/gravitational/teleport?tab=tags

posted on   荣锋亮  阅读(1049)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2013-12-28 使用js 文件参数 以及IHttpModule实现服务验证asp.net 版的初步实现
2013-12-28 获取js 文件传递的参数并使用json2进行json数据转换

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示