This repository was archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
This repository was archived by the owner on May 25, 2023. It is now read-only.
Change config key used for Cluster Bootstrap Discovery Method #173
Copy link
Copy link
Closed
Description
This currently sets the akka.discovery.method config setting to kubernetes-api or marathon-api, depending on the deployment target:
Lines 74 to 92 in a4b0a24
| private[kubernetes] def akkaClusterEnvs(modules: Set[String], namespace: Option[String], serviceResourceName: String, noOfReplicas: Int, akkaClusterBootstrapSystemName: Option[String], akkaClusterJoinExisting: Boolean): Map[String, EnvironmentVariable] = | |
| if (!modules.contains(Module.AkkaClusterBootstrapping)) | |
| Map.empty | |
| else | |
| Map( | |
| "RP_JAVA_OPTS" -> LiteralEnvironmentVariable( | |
| Seq( | |
| s"-Dakka.discovery.method=kubernetes-api", | |
| s"-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=$serviceResourceName", | |
| s"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=$noOfReplicas", | |
| akkaClusterBootstrapSystemName.fold("-Dakka.discovery.kubernetes-api.pod-label-selector=appName=%s")(systemName => s"-Dakka.discovery.kubernetes-api.pod-label-selector=actorSystemName=$systemName"), | |
| s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}") | |
| .filter(_.nonEmpty) | |
| .mkString(" ")), | |
| "RP_DYN_JAVA_OPTS" -> LiteralEnvironmentVariable( | |
| Seq( | |
| "-Dakka.discovery.kubernetes-api.pod-namespace=$RP_NAMESPACE") | |
| .filter(_.nonEmpty) | |
| .mkString(" "))) |
Lines 54 to 66 in 08addd9
| private def akkaClusterEnvs(modules: Set[String], namespace: Option[String], serviceResourceName: String, noOfReplicas: Int, akkaClusterBootstrapSystemName: Option[String], akkaClusterJoinExisting: Boolean): Map[String, String] = | |
| if (!modules.contains(Module.AkkaClusterBootstrapping)) | |
| Map.empty | |
| else | |
| Map( | |
| "RP_JAVA_OPTS" -> Seq( | |
| s"-Dakka.discovery.method=marathon-api", | |
| s"-Dakka.management.cluster.bootstrap.contact-point-discovery.effective-name=$serviceResourceName", | |
| s"-Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=$noOfReplicas", | |
| akkaClusterBootstrapSystemName.fold("-Dakka.discovery.marathon-api.app-label-query=APP_NAME==%s")(systemName => s"-Dakka.discovery.marathon-api.app-label-query=ACTOR_SYSTEM_NAME==$systemName"), | |
| s"${if (akkaClusterJoinExisting) "-Dakka.management.cluster.bootstrap.form-new-cluster=false" else ""}") | |
| .filter(_.nonEmpty) | |
| .mkString(" ")) |
These globally sets the default discovery method to an implementation that is only appropriate to use for Cluster Bootstrap and not for inter-service discovery. This will cause problems for Akka gRPC users, and in the future, all Lagom users.
This should be updated to set akka.management.cluster.bootstrap.contact-point-discovery.discovery-method instead of akka.discovery.method, as described in akka/akka-management#316.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels