Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Rename appName to app, and add akka.lightbend.com/service-name label#194

Merged
eed3si9n merged 2 commits intomasterfrom
wip/app
Feb 4, 2019
Merged

Rename appName to app, and add akka.lightbend.com/service-name label#194
eed3si9n merged 2 commits intomasterfrom
wip/app

Conversation

@eed3si9n
Copy link
Contributor

@eed3si9n eed3si9n commented Feb 1, 2019

Fixes #183
Ref akka/akka-management#411

First, appName label is renamed to a more commonly used app label, aligning with standards and Akka Management docs. This will stay since app is used in different contexts other than Akka Cluster Bootstrap, for example Service resource uses label:

  selector:
    app: "my-app"

For the purpose of Akka Cluster Bootstrap, however, a specialized label akka.lightbend.com/service-name is defined. This denotes the Akka Cluster to join when a pod comes up.

  • The value of the this label will default to either the app name or the app version name depending on the deployment type.
  • It can be overridden by user using akkaClusterBootstrapSystemName setting as described in https://developer.lightbend.com/docs/lightbend-orchestration/current/features/akka-cluster-bootstrap.html.
  • Deployment pods are labeled with "akka.lightbend.com/service-name": "friendimpl" etc
  • The label selector is overridden as -Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s (as opposed to using app=%s)
  • The effective name is overridden as -Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl etc.

/cc @lightbend/play-team

Fixes #183

For the purpose of Akka Cluster Bootstrap, a specialized label `akka.lightbend.com/service-name` defined. This denotes the Akka Cluster to join when a pod comes up.

- The value of the this label will default to either the app name or the app version name depending on the deployment type.
- It can be overridden by user using `akkaClusterBootstrapSystemName` setting as described in https://developer.lightbend.com/docs/lightbend-orchestration/current/features/akka-cluster-bootstrap.html.
- Deployment pods are labeled with `"akka.lightbend.com/service-name": "friendimpl"` etc
- The label selector is overridden as `-Dakka.discovery.kubernetes-api.pod-label-selector=akka.lightbend.com/service-name=%s` (as opposed to using `app=%s`)
- The effective name is overridden as `-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=friendimpl` etc
@eed3si9n eed3si9n requested a review from chbatey February 1, 2019 04:59
@ghost ghost assigned eed3si9n Feb 1, 2019
@ghost ghost added the review label Feb 1, 2019
@eed3si9n eed3si9n merged commit f8b48f1 into master Feb 4, 2019
@eed3si9n eed3si9n deleted the wip/app branch February 4, 2019 15:48
@ghost ghost removed the review label Feb 4, 2019
"labels" -> Json(
"appName" -> appName.asJson),
"app" -> appName.asJson),
"name" -> appName.asJson)
Copy link

Choose a reason for hiding this comment

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

Doesn't the name need to be serviceResourceName in case they differ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if the word "service" in serviceResourceName means Kubernetes Service.
I think the intended purpose is to change the name of the Deployment service so when someone changes the version of the app, it would form a new cluster by creating a fresh one.

Copy link

Choose a reason for hiding this comment

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

It's used to query the service by name, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example when a Lagom service wants to query another Lagom service via DNS?
In that case I'd say you want appName.asJson instead of serviceResourceName that can potentially be name + version.

Copy link

Choose a reason for hiding this comment

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

(In the DNS implementation I mean.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants