Skip to content

Commit 8d6ce66

Browse files
committed
Use smaller instance with Debian for DigitalOcean
The Ubuntu 22.04 image was very slow to boot taking up to 2 minutes to run DO's own setup/scripts/agents, etc. Debian Trixie with a smaller instance seems to work. We can move back to a larger instance if availability gets limited in the future. I think this was the historic reason why we used the 1gb instance. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent d9b4d73 commit 8d6ce66

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

controller.go

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ func NewController(
131131
newTunnel := new.(*inletsv1alpha1.Tunnel)
132132
oldTunnel := old.(*inletsv1alpha1.Tunnel)
133133
if newTunnel.ResourceVersion == oldTunnel.ResourceVersion {
134-
// Periodic resync with no changes - only re-queue if
135-
// still provisioning, since the resync loop polls the
136-
// cloud provider for the host to become active.
137-
if newTunnel.Status.HostStatus == provision.ActiveStatus {
134+
// Periodic resync with no changes - only skip if the
135+
// tunnel is fully provisioned: host is active and the
136+
// client deployment has been created.
137+
if newTunnel.Status.HostStatus == provision.ActiveStatus &&
138+
newTunnel.Status.ClientDeploymentRef != nil &&
139+
newTunnel.Status.ClientDeploymentRef.Name != "" {
138140
return
139141
}
140142
}
@@ -770,8 +772,8 @@ func getHostConfig(c *Controller, tunnel *inletsv1alpha1.Tunnel, service *corev1
770772
case "digitalocean":
771773
host = provision.BasicHost{
772774
Name: tunnel.Name,
773-
OS: "ubuntu-22-04-x64",
774-
Plan: "s-1vcpu-1gb",
775+
OS: "debian-13-x64",
776+
Plan: "s-1vcpu-512mb-10gb",
775777
Region: c.infraConfig.Region,
776778
UserData: userData,
777779
Additional: map[string]string{},
@@ -1087,17 +1089,18 @@ func (c *Controller) updateService(tunnel *inletsv1alpha1.Tunnel, ip string) err
10871089

10881090
// Update Spec.ExternalIPs
10891091
copy := res.DeepCopy()
1090-
if ip == "" {
1091-
ips := []string{}
1092-
for _, v := range copy.Spec.ExternalIPs {
1093-
if v != tunnel.Status.HostIP {
1094-
ips = append(ips, v)
1095-
}
1092+
// Remove any IPs previously set by this tunnel, preserving
1093+
// IPs assigned by other sources (e.g. svclb/klipper).
1094+
filtered := []string{}
1095+
for _, v := range copy.Spec.ExternalIPs {
1096+
if v != tunnel.Status.HostIP {
1097+
filtered = append(filtered, v)
10961098
}
1097-
copy.Spec.ExternalIPs = ips
1098-
} else {
1099-
copy.Spec.ExternalIPs = append(copy.Spec.ExternalIPs, ip)
11001099
}
1100+
if ip != "" {
1101+
filtered = append(filtered, ip)
1102+
}
1103+
copy.Spec.ExternalIPs = filtered
11011104

11021105
res, err = c.kubeclientset.CoreV1().
11031106
Services(tunnel.Namespace).

0 commit comments

Comments
 (0)