datacenter = "dc1"
data_dir = "/opt/nomad/data"
plugin_dir = "/opt/nomad/plugins"
log_level = "INFO"
name = "hcp1"

bind_addr = "hcp1.tailnet-68f9.ts.net"

addresses {
  http = "hcp1.tailnet-68f9.ts.net"
  rpc  = "hcp1.tailnet-68f9.ts.net"
  serf = "hcp1.tailnet-68f9.ts.net"
}

advertise {
  http = "hcp1.tailnet-68f9.ts.net:4646"
  rpc  = "hcp1.tailnet-68f9.ts.net:4647"
  serf = "hcp1.tailnet-68f9.ts.net:4648"
}

client {
  enabled = true
  servers = [
    "ch2.tailnet-68f9.ts.net:4647",
    "ash3c.tailnet-68f9.ts.net:4647",
    "onecloud1.tailnet-68f9.ts.net:4647",
    "de.tailnet-68f9.ts.net:4647"
  ]
  
  # 配置host volumes
  host_volume "fnsync" {
    path = "/mnt/fnsync"
    read_only = false
  }
  
  host_volume "vault-storage" {
    path = "/opt/nomad/data/vault-storage"
    read_only = false
  }
  
  host_volume "traefik-certs" {
    path = "/opt/traefik/certs"
    read_only = false
  }
  
  # 禁用Docker驱动，只使用Podman
  options {
    "driver.raw_exec.enable" = "1"
    "driver.exec.enable" = "1"
  }
  
  # 配置节点元数据
  meta {
    consul = "true"
    consul_version = "1.21.5"
    consul_server = "true"
  }
  
  # 激进的垃圾清理策略
  gc_interval = "5m"
  gc_disk_usage_threshold = 80
  gc_inode_usage_threshold = 70
  gc_max_allocs = 50
  
  # 网络配置
  network_interface = "tailscale0"
  
  # 资源限制
  cpu_total_compute = 4000
  memory_total_mb = 8192
  
  # 任务限制
  max_kill_timeout = "30s"
  
  # 日志配置
  logging {
    level = "INFO"
    format = "json"
    enable_syslog = true
    syslog_facility = "LOCAL0"
  }
  
  # 插件配置
  plugin_dir = "/opt/nomad/plugins"
  
  # 状态同步
  state_dir = "/opt/nomad/data/client"
  alloc_dir = "/opt/nomad/data/alloc"
  
  # 任务驱动配置
  task_drivers = ["exec", "raw_exec"]
  
  # 网络指纹
  network_interface = "tailscale0"
  
  # 存储配置
  disk_free_threshold = "10%"
  disk_usage_threshold = "90%"
  
  # 任务限制
  max_kill_timeout = "30s"
  
  # 健康检查
  health_check_grace_period = "30s"
  
  # 任务重启策略
  restart_policy {
    interval = "5m"
    attempts = 3
    delay = "15s"
    mode = "fail"
  }
  
  # 任务清理
  cleanup_interval = "5m"
  
  # 任务监控
  enable_monitoring = true
  
  # 任务日志
  log_config {
    enabled = true
    max_file_size = "10MB"
    max_files = 10
  }
  
  # 任务资源
  resource_limits {
    cpu_total_compute = 4000
    memory_total_mb = 8192
  }
  
  # 任务网络
  network_config {
    interface = "tailscale0"
    port_range = "20000-30000"
  }
  
  # 任务存储
  storage_config {
    disk_free_threshold = "10%"
    disk_usage_threshold = "90%"
  }
  
  # 任务安全
  security_config {
    enable_tls = false
    verify_server_hostname = false
  }
  
  # 任务调试
  debug_config {
    enabled = false
    log_level = "INFO"
  }
}
