Skip to content

[public-api] Route api.<domain> to public api service & deployment #9363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2022
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
5 changes: 5 additions & 0 deletions components/proxy/conf/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ https://{$GITPOD_DOMAIN} {
}
}

# public-api
https://api.{$GITPOD_DOMAIN} {
reverse_proxy public-api-server.{$KUBE_NAMESPACE}.{$KUBE_DOMAIN}:9000
}

# workspaces
https://*.*.{$GITPOD_DOMAIN} {
import enable_log
Expand Down
4 changes: 4 additions & 0 deletions components/public-api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func main() {
logger.WithError(err).Fatal("Failed to initialize public api server.")
}

if err := register(srv); err != nil {
logger.WithError(err).Fatal("Failed to register services.")
}

Comment on lines +25 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change necessary to set up the routing or just overlooked in earlier PRs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overlooked from other PRs.

if listenErr := srv.ListenAndServe(); listenErr != nil {
logger.WithError(listenErr).Fatal("Failed to serve public api server")
}
Expand Down