In order to access a Sandbox Environment manually, or from your test, Sandbox Endpoints should be used. Sandbox Endpoints are entities that provide an authenticated URL that points to a service within your Kubernetes cluster.
There are two different types of endpoints which correspond to different ways in which a Sandbox Environment is typically accessed.
- Fork Endpoint: When you fork a single service and want to test it through its own API, a Fork Endpoint can be created that points directly to the forked service.
- Host Endpoint: When performing end-to-end tests, or setting up full-stack previews for a backend change, a Host Endpoint can be used to point to a service different from the one that is forked.
Both endpoints automatically set the sandbox request header context on every request made through them, so they will automatically exercise the services within the sandbox as long as header propagation is implemented. Both are authenticated and require a Signadot API Key or cookie-based authentication to access.
In the below example, the fork endpoint is specified under
spec.forks.endpoints and the host endpoint under
spec.endpoints. Note that once created, all endpoint URLs will assume a similar form,
description: sandbox env to test a new route service change
# this is a fork endpoint
# it points to the forked workload directly.
- name: route-endpoint
- image: signadot/hotrod:cace2c797082481ac0238cc1310b7816980e3244
# this is a host endpoint
# it can point anywhere that is accessible from your K8s cluster.
# it will automatically set request context corresponding to this sandbox when exercised.
- name: frontend-endpoint
Endpoints API Response
Given a specification of endpoints such as above, a sandbox GET or PUT response from the Signadot API will contain a set of endpoints in json (or yaml via the cli) such as below.
- baselineUrl: https://frontend-hotrod-svc-xug66ctplxwrl---baseline.preview.staging.signadot.com
These endpoints provide two URLs. The one under the field
a baseline service, which may or may not have an associated forked workload. Requests
to this URL do not inject sandbox context propagation headers.
The URL under the field
url accesses a service which may or may not have a backing
forked workload. In any event, requests to this URL inject a sandbox context propagation
header. This url accesses a forked workload directly if the
it accesses a baseline URL with the context propagation header.
More information regarding context propagation is available here.