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

Issue 519: Support multiple YamlConfigurationSercvices #521

Merged

Conversation

mikkokar
Copy link
Contributor

@mikkokar mikkokar commented Nov 7, 2019

Summary

Fixes: #519

Provides equivalent functionality to BackendServiceProxy when using YamlConfigurationFileService to configure styx from origins file.

  • Add a new ingressObject attribute to YamlConfigurationFileService. It names the routing object serving as an entry point for backend services sourced from the yaml configuration service. In practice it is the ingress object is a PathPrefixRouter.

  • When ingressObject is absent, the name is derived from YamlConfigurationFileService provider name as follows <name>-router.

  • Rename source tag for generated routing objects. The source tag now specifies the provider object name instead of its type.

  • Rename generated health check services. The names now have -monitor postfix. For example if the provider name is foo then the health check provider name will be foo-monitor.

Configuration Example

providers:
  zone1:
    type: YamlFileConfigurationService
    config:
      ingressObject: zone1Router
      originsFile: "/styx/config/origins/zone1.yaml"
  fallbackOriginsProvider:
    type: YamlFileConfigurationService
    config:
      ingressObject: fallbackRouter
      originsFile: "/styx/config/origins/zone2.yaml"
  zone3:
    type: YamlFileConfigurationService
    config:
      originsFile: "/styx/config/origins/zone3.yaml"


httpPipeline:
  type: ConditionRouter
  config:
    routes:
      - condition: header("abc") == "true"
        destination: zone1Router
      - condition: header("def") == "true"
        destination: zone3-router
    fallback: fallbackRouter

Copy link
Contributor

@chrisgresty chrisgresty left a comment

Choose a reason for hiding this comment

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

Just a minor comment.
I would also say that the name handling is not always clear in general in the code, but I'm not sure what to do about that..

@@ -110,18 +108,17 @@ internal class OriginsConfigConverter(

val serviceConfig = MAPPER.readTree(str)

val providerObject = Builtins.build(StyxObjectDefinition(appId, HEALTH_CHECK_MONITOR, serviceConfig),
val providerObject = Builtins.build("providerName", StyxObjectDefinition(appId, HEALTH_CHECK_MONITOR, serviceConfig),
Copy link
Contributor

Choose a reason for hiding this comment

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

This name parameter is ignored by the HC factory - perhaps make it clearer that the value here is not significant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting this. I have refactored so that a correct name is always passed in. Even if .build() ignores it.

@mikkokar
Copy link
Contributor Author

mikkokar commented Nov 7, 2019

Just a minor comment.
I would also say that the name handling is not always clear in general in the code, but I'm not sure what to do about that..

I tend to agree this can be improved. As always, I'm open for constructive feedback :-)

@mikkokar mikkokar changed the title Issue 519: Provide BackendServiceProxy functionality Issue 519: Support multiple YamlConfigurationSercvices Nov 7, 2019
@mikkokar mikkokar merged commit 004472c into ExpediaGroup:master Nov 7, 2019
@mikkokar mikkokar deleted the issue-519-backend-service-proxy branch November 7, 2019 12:36
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.

Add support for BackendServiceProxy routing object
3 participants