Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
fix: set CSI params for Nomad runner install.
Browse files Browse the repository at this point in the history
  • Loading branch information
paladin-devops committed Nov 2, 2022
1 parent 43ca65f commit a368630
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/4157.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
install/nomad: Update installation with Nomad to use CSI parameters.
```
9 changes: 8 additions & 1 deletion internal/runnerinstall/nomad.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type NomadConfig struct {
CsiFS string `hcl:"csi_fs,optional"`
CsiTopologies map[string]string `hcl:"nomad_csi_topologies,optional"`
CsiExternalId string `hcl:"nomad_csi_external_id,optional"`
CsiParams map[string]string `hcl:"nomad_csi_params,optional"`
CsiPluginId string `hcl:"nomad_csi_plugin_id"`
CsiSecrets map[string]string `hcl:"nomad_csi_secrets,optional"`
CsiVolume string `hcl:"nomad_csi_volume,optional"`
Expand Down Expand Up @@ -101,7 +102,7 @@ func (i *NomadRunnerInstaller) Install(ctx context.Context, opts *InstallOpts) e
i.Config.CsiVolumeCapacityMax,
i.Config.CsiTopologies,
i.Config.CsiSecrets,
map[string]string{},
i.Config.CsiParams,
)
if err != nil {
return fmt.Errorf("error creating Nomad persistent volume: %s", clierrors.Humanize(err))
Expand Down Expand Up @@ -281,6 +282,12 @@ func (i *NomadRunnerInstaller) InstallFlags(set *flag.Set) {
Default: nomadutil.DefaultCSIVolumeMountFS,
})

set.StringMapVar(&flag.StringMapVar{
Name: "nomad-csi-params",
Target: &i.Config.CsiParams,
Usage: "Parameters passed directly to the CSI plugin to configure the volume.",
})

set.StringMapVar(&flag.StringMapVar{
Name: "nomad-csi-topologies",
Target: &i.Config.CsiTopologies,
Expand Down
1 change: 1 addition & 0 deletions internal/serverinstall/nomad.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ func (i *NomadInstaller) InstallRunner(
CsiFS: i.config.csiFS,
CsiTopologies: i.config.csiTopologies,
CsiExternalId: i.config.csiExternalId,
CsiParams: i.config.csiParams,
CsiPluginId: i.config.csiPluginId,
CsiSecrets: i.config.csiSecrets,
CsiVolume: i.config.runnerCsiVolume,
Expand Down
1 change: 1 addition & 0 deletions website/content/commands/runner-install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ the install, the command would be:
- `-nomad-csi-volume-capacity-min=<int>` - Nomad CSI volume capacity minimum, in bytes. The default is 1073741824.
- `-nomad-csi-volume-capacity-max=<int>` - Nomad CSI volume capacity maximum, in bytes. The default is 2147483648.
- `-nomad-csi-fs=<string>` - Nomad CSI volume mount option file system. The default is xfs.
- `-nomad-csi-params=<key=value>` - Parameters passed directly to the CSI plugin to configure the volume.
- `-nomad-csi-topologies=<key=value>` - Locations from which the Nomad Volume will be accessible.
- `-nomad-csi-external-id=<string>` - The ID of the physical volume from the Nomad storage provider.
- `-nomad-csi-secrets=<key=value>` - Credentials for publishing volume for Waypoint runner.
Expand Down

0 comments on commit a368630

Please sign in to comment.