@@ -61,25 +61,39 @@ locals {
6161 // Check if all clusters has size greater than 1
6262 template_manages_clusters_size_gt_1 = alltrue ([for c in var . build_clusters_config : (c. cluster_size > 1 )])
6363
64+ // for more docs, see https://linux.die.net/man/5/nfs
65+ default_persistent_volume_type_nfs_mount_options = [
66+ // network
67+ " hard" , // retry nfs requests indefinitely until they succeed, never fail
68+ " async" , // write eventually
69+ " nconnect=7" , // use multiple connections
70+ " noresvport" , // use a non-privileged source port
71+ " retrans=3" , // retry two times before performing recovery actions
72+ " timeo=600" , // wait 60 seconds (measured in deci-seconds) before retrying a failed request
73+
74+ // resiliency
75+ " fg" , // wait for mounts to finish before exiting
76+ " cto" , // enable "close-to-open" attribute checks
77+ " lock" , // enable network locking
78+ " local_lock=none" , // all locks are network locks
79+
80+ // caching
81+ " noac" , // disable attribute caching. slower, but more reliable
82+ " lookupcache=none" , // disable lookup caching
83+
84+ // security
85+ " noacl" , // do not use an acl
86+ " sec=sys" , // use AUTH_SYS for all requests
87+ ]
88+
6489 persistent_volume_types = {
6590 for key , config in var . persistent_volume_types : key => {
6691 local_mount_path = " /mnt/persistent-volume-types/${ key } "
6792 nfs_location = module.persistent- volume- types[key].nfs_location
68- nfs_mount_opts = join (" ," , [ // for more docs, see https://linux.die.net/man/5/nfs
69- format (" nfsvers=%s" , module. persistent-volume-types [key ]. nfs_version ),
70- " sync" , // write immediately
71- " hard" , // retry nfs requests indefinitely until they succeed, never fail
72- " lookupcache=none" , // disable the lookup cache
73- " nconnect=7" , // use multiple connections
74- " noac" , // disable attribute cache
75- " noacl" , // do not use an acl
76- " cto" , // enable "close-to-open" attribute checks
77- " nolock" , // do not use locking
78- " noresvport" , // use a non-privileged source port
79- " retrans=2" , // retry two times before performing recovery actions
80- " sec=sys" , // use AUTH_SYS for all requests
81- " timeo=600" , // wait 60 seconds (measured in deci-seconds) before retrying a failed request
82- ])
93+ nfs_mount_opts = join (" ," , concat (
94+ [format (" nfsvers=%s" , module. persistent-volume-types [key ]. nfs_version )],
95+ config. mount_options != null ? config. mount_options : local. default_persistent_volume_type_nfs_mount_options ,
96+ ))
8397 }
8498 }
8599}
@@ -272,6 +286,7 @@ module "nomad" {
272286 envd_timeout = var. envd_timeout
273287 persistent_volume_mounts = { for key , config in local . persistent_volume_types : key => config [" local_mount_path" ] }
274288 default_persistent_volume_type = var. default_persistent_volume_type
289+ orchestrator_env_vars = var. orchestrator_env_vars
275290
276291 # Template manager
277292 builder_node_pool = var. build_node_pool
0 commit comments