Deployment
Kubernetes
PostgreSQL
We recommend running PostgreSQL as a cloud service such as Google Cloud SQL, Amazon RDS for PostgreSQL or Microsoft Azure PostgreSQL, and not running it in the same Kubernetes cluster as the other applications in case of node failures.
All-in-one
The entire distribution service platform can be deployed in a Kubernetes cluster with only a few commands. We provide a yaml deployment files that you can use as a base for your own deployment. Some configurations are better stored as configmaps or secrets. The script will create 2 replicas of every deployment and attempt to spread them across different nodes in the cluster.
Example
---
apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: t1c-backendconfig
spec:
timeoutSec: 300
connectionDraining:
drainingTimeoutSec: 60
---ConfigMaps
The DS keystores can be stored as configmaps in the cluster, and be mounted as volumes in the pod containers. We require a Java keystore (jks) file to configure the IDP, and a PKCS12 keystore (p12) for the DS API. The contents of both keystores must be identical.
Secrets
Sensitive information such as usernames, passwords, and related data should be stored as secrets. Using Kustomize you can create secrets from string literals which can be set as environment variables in your deployment specs.
GKE Guide
Database
Create a PostgreSQL 12 database instance

When creating the database instance, configure the connectivity and backups option according to your need. The database instance must be reachable from the K8s cluster.
Create the necessary databases:
t1c-ds
keycloak
kong

Create Kubernetes Cluster
Ubuntu 18.04
PostgreSQL
1) Add PostgreSQL repository:
2) Install PostgreSQL:
3) Configure PostgreSQL. The PostgreSQL server should be reachable from the DS API, Kong Gateway and Keycloak application server(s). We refer you to the documentation: https://www.postgresql.org/docs/12/
4) Create the users and the 3 databases (t1c-ds, kong, keycloak):
Distribution Service API
1) Obtain the Distribution Service API server distributable. If you wish to build a package from source, run sbt ";clean;compile;dist" from the project root. A zip archive containing the application will be available under the target/universal folder
2) Install Java:
3) Unzip to a folder of your choice. We recommend using a subdirectory of the /opt folder.
4) Configure the Distribution Service API. See Configuration for a detailed description of the available options.
5) Create a service. We recommend using systemctl. Create a file in the /etc/systemd/system/ folder called t1cds.service and configure it as follows:
We strongly recommend placing sensitive information in the service definition as environment variables. See Configuration to get a list of configuration keys.
6) Enable and start the service
Kong Gateway
We refer you to the Kong installation guides for the platform of your choice:
The Kong gateway should be configured to run in database mode, and the Admin API must be available on a port accessible only by the DS API.
Keycloak
We refer you to the Keycloak Installation documentation.
Docker Compose
For development and testing purposes we offer a Docker Compose image to run the platform easily. Note that you must have access to the Trust1Team Docker container registry, or import the DS API image in yours.
After executing docker-compose up, you must still bootstrap the gateway and configure the IDP keystore
Example
You can run the docker in detached mode via the command
Last updated
Was this helpful?