Skip to content

Commit

Permalink
fix: Migrate to kubernetes svc DNS names from the deprecated pod DNS …
Browse files Browse the repository at this point in the history
…names

Naive search replace to see what breaks in CI
  • Loading branch information
johanandren committed Dec 18, 2023
1 parent 6a49c2c commit 94c8c15
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ abstract class JoinDeciderSpec extends AbstractBootstrapSpec {
""")

val contactA = ResolvedTarget(
host = "10-0-0-2.default.pod.cluster.local",
host = "10-0-0-2.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("10.0.0.2")))

val contactB = ResolvedTarget(
host = "10-0-0-3.default.pod.cluster.local",
host = "10-0-0-3.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("10.0.0.3")))

val contactC = ResolvedTarget(
host = "10-0-0-4.default.pod.cluster.local",
host = "10-0-0-4.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("10.0.0.4")))

Expand Down Expand Up @@ -306,17 +306,17 @@ class SelfAwareJoinDeciderIPv6Spec extends JoinDeciderSpec {
val settings = ClusterBootstrapSettings(system.settings.config, NoLogging)

val contactIPv6A = ResolvedTarget(
host = "240b-c0e0-202-5e2b-b424-2-0-450.default.pod.cluster.local",
host = "240b-c0e0-202-5e2b-b424-2-0-450.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("240b:c0e0:202:5e2b:b424:2:0:450")))

val contactIPv6B = ResolvedTarget(
host = "240b-c0e0-202-5e2b-b424-2-0-cc4.default.pod.cluster.local",
host = "240b-c0e0-202-5e2b-b424-2-0-cc4.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("240b:c0e0:202:5e2b:b424:2:0:cc4")))

val contactIPv6C = ResolvedTarget(
host = "240b-c0e0-202-5e2b-b424-2-0-cc5.default.pod.cluster.local",
host = "240b-c0e0-202-5e2b-b424-2-0-cc5.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("240b:c0e0:202:5e2b:b424:2:0:cc5")))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object KubernetesApiServiceDiscovery {
} yield Some(port.containerPort)
}
} yield {
val hostOrIp = if (rawIp) ip else s"${ip.replace('.', '-')}.$podNamespace.pod.$podDomain"
val hostOrIp = if (rawIp) ip else s"${ip.replace('.', '-')}.$podNamespace.svc.$podDomain"
ResolvedTarget(
host = hostOrIp,
port = maybePort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class KubernetesApiServiceDiscoverySpec extends AnyWordSpec with Matchers {

KubernetesApiServiceDiscovery.targets(podList, Some("management"), "default", "cluster.local", false, None) shouldBe List(
ResolvedTarget(
host = "172-17-0-4.default.pod.cluster.local",
host = "172-17-0-4.default.svc.cluster.local",
port = Some(10001),
address = Some(InetAddress.getByName("172.17.0.4"))
))
Expand Down Expand Up @@ -112,17 +112,17 @@ class KubernetesApiServiceDiscoverySpec extends AnyWordSpec with Matchers {

KubernetesApiServiceDiscovery.targets(podList, None, "default", "cluster.local", false, None) shouldBe List(
ResolvedTarget(
host = "172-17-0-4.default.pod.cluster.local",
host = "172-17-0-4.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("172.17.0.4"))
),
ResolvedTarget(
host = "172-17-0-5.default.pod.cluster.local",
host = "172-17-0-5.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("172.17.0.5"))
),
ResolvedTarget(
host = "172-17-0-6.default.pod.cluster.local",
host = "172-17-0-6.default.svc.cluster.local",
port = None,
address = Some(InetAddress.getByName("172.17.0.6"))
)
Expand Down Expand Up @@ -170,7 +170,7 @@ class KubernetesApiServiceDiscoverySpec extends AnyWordSpec with Matchers {
false,
Some("user-function")) shouldBe List(
ResolvedTarget(
"10-8-7-9.b58dbc88-3651-4fb4-8408-60c375592d1d.pod.cluster.local",
"10-8-7-9.b58dbc88-3651-4fb4-8408-60c375592d1d.svc.cluster.local",
None,
Some(InetAddress.getByName("10.8.7.9")))
)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/kubernetes-deployment/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ make the logs quieter, but for now it will help us to understand what is happeni
[INFO] [akka.management.cluster.bootstrap.internal.BootstrapCoordinator] [] [Appka-akka.actor.default-dispatcher-3] - Looking up [Lookup(appka,None,Some(tcp))] MDC: {akkaAddress=akka://[email protected]:25520, sourceThread=Appka-akka.actor.default-dispatcher-13, akkaSource=akka://Appka/system/bootstrapCoordinator, sourceActorSystem=Appka, akkaTimestamp=10:04:53.844UTC}
[INFO] [akka.discovery.kubernetes.KubernetesApiServiceDiscovery] [] [Appka-akka.actor.default-dispatcher-3] - Querying for pods with label selector: [app=appka]. Namespace: [appka-1]. Port: [None] MDC: {akkaAddress=akka://[email protected]:25520, sourceThread=Appka-akka.actor.default-dispatcher-13, akkaSource=KubernetesApiServiceDiscovery(akka://Appka), sourceActorSystem=Appka, akkaTimestamp=10:04:53.844UTC}
5 [INFO] [akka.management.cluster.bootstrap.internal.BootstrapCoordinator] [akkaBootstrapResolved] [Appka-akka.actor.default-dispatcher-3] - Located service members based on: [Lookup(appka,None,Some(tcp))]: [ResolvedTarget(172-17-0-6.appka-1.pod.cluster.local,None,Some(/172.17.0.6)), ResolvedTarget(172-17-0-7.appka-1.pod.cluster.local,None,Some(/172.17.0.7)), ResolvedTarget(172-17-0-5.appka-1.pod.cluster.local,None,Some(/172.17.0.5))], filtered to [172-17-0-5.appka-1.pod.cluster.local:0, 172-17-0-6.appka-1.pod.cluster.local:0, 172-17-0-7.appka-1.pod.cluster.local:0] MDC: {akkaAddress=akka://[email protected]:25520, akkaContactPoints=172-17-0-5.appka-1.pod.cluster.local:0, 172-17-0-6.appka-1.pod.cluster.local:0, 172-17-0-7.appka-1.pod.cluster.local:0, sourceThread=Appka-akka.actor.default-dispatcher-13, akkaSource=akka://Appka/system/bootstrapCoordinator, sourceActorSystem=Appka, akkaTimestamp=10:04:54.919UTC}
5 [INFO] [akka.management.cluster.bootstrap.internal.BootstrapCoordinator] [akkaBootstrapResolved] [Appka-akka.actor.default-dispatcher-3] - Located service members based on: [Lookup(appka,None,Some(tcp))]: [ResolvedTarget(172-17-0-6.appka-1.svc.cluster.local,None,Some(/172.17.0.6)), ResolvedTarget(172-17-0-7.appka-1.svc.cluster.local,None,Some(/172.17.0.7)), ResolvedTarget(172-17-0-5.appka-1.svc.cluster.local,None,Some(/172.17.0.5))], filtered to [172-17-0-5.appka-1.svc.cluster.local:0, 172-17-0-6.appka-1.svc.cluster.local:0, 172-17-0-7.appka-1.svc.cluster.local:0] MDC: {akkaAddress=akka://[email protected]:25520, akkaContactPoints=172-17-0-5.appka-1.svc.cluster.local:0, 172-17-0-6.appka-1.svc.cluster.local:0, 172-17-0-7.appka-1.svc.cluster.local:0, sourceThread=Appka-akka.actor.default-dispatcher-13, akkaSource=akka://Appka/system/bootstrapCoordinator, sourceActorSystem=Appka, akkaTimestamp=10:04:54.919UTC}
6 [INFO] [akka.management.cluster.bootstrap.internal.BootstrapCoordinator] [akkaBootstrapSeedNodes] [Appka-akka.actor.default-dispatcher-20] - Contact point [akka://[email protected]:25520] returned [1] seed-nodes [akka://[email protected]:25520] MDC: {akkaAddress=akka://[email protected]:25520, sourceThread=Appka-akka.actor.default-dispatcher-11, akkaSource=akka://Appka/system/bootstrapCoordinator, sourceActorSystem=Appka, akkaTimestamp=10:05:01.306UTC, akkaSeedNodes=akka://[email protected]:25520}
[INFO] [akka.management.cluster.bootstrap.internal.BootstrapCoordinator] [akkaBootstrapJoin] [Appka-akka.actor.default-dispatcher-20] - Joining [akka://[email protected]:25520] to existing cluster [akka://[email protected]:25520] MDC: {akkaAddress=akka://[email protected]:25520, sourceThread=Appka-akka.actor.default-dispatcher-11, akkaSource=akka://Appka/system/bootstrapCoordinator, sourceActorSystem=Appka, akkaTimestamp=10:05:01.309UTC, akkaSeedNodes=akka://[email protected]:25520}
Expand Down

0 comments on commit 94c8c15

Please sign in to comment.