-
Notifications
You must be signed in to change notification settings - Fork 327
plugin/nomad: Persistence when installing Waypoint on Nomad #2282
Conversation
b19e03c
to
b3e7f2d
Compare
71a2c3a
to
94b735f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Left a few requests, will test after but overall looks great! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple minor things and then you're there!
internal/serverinstall/nomad.go
Outdated
var ( | ||
// bytes | ||
defaultCSIVolumeCapacityMin = int64(1073741824) | ||
defaultCSIVolumeCapacityMax = int64(2147483648) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably be const
at the file level, since it looks like they're establishing our expected defaults, and we generally put our expected defaults as consts at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooh, yeah I didn't make them global because I thought they weren't used outside this method, but this just reminded me I forgot to put them as defaults in the flags
internal/serverinstall/nomad.go
Outdated
}, | ||
}, | ||
MountOptions: &api.CSIMountOptions{ | ||
FSType: "xfs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be configurable?
3ce6ac4
to
ec02cac
Compare
internal/serverinstall/nomad.go
Outdated
waypointUserID := 100 | ||
waypointGroupID := 1000 | ||
preTask.Config = map[string]interface{}{ | ||
// TODO(xx): pin busybox image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about this, I think this might be one of those rare cases where it's better not to pin. It seems unlikely that this chown command wouldn't work in any past or future version of busybox, and we're unlikely to remember to update the tag on a regular basis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense! If pulling latest
becomes an issue down the road we can always add another flag to pin this specific image, but defaulting to pull latest for now seems fine 👍🏻
internal/serverinstall/nomad.go
Outdated
@@ -3,6 +3,8 @@ package serverinstall | |||
import ( | |||
"context" | |||
"fmt" | |||
"google.golang.org/grpc/codes" | |||
"google.golang.org/grpc/status" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put these in the middle import chunk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Persistence when installing waypoint on nomad
This began as a feature request from #1348.
This should also resolve #2173.
Persistence with host volume is fully tested and functional.
Persistence with CSI volume only works with a static IP.
To-dos:
[X] resolve issue of Nomad not connecting to the public IP of the EC2 Instance.
[ X] documentation update: https://github.com/hashicorp/learn/pull/3967