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

Commit 603dcfa

Browse files
committed
Adjust the test to use akka-dns
1 parent 2fe7ec9 commit 603dcfa

File tree

8 files changed

+11
-35
lines changed

8 files changed

+11
-35
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ lazy val akkaClusterBootstrap = createProject("reactive-lib-akka-cluster-bootstr
124124
libraryDependencies ++= Seq(
125125
"com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % Versions.akkaManagement,
126126
"com.lightbend.akka.discovery" %% "akka-discovery-marathon-api" % Versions.akkaManagement,
127+
"com.lightbend.akka.discovery" %% "akka-discovery-dns" % Versions.akkaManagement,
127128
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % Versions.akkaManagement,
128129
"com.typesafe.akka" %% "akka-testkit" % Versions.akka % "test",
129130
"com.typesafe.akka" %% "akka-cluster" % Versions.akka % "provided"

integrateion-test/src/sbt-test/bootstrap-demo/dns-kubernetes/build.sbt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ ThisBuild / version := "0.1.5"
88
ThisBuild / organization := "com.example"
99
ThisBuild / scalaVersion := "2.12.7"
1010

11-
// This is where we wire the freshly baked reactive-lib
12-
ThisBuild / reactiveLibVersion := freshReactiveLibVersion
13-
1411
lazy val isOpenShift = {
1512
sys.props.get("test.openshift").isDefined
1613
}
@@ -30,10 +27,14 @@ lazy val root = (project in file("."))
3027
"-Xlint",
3128
"-Yno-adapted-args",
3229
),
30+
// This is where we wire the freshly baked reactive-lib
31+
reactiveLibVersion := freshReactiveLibVersion,
3332
libraryDependencies ++= Seq(
3433
akkaManagement,
3534
akkaClusterHttp,
3635
akkaCluster,
36+
akkaClusterSharding,
37+
akkaClusterTools,
3738
akkaDiscoveryDns,
3839
akkaSlj4j,
3940
logback,

integrateion-test/src/sbt-test/bootstrap-demo/dns-kubernetes/kubernetes/akka-cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
- name: "RP_ENDPOINT_AKKA_REMOTE_PORT"
9696
value: "10000"
9797
- name: "RP_JAVA_OPTS"
98-
value: "-Dconfig.resource=rp-application.conf -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=akka.discovery.akka-dns -Dakka.management.cluster.bootstrap.contact-point-discovery.service-name=bootstrap-demo-kubernetes-dns-internal -Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=2 -Dakka.discovery.kubernetes-api.pod-label-selector=actorSystemName=hoboken1"
98+
value: "-Dconfig.resource=rp-application.conf -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=akka.discovery.akka-dns -Dakka.management.cluster.bootstrap.contact-point-discovery.service-name=bootstrap-demo-kubernetes-dns-internal -Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=2"
9999
- name: "RP_KUBERNETES_POD_IP"
100100
valueFrom:
101101
fieldRef:

integrateion-test/src/sbt-test/bootstrap-demo/dns-kubernetes/kubernetes/openshift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
- name: "RP_ENDPOINT_AKKA_REMOTE_PORT"
9696
value: "10000"
9797
- name: "RP_JAVA_OPTS"
98-
value: "-Dconfig.resource=rp-application.conf -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=akka.discovery.akka-dns -Dakka.management.cluster.bootstrap.contact-point-discovery.service-name=bootstrap-demo-kubernetes-dns-internal -Dakka.management.cluster.bootstrap.contact-point-discovery.required-contact-point-nr=2 -Dakka.discovery.kubernetes-api.pod-label-selector=actorSystemName=hoboken1"
98+
value: "-Dconfig.resource=rp-application.conf -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=akka.discovery.akka-dns -Dakka.management.cluster.bootstrap.contact-point-discovery.service-name=bootstrap-demo-kubernetes-dns-internal -Dakka.management.cluster.bootstrap.contact-point-discovery.discovery-method=akka.discovery.akka-dns"
9999
- name: "RP_KUBERNETES_POD_IP"
100100
valueFrom:
101101
fieldRef:

integrateion-test/src/sbt-test/bootstrap-demo/dns-kubernetes/project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sbt._
22

33
object Dependencies {
44
val akkaVersion = "2.5.18"
5-
val akkaManagementVersion = "0.18.0" // 0.20.0
5+
val akkaManagementVersion = "0.20.0"
66
val freshReactiveLibVersion = sys.props.get("plugin.version").getOrElse {
77
sys.error("""|The system property 'plugin.version' is not defined.
88
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
akka {
22
loglevel = DEBUG
3-
4-
io.dns.resolver = async-dns
5-
6-
# actor {
7-
# provider = "cluster"
8-
# }
9-
10-
# management {
11-
# cluster.bootstrap {
12-
# contact-point-discovery {
13-
# port-name = "akka-mgmt-http"
14-
# protocol = "tcp"
15-
# service-name = "bootstrap-demo-kubernetes-dns-internal"
16-
# # Can be removed once https://github.com/akka/akka/issues/25825 is implemented
17-
# service-namespace = ${NAMESPACE}".svc.cluster.local"
18-
# }
19-
# }
20-
# }
213
}

integrateion-test/src/sbt-test/bootstrap-demo/dns-kubernetes/src/main/scala/foo/ClusterApp.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ object ClusterApp {
2222
implicit val system = ActorSystem()
2323
implicit val materializer = ActorMaterializer()
2424
implicit val executionContext = system.dispatcher
25-
val cluster = Cluster(system)
2625

26+
val cluster = Cluster(system)
2727
system.log.info("Starting Akka Management")
28-
AkkaManagement(system).start()
29-
ClusterBootstrap(system).start()
28+
// AkkaManagement(system).start()
29+
// ClusterBootstrap(system).start()
3030

3131
system.actorOf(
3232
ClusterSingletonManager.props(
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# TODO: This config should be generated at runtime as it is platform-specific, or this project needs platform-specific
2-
# configs that are included dynamically depending upon platform, perhaps via -Dconfig.resource
3-
41
akka {
52
io {
63
dns {
74
resolver = async-dns
8-
async-dns {
9-
provider-object = "com.lightbend.rp.asyncdns.AsyncDnsProvider"
10-
resolve-srv = true
11-
resolv-conf = on
12-
}
135
}
146
}
157
}

0 commit comments

Comments
 (0)