github.com/thomasobenaus/nomad@v0.11.1/command/agent/testdata/basic.hcl (about)

     1  # This file was used to generate basic.json from https://www.hcl2json.com/
     2  region = "foobar"
     3  
     4  datacenter = "dc2"
     5  
     6  name = "my-web"
     7  
     8  data_dir = "/tmp/nomad"
     9  
    10  plugin_dir = "/tmp/nomad-plugins"
    11  
    12  log_level = "ERR"
    13  
    14  log_json = true
    15  
    16  log_file = "/var/log/nomad.log"
    17  
    18  bind_addr = "192.168.0.1"
    19  
    20  enable_debug = true
    21  
    22  ports {
    23    http = 1234
    24    rpc  = 2345
    25    serf = 3456
    26  }
    27  
    28  addresses {
    29    http = "127.0.0.1"
    30    rpc  = "127.0.0.2"
    31    serf = "127.0.0.3"
    32  }
    33  
    34  advertise {
    35    rpc  = "127.0.0.3"
    36    serf = "127.0.0.4"
    37  }
    38  
    39  client {
    40    enabled    = true
    41    state_dir  = "/tmp/client-state"
    42    alloc_dir  = "/tmp/alloc"
    43    servers    = ["a.b.c:80", "127.0.0.1:1234"]
    44    node_class = "linux-medium-64bit"
    45  
    46    meta {
    47      foo = "bar"
    48      baz = "zip"
    49    }
    50  
    51    server_join {
    52      retry_join     = ["1.1.1.1", "2.2.2.2"]
    53      retry_max      = 3
    54      retry_interval = "15s"
    55    }
    56  
    57    options {
    58      foo = "bar"
    59      baz = "zip"
    60    }
    61  
    62    chroot_env {
    63      "/opt/myapp/etc" = "/etc"
    64      "/opt/myapp/bin" = "/bin"
    65    }
    66  
    67    network_interface = "eth0"
    68    network_speed     = 100
    69    cpu_total_compute = 4444
    70  
    71    reserved {
    72      cpu            = 10
    73      memory         = 10
    74      disk           = 10
    75      reserved_ports = "1,100,10-12"
    76    }
    77  
    78    client_min_port  = 1000
    79    client_max_port  = 2000
    80    max_kill_timeout = "10s"
    81  
    82    stats {
    83      data_points         = 35
    84      collection_interval = "5s"
    85    }
    86  
    87    gc_interval              = "6s"
    88    gc_parallel_destroys     = 6
    89    gc_disk_usage_threshold  = 82
    90    gc_inode_usage_threshold = 91
    91    gc_max_allocs            = 50
    92    no_host_uuid             = false
    93    disable_remote_exec      = true
    94  
    95    host_volume "tmp" {
    96      path = "/tmp"
    97    }
    98  
    99    cni_path              = "/tmp/cni_path"
   100    bridge_network_name   = "custom_bridge_name"
   101    bridge_network_subnet = "custom_bridge_subnet"
   102  }
   103  
   104  server {
   105    enabled                   = true
   106    authoritative_region      = "foobar"
   107    bootstrap_expect          = 5
   108    data_dir                  = "/tmp/data"
   109    protocol_version          = 3
   110    raft_protocol             = 3
   111    num_schedulers            = 2
   112    enabled_schedulers        = ["test"]
   113    node_gc_threshold         = "12h"
   114    job_gc_interval           = "3m"
   115    job_gc_threshold          = "12h"
   116    eval_gc_threshold         = "12h"
   117    deployment_gc_threshold   = "12h"
   118    heartbeat_grace           = "30s"
   119    min_heartbeat_ttl         = "33s"
   120    max_heartbeats_per_second = 11.0
   121    retry_join                = ["1.1.1.1", "2.2.2.2"]
   122    start_join                = ["1.1.1.1", "2.2.2.2"]
   123    retry_max                 = 3
   124    retry_interval            = "15s"
   125    rejoin_after_leave        = true
   126    non_voting_server         = true
   127    redundancy_zone           = "foo"
   128    upgrade_version           = "0.8.0"
   129    encrypt                   = "abc"
   130  
   131    server_join {
   132      retry_join     = ["1.1.1.1", "2.2.2.2"]
   133      retry_max      = 3
   134      retry_interval = "15s"
   135    }
   136  
   137    default_scheduler_config {
   138      preemption_config {
   139        batch_scheduler_enabled   = true
   140        system_scheduler_enabled  = true
   141        service_scheduler_enabled = true
   142      }
   143    }
   144  }
   145  
   146  acl {
   147    enabled           = true
   148    token_ttl         = "60s"
   149    policy_ttl        = "60s"
   150    replication_token = "foobar"
   151  }
   152  
   153  audit {
   154    enabled = true
   155  
   156    sink "file" {
   157      type               = "file"
   158      delivery_guarantee = "enforced"
   159      format             = "json"
   160      path               = "/opt/nomad/audit.log"
   161      rotate_bytes       = 100
   162      rotate_duration    = "24h"
   163      rotate_max_files   = 10
   164    }
   165  
   166    filter "default" {
   167      type       = "HTTPEvent"
   168      endpoints  = ["/v1/metrics"]
   169      stages     = ["*"]
   170      operations = ["*"]
   171    }
   172  }
   173  
   174  telemetry {
   175    statsite_address             = "127.0.0.1:1234"
   176    statsd_address               = "127.0.0.1:2345"
   177    prometheus_metrics           = true
   178    disable_hostname             = true
   179    collection_interval          = "3s"
   180    publish_allocation_metrics   = true
   181    publish_node_metrics         = true
   182    disable_tagged_metrics       = true
   183    backwards_compatible_metrics = true
   184  }
   185  
   186  leave_on_interrupt = true
   187  
   188  leave_on_terminate = true
   189  
   190  enable_syslog = true
   191  
   192  syslog_facility = "LOCAL1"
   193  
   194  disable_update_check = true
   195  
   196  disable_anonymous_signature = true
   197  
   198  http_api_response_headers {
   199    Access-Control-Allow-Origin = "*"
   200  }
   201  
   202  consul {
   203    server_service_name    = "nomad"
   204    server_http_check_name = "nomad-server-http-health-check"
   205    server_serf_check_name = "nomad-server-serf-health-check"
   206    server_rpc_check_name  = "nomad-server-rpc-health-check"
   207    client_service_name    = "nomad-client"
   208    client_http_check_name = "nomad-client-http-health-check"
   209    address                = "127.0.0.1:9500"
   210    allow_unauthenticated  = true
   211    token                  = "token1"
   212    auth                   = "username:pass"
   213    ssl                    = true
   214    verify_ssl             = true
   215    ca_file                = "/path/to/ca/file"
   216    cert_file              = "/path/to/cert/file"
   217    key_file               = "/path/to/key/file"
   218    server_auto_join       = true
   219    client_auto_join       = true
   220    auto_advertise         = true
   221    checks_use_advertise   = true
   222  }
   223  
   224  vault {
   225    address               = "127.0.0.1:9500"
   226    allow_unauthenticated = true
   227    task_token_ttl        = "1s"
   228    enabled               = false
   229    token                 = "12345"
   230    ca_file               = "/path/to/ca/file"
   231    ca_path               = "/path/to/ca"
   232    cert_file             = "/path/to/cert/file"
   233    key_file              = "/path/to/key/file"
   234    tls_server_name       = "foobar"
   235    tls_skip_verify       = true
   236    create_from_role      = "test_role"
   237  }
   238  
   239  tls {
   240    http                            = true
   241    rpc                             = true
   242    verify_server_hostname          = true
   243    ca_file                         = "foo"
   244    cert_file                       = "bar"
   245    key_file                        = "pipe"
   246    rpc_upgrade_mode                = true
   247    verify_https_client             = true
   248    tls_prefer_server_cipher_suites = true
   249    tls_cipher_suites               = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
   250    tls_min_version                 = "tls12"
   251  }
   252  
   253  sentinel {
   254    import "foo" {
   255      path = "foo"
   256      args = ["a", "b", "c"]
   257    }
   258  
   259    import "bar" {
   260      path = "bar"
   261      args = ["x", "y", "z"]
   262    }
   263  }
   264  
   265  autopilot {
   266    cleanup_dead_servers      = true
   267    disable_upgrade_migration = true
   268    last_contact_threshold    = "12705s"
   269    max_trailing_logs         = 17849
   270    min_quorum                = 3
   271    enable_redundancy_zones   = true
   272    server_stabilization_time = "23057s"
   273    enable_custom_upgrades    = true
   274  }
   275  
   276  plugin "docker" {
   277    args = ["foo", "bar"]
   278  
   279    config {
   280      foo = "bar"
   281  
   282      nested {
   283        bam = 2
   284      }
   285    }
   286  }
   287  
   288  plugin "exec" {
   289    config {
   290      foo = true
   291    }
   292  }