ワークロードオーケストレーター(コンテナオーケストレーター)である Nomad と Docker を利用して RIPE Atlas Probe の運用を開始したことについて取り上げます。
疎通性や遅延などのネットワーク環境を継続して観測・記録するために、2023/06/20 頃から RIPE Atlas Probe の運用を開始しました。
RIPE Atlas そのものの説明については、以下のページに譲ります。
- What is RIPE Atlas? | RIPE Atlas https://atlas.ripe.net/about/
ワークロードオーケストレーターである Nomad と Docker を利用して、RIPE Atlas Probe を構築・運用しています。Nomad そのものの運用については、今後のブログで取り上げます。
- Nomad by HashiCorp https://www.nomadproject.io/
Nomad is a flexible workload orchestrator that enables an organization to easily deploy and manage any containerized or legacy application using a single, unified workflow. Nomad can run a diverse workload of Docker, non-containerized, microservice, and batch applications. https://developer.hashicorp.com/nomad/intro#what-is-nomad
RIPE Atlas Probe のコンテナイメージとして docker.io/jamesits/ripe-atlas
を利用しています。
- jamesits/ripe-atlas - Docker Image | Docker Hub https://hub.docker.com/r/jamesits/ripe-atlas
- Jamesits/docker-ripe-atlas: This is the RIPE Atlas software probe packaged as a Docker image. https://github.com/Jamesits/docker-ripe-atlas
CNI(Container Network Interface)でネットワークインターフェースを管理することで、RIPE Atlas Probe のコンテナに直接パブリック IP アドレスを割り当てました。
CNI 設定ファイルのサンプルは以下の通りです。
{
"cniVersion": "1.0.0",
"name": "cni-atlas-probe1",
"plugins": [
{
"type": "loopback"
},
{
"type": "bridge",
"bridge": "br1",
"promiscMode": true,
"ipam": {
"type": "static",
"addresses": [
{
"address": "103.48.40.72/26",
"gateway": "103.48.40.126"
},
{
"address": "2400:c7e0:7002::7/64",
"gateway": "2400:c7e0:7002::fffe"
}
],
"routes": [
{ "dst": "0.0.0.0/0" },
{ "dst": "::/0" }
]
}
},
{
"type": "firewall",
"backend": "iptables",
"iptablesAdminChainName": "CNI-ATLAS-PROBE1-ADMIN"
}
]
}
Nomad jobspec ファイルのサンプルは以下の通りです。
job "atlas-probe1" {
datacenters = ["*"]
group "apps" {
count = 1
network {
mode = "cni/cni-atlas-probe1"
}
volume "atlas-probe1-etc" {
type = "csi"
source = "atlas-probe1-etc"
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
volume "atlas-probe1-status" {
type = "csi"
source = "atlas-probe1-status"
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
task "app" {
driver = "docker"
config {
# tag は latest のみ
image = "jamesits/ripe-atlas:latest"
# https://github.com/Jamesits/docker-ripe-atlas/blob/master/docker-compose.yaml
cap_add = [
"CHOWN",
"SETUID",
"SETGID",
"DAC_OVERRIDE",
"NET_RAW",
]
cap_drop = [
"ALL",
]
}
env {
RXTXRPT = "yes"
}
# /var/atlas-probe でマウントしてしまうと /var/atlas-probe/bin などが消えてしまい起動に失敗する
volume_mount {
volume = "atlas-probe1-etc"
destination = "/var/atlas-probe/etc"
}
volume_mount {
volume = "atlas-probe1-status"
destination = "/var/atlas-probe/status"
}
# 暫定値
resources {
cpu = 64
memory = 32
}
}
}
}
以上のような設定にて特に問題なく継続して動作しています。
今後は、RIPE Atlas Anchor や、異なる拠点の RIPE Atlas Probe も運用していく予定です。