Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
README.md 3.49 KiB
Newer Older
Marco Amoia's avatar
Marco Amoia committed
# Users & Roles
Marco Amoia's avatar
Marco Amoia committed

Marco Amoia's avatar
Marco Amoia committed
This document outlines the environment variables required to configure the application's connections to PostgreSQL, Redis, and other services. These variables are crucial for ensuring that the application connects properly to its backend services within a Kubernetes environment.
Marco Amoia's avatar
Marco Amoia committed
You can override this configuration changing the values.yaml

## Overview

Marco Amoia's avatar
Marco Amoia committed
The environment variables listed below are used to define the connection details and credentials for PostgreSQL, Redis, and other services. The values are templated using Helm, allowing for customization based on the namespace and other values provided in the Helm chart.
Marco Amoia's avatar
Marco Amoia committed

## Configuration Details

Marco Amoia's avatar
Marco Amoia committed
### DataSource Configuration
Marco Amoia's avatar
Marco Amoia committed

Marco Amoia's avatar
Marco Amoia committed
- `SPRING_DATASOURCE_URL`: The URL for the datasource connection.
  - Value is derived from `db.url` specified in the Helm values.
- `SPRING_DATASOURCE_USERNAME`: The username for the datasource.
  - Value is derived from `db.username` specified in the Helm values.
- `SPRING_DATASOURCE_PASSWORD`: The password for the datasource.
  - Value is derived from `db.password` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed

### Redis Configuration

- `SPRING_DATA_REDIS_HOST`: The host address for the Redis service.
Marco Amoia's avatar
Marco Amoia committed
  - Value is derived from `redis.host` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed
- `SPRING_DATA_REDIS_PORT`: The port on which Redis is running.
Marco Amoia's avatar
Marco Amoia committed
  - Value is derived from `redis.port` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed
- `SPRING_DATA_REDIS_USERNAME`: The username for connecting to Redis.
Marco Amoia's avatar
Marco Amoia committed
  - Value is derived from `redis.username` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed
- `SPRING_DATA_REDIS_PASSWORD`: The password for connecting to Redis.
Marco Amoia's avatar
Marco Amoia committed
  - Value is derived from `redis.password` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed

### Keycloak Configuration

- `KEYCLOAK_URL`: The URL for the Keycloak authentication service.
    - This value is generated using the `microservices.backend.url` Helm template and points to the `/auth` endpoint of the Keycloak service.
- `KEYCLOAK_APP_REALM`: The realm to be used for the application within Keycloak.
    - Value is derived from the `global.profile` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed
- `KEYCLOAK_MASTER_USER`: The username to be used for the master realm in keycloak.
  - Value is derived from the `keycloak.master.user` specified in the Helm values.
- `KEYCLOAK_MASTER_PASSWORD`: The password to be used for the master realm in keycloak.
  - Value is derived from the `keycloak.master.password` specified in the Helm values.
Marco Amoia's avatar
Marco Amoia committed

### Client Authority Configuration

- `CLIENT_AUTHORITY_URL`: The URL for the client authority service.
    - This value is generated using the `tls.gateway.url` Helm template.
- `CLIENT_CERTIFICATE_PASSWORD`: The password for the client certificate.
    - Value is derived from `global.keystore.password` specified in the Helm values.

## Usage

To use this `ConfigMap`, include it in your Helm chart and provide the necessary values in the `values.yaml` file. The `ConfigMap` will be generated based on the namespace and other settings you define.

Marco Amoia's avatar
Marco Amoia committed
### Example `values-common.yaml`
Marco Amoia's avatar
Marco Amoia committed

```yaml
global:
Marco Amoia's avatar
Marco Amoia committed
  profile: authority
  hostBe: participant.be.aruba-simpl.cloud
  hostTls: tls.authority.aruba-simpl.cloud
Marco Amoia's avatar
Marco Amoia committed
  keystore:
    password: "your-keystore-password"
Marco Amoia's avatar
Marco Amoia committed
```

### Example `values.yaml`

```yaml
db:
  url: "jdbc:postgresql://postgresql.{{ .Release.Namespace }}.svc.cluster.local:5432/usersroles"
  username: "usersroles"
  password: "usersroles"

redis:
  host: "redis-master.{{ .Release.Namespace }}.svc.cluster.local"
  port: "6379"
  username: "default"
  password: "admin"
Marco Amoia's avatar
Marco Amoia committed

keycloak:
  master:
    user: "user"
    password: "admin"
Marco Amoia's avatar
Marco Amoia committed
```