github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/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    csi_volume_claim_gc_threshold = "12h"
   119    csi_plugin_gc_threshold       = "12h"
   120    heartbeat_grace               = "30s"
   121    min_heartbeat_ttl             = "33s"
   122    max_heartbeats_per_second     = 11.0
   123    retry_join                    = ["1.1.1.1", "2.2.2.2"]
   124    start_join                    = ["1.1.1.1", "2.2.2.2"]
   125    retry_max                     = 3
   126    retry_interval                = "15s"
   127    rejoin_after_leave            = true
   128    non_voting_server             = true
   129    redundancy_zone               = "foo"
   130    upgrade_version               = "0.8.0"
   131    encrypt                       = "abc"
   132    raft_multiplier               = 4
   133    enable_event_broker           = false
   134    event_buffer_size             = 200
   135  
   136    server_join {
   137      retry_join     = ["1.1.1.1", "2.2.2.2"]
   138      retry_max      = 3
   139      retry_interval = "15s"
   140    }
   141  
   142    default_scheduler_config {
   143      scheduler_algorithm = "spread"
   144  
   145      preemption_config {
   146        batch_scheduler_enabled   = true
   147        system_scheduler_enabled  = true
   148        service_scheduler_enabled = true
   149      }
   150    }
   151  }
   152  
   153  acl {
   154    enabled           = true
   155    token_ttl         = "60s"
   156    policy_ttl        = "60s"
   157    replication_token = "foobar"
   158  }
   159  
   160  audit {
   161    enabled = true
   162  
   163    sink "file" {
   164      type               = "file"
   165      delivery_guarantee = "enforced"
   166      format             = "json"
   167      path               = "/opt/nomad/audit.log"
   168      rotate_bytes       = 100
   169      rotate_duration    = "24h"
   170      rotate_max_files   = 10
   171    }
   172  
   173    filter "default" {
   174      type       = "HTTPEvent"
   175      endpoints  = ["/v1/metrics"]
   176      stages     = ["*"]
   177      operations = ["*"]
   178    }
   179  }
   180  
   181  telemetry {
   182    statsite_address           = "127.0.0.1:1234"
   183    statsd_address             = "127.0.0.1:2345"
   184    prometheus_metrics         = true
   185    disable_hostname           = true
   186    collection_interval        = "3s"
   187    publish_allocation_metrics = true
   188    publish_node_metrics       = true
   189  }
   190  
   191  leave_on_interrupt = true
   192  
   193  leave_on_terminate = true
   194  
   195  enable_syslog = true
   196  
   197  syslog_facility = "LOCAL1"
   198  
   199  disable_update_check = true
   200  
   201  disable_anonymous_signature = true
   202  
   203  http_api_response_headers {
   204    Access-Control-Allow-Origin = "*"
   205  }
   206  
   207  consul {
   208    server_service_name    = "nomad"
   209    server_http_check_name = "nomad-server-http-health-check"
   210    server_serf_check_name = "nomad-server-serf-health-check"
   211    server_rpc_check_name  = "nomad-server-rpc-health-check"
   212    client_service_name    = "nomad-client"
   213    client_http_check_name = "nomad-client-http-health-check"
   214    address                = "127.0.0.1:9500"
   215    allow_unauthenticated  = true
   216    token                  = "token1"
   217    auth                   = "username:pass"
   218    ssl                    = true
   219    verify_ssl             = true
   220    ca_file                = "/path/to/ca/file"
   221    cert_file              = "/path/to/cert/file"
   222    key_file               = "/path/to/key/file"
   223    server_auto_join       = true
   224    client_auto_join       = true
   225    auto_advertise         = true
   226    checks_use_advertise   = true
   227  }
   228  
   229  vault {
   230    address               = "127.0.0.1:9500"
   231    allow_unauthenticated = true
   232    task_token_ttl        = "1s"
   233    enabled               = false
   234    token                 = "12345"
   235    ca_file               = "/path/to/ca/file"
   236    ca_path               = "/path/to/ca"
   237    cert_file             = "/path/to/cert/file"
   238    key_file              = "/path/to/key/file"
   239    tls_server_name       = "foobar"
   240    tls_skip_verify       = true
   241    create_from_role      = "test_role"
   242  }
   243  
   244  tls {
   245    http                            = true
   246    rpc                             = true
   247    verify_server_hostname          = true
   248    ca_file                         = "foo"
   249    cert_file                       = "bar"
   250    key_file                        = "pipe"
   251    rpc_upgrade_mode                = true
   252    verify_https_client             = true
   253    tls_prefer_server_cipher_suites = true
   254    tls_cipher_suites               = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
   255    tls_min_version                 = "tls12"
   256  }
   257  
   258  sentinel {
   259    import "foo" {
   260      path = "foo"
   261      args = ["a", "b", "c"]
   262    }
   263  
   264    import "bar" {
   265      path = "bar"
   266      args = ["x", "y", "z"]
   267    }
   268  }
   269  
   270  autopilot {
   271    cleanup_dead_servers      = true
   272    disable_upgrade_migration = true
   273    last_contact_threshold    = "12705s"
   274    max_trailing_logs         = 17849
   275    min_quorum                = 3
   276    enable_redundancy_zones   = true
   277    server_stabilization_time = "23057s"
   278    enable_custom_upgrades    = true
   279  }
   280  
   281  plugin "docker" {
   282    args = ["foo", "bar"]
   283  
   284    config {
   285      foo = "bar"
   286  
   287      nested {
   288        bam = 2
   289      }
   290    }
   291  }
   292  
   293  plugin "exec" {
   294    config {
   295      foo = true
   296    }
   297  }