Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Edit `charts/plugin-hub/values.yaml` (or pass `--set` flags):
| `service.port` | Service port | `8080` |
| `plugin.displayName` | Display name in the UI | `Plugin Hub` |
| `plugin.enabled` | Enable/disable the plugin | `true` |
| `everestAPIURL` | OpenEverest API server URL (in-cluster autodiscovered when empty) | `""` |
| `everestAPIURL` | OpenEverest API server URL (defaults to in-cluster DNS `everest.everest-system.svc.cluster.local:8080` when empty) | `""` |
| `hubIndexURL` | Override the catalog index URL | official hub when empty |
| `cacheTTLSeconds` | Catalog cache TTL (seconds) | `300` when empty |

Expand Down
14 changes: 9 additions & 5 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ func everestAPIURL() string {
if v := os.Getenv("EVEREST_API_URL"); v != "" {
return strings.TrimRight(v, "/")
}
host := os.Getenv("EVEREST_SERVICE_HOST")
port := os.Getenv("EVEREST_SERVICE_PORT")
if host != "" && port != "" {
return fmt.Sprintf("http://%s:%s", host, port)
}
// NOTE: we deliberately do NOT consult the Kubernetes-injected
// EVEREST_SERVICE_HOST / EVEREST_SERVICE_PORT env vars. Those are a
// point-in-time snapshot of the everest Service's ClusterIP taken by
// kubelet when this pod started and are never refreshed. If the everest
// Service is deleted and recreated (e.g. during a redeploy) it gets a new
// ClusterIP, the snapshot goes stale, and every request dials a dead IP
// until this pod is restarted. The stable in-cluster DNS name always
// resolves to the live ClusterIP, so we rely on it (overridable via
// EVEREST_API_URL for non-standard deployments).
return defaultEverestService
}

Expand Down
7 changes: 4 additions & 3 deletions charts/plugin-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ plugin:
icon: "/icon.png"

# Optional override for the Everest API URL. When left empty the backend
# auto-discovers the everest Service via Kubernetes-injected env vars
# (EVEREST_SERVICE_HOST / EVEREST_SERVICE_PORT). Only set this for local dev
# or non-standard deployments.
# targets the stable in-cluster DNS name
# (http://everest.everest-system.svc.cluster.local:8080), which always
# resolves to the live ClusterIP. Only set this for local dev or when everest
# runs under a non-standard name/namespace.
everestAPIURL: ""

# Override the catalog index URL. Defaults to the official OpenEverest hub.
Expand Down
Loading
Loading