Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Connect Upstream stanza doesn't match service definition in consul #10057

Closed
Ilhicas opened this issue Feb 22, 2021 · 9 comments
Closed

Comments

@Ilhicas
Copy link
Contributor

Ilhicas commented Feb 22, 2021

Nomad version

Nomad v1.0.3 (08741d9)

Consul Agent Version

consul.version | 1.9.3
consul.revision | f55da9306

Operating system and Environment details

Amazon EC2 Linux

Issue

Declaring a service stanza in nomad with consul service struct attribute for local_bind_address results in declaring an unknown attribute.

Reproduction steps

Set consul service definition as

This is a consul definition, not to be confused by Service Stanza in Nomad

services {
  name = "client"
  port = 8080

  connect {
    sidecar_service {
      proxy {
        upstreams {
          destination_name   = "echo"
          local_bind_address = "127.0.0.2"
          local_bind_port    = 9191
        }
      }
    }
  }
}

services {
  name = "echo"
  port = 9090

  connect {
    sidecar_service {}
  }
}

All is correctly configured in consul side

Job file (if appropriate)

Set the following in nomad service stanza and will result in attribute not found

...
service {
  name = "client"
  port = 8080

  connect {
    sidecar_service {
      proxy {
        upstreams {
          destination_name   = "echo"
          local_bind_address = "127.0.0.2"
          local_bind_port    = 9191
        }
      }
    }
  }
}
... omitted for brevity

Nomad Client logs (if appropriate)

Unsupported argument; An argument named "local_bind_address" is not expected here.
@tgross
Copy link
Member

tgross commented Feb 22, 2021

Hi @Ilhicas! If I look at the upstreams documentation, I don't see local_bind_address in the listed configuration options. So that validation is working as expected.

Also, it's not super clear to me what the difference you're intending to show between those two jobspecs... but the first one has services rather than the valid service, so I'd expect the first one to fail validation as well.

@Ilhicas
Copy link
Contributor Author

Ilhicas commented Feb 22, 2021

Hi @Ilhicas! If I look at the upstreams documentation, I don't see local_bind_address in the listed configuration options. So that validation is working as expected.

Also, it's not super clear to me what the difference you're intending to show between those two jobspecs... but the first one has services rather than the valid service, so I'd expect the first one to fail validation as well.

Hello @tgross , what I'm saying is that consul services declaration is not matched by the one in Nomad service stanza.

From consul docs: https://www.consul.io/api-docs/agent/service

Proxy.Upstreams.LocalBindAddress

@tgross
Copy link
Member

tgross commented Feb 22, 2021

Yup, it's not yet supported. See #6248. Going to close this issue as a dupe, but if you give a 👍 reaction on that issue it'll help surface it for roadmapping.

@Ilhicas
Copy link
Contributor Author

Ilhicas commented Feb 22, 2021

Yup I've seen that issue before 👍
Assumed it was stale

@tgross do you know if there are any plans to support it?
I can try to make a pull request for it as I'm currently in need of that feature, and would probably help other people in the way.

Do you see any reason for it not being supported as of yet? Something I might be missing and why it wasn't implemented yet.

I'm assuming that pr would be a lot similar to this:
#9472

@tgross
Copy link
Member

tgross commented Feb 22, 2021

Do you see any reason for it not being supported as of yet? Something I might be missing and why it wasn't implemented yet.

Just time and resources for the team. I'd be happy to review your PR if you're interested!

@paladin-devops
Copy link

I'm experiencing a similar issue and would really love this feature.

connect { sidecar_service { proxy { upstreams { destination_name = "prometheus-${job_env}" local_bind_port = 9090 local_bind_address = "prometheus-${job_env}.service.consul" } } } }

Deployment output:

» Deploying...
! Unexpected response code: 400 (input.hcl:68,15-33: Unsupported argument; An
argument named "local_bind_address" is not expected here.)

@Ilhicas
Copy link
Contributor Author

Ilhicas commented Jun 9, 2021

Hi @paladin-devops this feature was added to 1.1.0 check the related issue that was merged.

@paladin-devops
Copy link

Thanks @Ilhicas , I looked at your PR and then only after the fact saw that it was already included in the 1.1.0 release (and then, moments later, 1.1.1 dropped earlier today :) ). Appreciate the contribution!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants