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

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

This `ConfigMap` is used to configure a Kubernetes application with connection details for PostgreSQL, Redis, Keycloak, and other services. The `ConfigMap` is templated using Helm, allowing customization based on the values provided in the Helm chart.
You can override this configuration changing the values.yaml

## Overview

The `ConfigMap` stores connection details and credentials for the application's database and other services. These configurations are crucial for the application to connect to the necessary back-end services within a Kubernetes environment.

## Configuration Details

### Database Configuration

- **PostgreSQL**
    - `SPRING_DATASOURCE_URL`: The JDBC URL for connecting to the PostgreSQL database.
        - Format: `jdbc:postgresql://postgresql.<namespace>.svc.cluster.local:5432/usersroles`
    - `SPRING_DATASOURCE_USERNAME`: The username for the PostgreSQL database.
    - `SPRING_DATASOURCE_PASSWORD`: The password for the PostgreSQL database.


### Redis Configuration

- `SPRING_DATA_REDIS_HOST`: The host address for the Redis service.
    - Format: `redis-master.<namespace>.svc.cluster.local`
- `SPRING_DATA_REDIS_PORT`: The port on which Redis is running.
    - Default value: `6379`
- `SPRING_DATA_REDIS_USERNAME`: The username for connecting to Redis.
- `SPRING_DATA_REDIS_PASSWORD`: The password for connecting to Redis.

### 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.

### 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.

### Example `values.yaml`

```yaml
global:
  profile: development
  keystore:
    password: "your-keystore-password"