【问题标题】:AWS Gitlab Autoscale runner with private IP, don't want to enable Public IP具有私有 IP 的 AWS Gitlab Autoscale 运行器,不想启用公共 IP
【发布时间】:2022-01-11 22:10:36
【问题描述】:

在 AWS 中,具有私有 IP 的 Gitlab Autoscale 运行器,不想启用公共 IP。 目前我们的 Gitlab Autoscale 运行器配置了公共 IP,因此 Runner Hub 通过自动扩展运行器的公共 IP 连接。为此,我们在安全组中打开所有 TCP 端口。 为了避免这种情况,是否可以停止使用公共 IP 并使用私有 IP 来连接 Gitlab Hub 和自动缩放运行器?

concurrent = 100
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "aws-abc-runner-autoscale"
  limit = 110
  url = "https://git.abc-example.in/"
  token = "xxxxxxxxxxxx"
  executor = "docker+machine"
  environment = ["DOCKER_AUTH_CONFIG={ \"auths\": { \"docker.dev.abc.com\": { \"auth\": \"################################################\" }, \"silicon.docker.dev.abc.com\": { \"auth\": \"################################################\" }, \"cde.dev.abc.com\": { \"auth\": \"################################################\" }, \"abcde.azurecr.io\": { \"auth\": \"##########################################\" }, \"efghijk.azurecr.io\": { \"auth\": \"###################################################\" } } }"]
  [runners.custom_build_dir]
    enabled = true
  [runners.cache]
    Type = "s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "ip-172-31-11-12.eu-central-1.compute.internal:9005"
      AccessKey = "xxxxxxxxxx"
      SecretKey = "xxxxxxxxxx"
      BucketName = "runner-autoscale"
      Insecure = true
  [runners.docker]
    tls_verify = false
    image = "docker:latest"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock"]
    shm_size = 0
  [runners.machine]
    IdleCount = 4
    IdleTime = 300
    MachineDriver = "amazonec2"
    MachineName = "abcdev-runners-%s"
    MachineOptions = ["amazonec2-ami=ami-08a1a615784dd1c82f", "amazonec2-region=eu-central-1", "amazonec2-zone=b", "amazonec2-vpc-id=vpc-0f458d68", "amazonec2-subnet-id=subnet-c23438b8", "amazonec2-instance-type=t3.xlarge", "amazonec2-root-size=250", "amazonec2-volume-type=gp2", "amazonec2-use-private-address=true"]
    OffPeakTimezone = ""
    OffPeakIdleCount = 0
    OffPeakIdleTime = 0

谁能提供我们如何实现相同的功能。

【问题讨论】:

    标签: gitlab-ci-runner gitlab-ce runner gitlab-runner


    【解决方案1】:

    根据您的设置方式,您的跑步者不需要从您的 GitLab 实例通过网络访问,因此让他们拥有私有 IP 就像将您在 amazonec2-subnet-id 中设置的子网更改为一样简单是一个不分配公共IP的人。请注意,您的私有子网需要连接一个 NAT 网关才能访问您的 GitLab 实例,或者配置为使用内部 vpc 网络。

    【讨论】:

      猜你喜欢
      • 2017-10-09
      • 2017-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多