Files
Olares/docs/developer/develop/mw-integrate-with-redis.md

2.0 KiB

outline, description
outline description
2
3
Learn how to integrate your app with the built-in Redis service in beOS Pro.

Integrate with Redis

Use beOS Pro Redis middleware by declaring it in beOS ProManifest.yaml, then mapping the injected values to your container environment variables.

:::info Redis installed Redis service has been installed by default. :::

Configure beOS ProManifest.yaml

In beOS ProManifest.yaml, add the required Redis middleware configuration.

  • Use the password field to specify the Redis access password.
  • Use the namespace field to request a Redis namespace.

Example

middleware:
  redis:
    password: password
    namespace: db0

Map to environment variables

In your deployment YAML, map the injected .Values.redis.* fields to the container environment variables your app requires.

Example

containers:
  - name: my-app
    env:
      # Host
      - name: REDIS_HOST
        value: {{ .Values.redis.host }}

      # Port
      # Quote the value to ensure it's treated as a string
      - name: REDIS_PORT
        value: "{{ .Values.redis.port }}"

      # Password
      # Quote the value to handle special characters correctly
      - name: REDIS_PASSWORD
        value: "{{ .Values.redis.password }}"

      # Namespace
      # NOTE: Replace <namespace> with the actual namespace defined in beOS ProManifest (e.g., db0)
      - name: REDIS_NAMESPACE
        value: {{ .Values.redis.namespaces.<namespace> }}

Redis values reference

Redis values are predefined runtime values injected into values.yaml during deployment. They are system-managed and not user-editable.

Value Type Description
.Values.redis.host String Redis host.
.Values.redis.port Number Redis port.
.Values.redis.password String Redis password.
.Values.redis.namespaces Map<String,String> Requested namespaces, keyed by namespace name. For example, a request for app_ns is available at .Values.redis.namespaces.app_ns.