Supported versions
You can select the major and minor version. Patch versions are applied periodically for bug fixes and the like. When you deploy your app, you always get the latest available patches.Relationship reference
For each service defined via a relationship to your application, Upsun automatically generates corresponding environment variables within your application container, in the$<RELATIONSHIP-NAME>_<SERVICE-PROPERTY> format.
Here is example information available through the service environment variables themselves,
or through the PLATFORM_RELATIONSHIPS environment variable.
You can obtain the complete list of available service environment variables in your app container by running upsun ssh env.
Note that the information about the relationship can change when an app is redeployed or restarted or the relationship is changed. So your apps should only rely on the service environment variables directly rather than hard coding any values.
- `PLATFORM_RELATIONSHIPS` environment variable
For some advanced use cases, you can use the
PLATFORM_RELATIONSHIPS environment variable.
The structure of the PLATFORM_RELATIONSHIPS environment variable can be obtained by running upsun relationships in your terminal:Here is an example of how to gather PLATFORM_RELATIONSHIPS environment variable information in a .environment file:.environment
Usage example
1. Configure the service
To define the service, use thekafka type:
Note that changing the name of the service replaces it with a brand new service and all existing data is lost. Back up your data before changing the service.
2. Define the relationship
To define the relationship, use the following configuration:- Using default endpoints
- Using explicit endpoints
You can define
SERVICE_NAME as you like, so long as it’s unique between all defined services
and matches in both the application and services configuration.The example above leverages default endpoint configuration for relationships.
That is, it uses default endpoints behind the scenes, providing a relationship
(the network address a service is accessible from) that is identical to the name of that service.Depending on your needs, instead of default endpoint configuration,
you can use explicit endpoint configuration.With the above definition, the application container (APP_NAME) now has access to the service via the relationship SERVICE_NAME and its corresponding service environment variablesExample configuration
Exporting Data
Kafka stores messages in on-disk topic partitions. You can export messages using thekafka-console-consumer tool over an SSH session.
- Open an SSH session to your app container (Kafka is not directly accessible via
tunnel:single):
Terminal
- From the app container, list available topics:
Terminal
- Export all messages from a topic to a file:
Terminal
- Download the exported file:
Terminal
KAFKA_HOST, KAFKA_PORT) are available as
service environment variables
inside the app container.
Note that Kafka is designed as a streaming platform, not a primary data store.
In most architectures, the authoritative copy of your data exists elsewhere (for example in a database),
and Kafka topics can be replayed or re-populated from that source.