We have a docker image and a corresponding yaml file for deployment using cubernets. The application we created is located in scala with akka-http. We used an aka cluster. We have a specific variable (seed nodes in our case - akka cluster) in the configuration file, which is used in our application code, which uses ip ip. But we won’t get the ip code if the deployment fails. How should we solve this problem? Will environment variables help, if so, how?
More specifically: After the docker images are deployed in the container in the container, and when the container starts, the ip-code is already assigned. So, can we programmatically or otherwise configure pod ips in our code or configuration file before the process starts in the container?
For reference, this is our configuration file:
akka {
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
remote {
log-remote-lifecycle-events = off
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://our-system@127.0.0.1:3000",
"akka.tcp://our-system@127.0.0.1:3001",
],
metrics {
enabled = off
}
}
}
service {
validateTokenService {
ml.pubkey.path = "<filePath>"
}
ml_repository {
url = <url address>
}
replication.factor = 3
http.service.interface = "0.0.0.0"
http.service.port = 8080
}
In the above file, instead of akka.remote.netty.tcp.hostname as "127.0.0.1", we need to have pod-ip. So, we can use it in seed nodes like:
seed-nodes = [
"akka.tcp://our-system@hostname:3000",
"akka.tcp://our-system@hostname:3001",
],
How can we do this? Thanks in advance.
source
share