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

All creation of metadata and tags from k8s annotations #141

Merged
merged 5 commits into from
Oct 4, 2019

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Sep 26, 2019

Adding one commit to #135 that:

  • added more tests and expanded existing tests to check the template more fully
  • added back support for the old tags annotation but marked as deprecated
  • fixed bug where the -default-protocol flag wasn't being used
  • cleaned up whitespace in rendered init container script

Original PR description:

This PR is a roll up of previous PRs as I found a bug. The original code was not setting the tags and service metadata for the proxy. While the tests were passing for this as the test only searches for the existence of tags in the command. Since this data was present on the service config the test passed however for Consul L7 config tags and metadata need to be present on the proxy.

Content:
Add annotation to allow the configuration of service tags in Consul

consul.hashicorp.com/service-tags, value is a comma separated string of tags to add to the service

  annotations:
    "consul.hashicorp.com/connect-inject": "true"
    "consul.hashicorp.com/service-tags": "v1, k8s"

Add annotation to allow the configuration of service metadata in Consul service catalog

consul.hashicorp.com/service-meta- individual annotations are specified with the metadata key in the annotation name. Key is the name of the metadata key to store in the Consul service catalog. Value of the annotation is the value set against the metadata.

  annotations:
    "consul.hashicorp.com/connect-inject": "true"
    "consul.hashicorp.com/service-meta-version": "1"
    "consul.hashicorp.com/service-meta-foo": "bar"

A test docker container for this branch can be found at nicholasjackson/consul-k8s-dev:beta

Fixes #112

@lkysow
Copy link
Member Author

lkysow commented Sep 26, 2019

@nicholasjackson I've taken #135 and

  • added more tests and expanded existing tests to check the template more fully
  • added back support for the old tags annotation but marked as deprecated
  • fixed bug where the -default-protocol flag wasn't being used
  • cleaned up whitespace in rendered init container script

Please review. @ishustava can you review as well please.

Copy link
Contributor

@nicholasjackson nicholasjackson 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, the connect-service-tags attribute never actually made it into the docs. But, I think good to have the depreciation just in case.

Copy link
Contributor

@ishustava ishustava 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.

nicholasjackson and others added 5 commits October 4, 2019 14:41
…ired for service-resolver. Note: tests were passing as this data is set on the service
- add back support for the old tags annotation but mark as deprecated
- add tests that check more of the template rendering
- fix bug where the -default-protocol flag wasn't being used
- clean up whitespace in rendered init container script
@lkysow lkysow merged commit c921ac3 into master Oct 4, 2019
@lkysow lkysow deleted the service-annotations branch October 4, 2019 22:07
@ishustava ishustava mentioned this pull request Mar 24, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catalog sync fails to sync annotations
3 participants