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

Server install: Nomad service discovery #3500

Merged
merged 12 commits into from
Aug 5, 2022

Conversation

paladin-devops
Copy link
Contributor

@paladin-devops paladin-devops commented Jun 27, 2022

This PR updates the server installation for Nomad to support service discovery for Nomad or Consul by specifying the service discovery provider as a flag for the waypoint install command.

Closes #3376.

NOTE: The old config, -nomad-consul-service, is still supported with this PR update, but it should be phased out eventually. The new -nomad-service-provider config supports pre- and post-1.3.0 Waypoint installs to Nomad.

Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tried the full install path for these yet, but I have a few minor code comments! Changes make sense to me otherwise 👍🏻

Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Looks good to me code wise 👍🏻

@@ -286,19 +255,18 @@ func (i *NomadInstaller) Install(
s.Update("Waypoint server ready")
s.Done()

if i.config.consulService {
s = sg.Add("The CLI has been configured to automatically install a Consul service for\n" +
if i.config.serviceProvider == "consul" && i.config.consulService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall from a code review meeting that this was supposed to be an "or" instead of an "and"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiaolin-ninja since the default values are "consul" and true for serviceProvider and consulService, respectively, we want this to be "and" because if the user sets something other than "consul" for serviceProvider, or sets consulService to false, we then do not want to create the job with a Consul service.

Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not merge this until a patch for #3601 is merged and released

@briancain
Copy link
Member

You might need to rebase off main to get the integration tests to pass, btw!

@paladin-devops
Copy link
Contributor Author

@briancain so rebased! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/0.9.x Automerge PR into release/0.9.x branch after merge to main core website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nomad 1.3.0: Node excluded because "${attr.consul.version} semver >= 1.7.0"
7 participants