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