creamy-forest-42826
09/17/2020, 11:54 AMpulumi.all(...).apply(...)
for (let i = 0; i < args.containerConf.replicas; i++) {
const service = new k8s.core.v1.Service(
`zooservice-${i}`,
{
metadata: {
name: `zooservice-${i}`,
labels: {
app: ZookeeperApp,
},
},
spec: {
ports: [
{ port: 2181, name: "client" },
{ port: 2888, name: "server" },
{ port: 3888, name: "leader-election" },
],
},
},
{
parent: this,
}
);
this.zkServices.push(service);
}
const inputIPs = this.getZookeeperServicesIPs();
pulumi.all(inputIPs).apply((servicesIPs) => {
servicesIPs.forEach((ip) => {
console.log(ip);
});
for (let i = 0; i < args.containerConf.replicas; i++) {
const zookeeper = new Zookeeper(
`zookeeper-${i}`,
{
containerConf: args.containerConf,
imagePullSecrets: args.imagePullSecrets,
serviceIPs: servicesIPs,
},
{
parent: this,
}
);
this.zookeepers.push(zookeeper);
}
});
PS: I cannot use DNS names.type: "ClusterIP",
clusterIP: serverIp,
[Solved]