port-allocator: allocates ports on preconfigured ingress-nginx
Replacement of /core/installer/tcp-udp-transport
Change-Id: I3d116b0f4508b462398f69e980ad55771dc88b7c
diff --git a/core/installer/tasks/dns.go b/core/installer/tasks/dns.go
index e115b2c..13c4b58 100644
--- a/core/installer/tasks/dns.go
+++ b/core/installer/tasks/dns.go
@@ -120,6 +120,8 @@
expected []net.IP,
) Task {
t := newLeafTask("Wait to propagate", func() error {
+ time.Sleep(2 * time.Minute)
+ return nil
ctx := context.TODO()
gotExpectedIPs := func(actual []net.IP) bool {
for _, a := range actual {
diff --git a/core/installer/tasks/infra.go b/core/installer/tasks/infra.go
index 39a1cd5..914307c 100644
--- a/core/installer/tasks/infra.go
+++ b/core/installer/tasks/infra.go
@@ -90,7 +90,7 @@
interval: 1m0s
url: https://github.com/giolekva/pcloud
ref:
- branch: main
+ branch: ingress-port-allocator
`, env.Name)
if err != nil {
return err
@@ -190,6 +190,17 @@
}
}
{
+ keys, err := installer.NewSSHKeyPair("port-allocator")
+ if err != nil {
+ return err
+ }
+ user := fmt.Sprintf("%s-port-allocator", env.Name)
+ if err := st.ssClient.AddUser(user, keys.AuthorizedKey()); err != nil {
+ return err
+ }
+ if err := st.ssClient.AddReadWriteCollaborator("config", user); err != nil {
+ return err
+ }
app, err := st.appsRepo.Find("private-network")
if err != nil {
return err
@@ -200,6 +211,7 @@
"username": "private-network-proxy",
"ipSubnet": fmt.Sprintf("%s/24", startIP.String()),
},
+ "sshPrivateKey": string(keys.RawPrivateKey()),
}); err != nil {
return err
}