Endpoints and hostnames¶
Hostnames¶
Every project has one hostname per environment:
| Environment | Hostname | Access |
|---|---|---|
| development | <project>.development.test.ccc-onconnect.de |
login only, members of /apps/<project> |
| staging | <project>.staging.test.ccc-onconnect.de |
login only, members of /apps/<project> |
| production | <project>.app.ccc-onconnect.de |
public (with trait oauth2-proxy: after login) |
All hostnames have their own, automatically issued TLS certificates.
One hostname per project instead of per component is intentional: component names would require a second wildcard level in the certificate, which X.509 does not support. Several components of a project are therefore separated by paths.
Paths¶
The path an endpoint appears under is decided in this order:
- the entry in the component's
parameters.publish(endpoint,path), - otherwise the endpoint's
basePathinworkload.yaml, - otherwise a generated path:
/<component>(web-application) or/<component>-<endpoint>(service).
Example for a project shop with frontend and API:
| Component | publish |
Production |
|---|---|---|
frontend (web-application) |
{endpoint: http, path: /} |
https://shop.app.ccc-onconnect.de/ |
api (service) |
{endpoint: http, path: /api} |
https://shop.app.ccc-onconnect.de/api |
Stripping the prefix (stripPrefix)¶
- service (default
true): the API under/apisees requests without the prefix, i.e./usersinstead of/api/users. Services usually listen at the root. - web-application (default
false): the application sees the full path. If the prefix were stripped, absolute asset links (/static/…) would load against the root of the hostname and end in 404. If a web application runs under a subpath, configure that path in the application itself (e.g.basein Vite,basePathin Next.js).
In development and staging the prefix is never stripped, because the login
(oauth2-proxy) sits in front of the application there and needs the full path. An
application that relies on stripPrefix: true therefore behaves differently there
than in production — when in doubt, set the path in the application itself.
Visibility¶
visibility |
Effect |
|---|---|
project |
Reachable for other components of the project, in-cluster via dependencies.endpoints. |
internal |
Route via *.test.ccc-onconnect.de in development and staging. |
external |
Additionally a route via <project>.app.ccc-onconnect.de in production. |
Only endpoints of type HTTP, GraphQL or Websocket get routes. Public production
endpoints allow cross-origin calls without credentials (CORS *), so that e.g. the
"Try it out" console in the portal works.
Additional hostname¶
If an application should additionally be reachable under its own name in production
(e.g. docs.platform.ccc-onconnect.de), attach the trait custom-hostname to the
component:
spec:
traits:
- kind: ClusterTrait
name: custom-hostname
instanceName: platform
parameters:
hostname: docs.platform.ccc-onconnect.de
Prerequisite: the name must be in the gateway's certificate and point to the gateway
in DNS. The platform team sets up both — talk to them beforehand. Development and
staging keep their *.test. names.
If the application is protected by the trait oauth2-proxy, the login works on each
of its hostnames; for a hostname added later, the platform team has to set up the
login once more (see Login and traits).