Materialized Views on Kubernetes

Configure and access Materialized Views deployed with Cloudera Streaming Analytics Operator for Kubernetes.

You can configure and create Materialized Views to maintain mutating snapshots of queried data. Materialized View data is stored in an internal PostgreSQL database managed by Cloudera Streaming Analytics Operator for Kubernetes.

The Materialized View engine on Kubernetes is deployed, configured, and managed through Helm.

Architecture

When you install Cloudera Streaming Analytics Operator for Kubernetes, a PostgreSQL database is automatically provisioned to store Materialized View data.

  • Service name: ssb-postgresql
  • Database version: PostgreSQL 18.1
  • Storage: data persists through a PersistentVolumeClaim created during installation

Retrieving database credentials

To connect external BI tools to the Materialized View store, or to troubleshoot directly, retrieve database credentials from the Kubernetes secret. These credentials are not exposed in the Streaming SQL Console UI.

  1. Identify the secret name in your values.yaml or by listing namespace secrets. By default, the secret is typically named ssb-postgresql-auth or uses your Helm release prefix.
  2. Retrieve and decode the password:
    kubectl get secret [***SECRET_NAME***] -n [***NAMESPACE***] -o jsonpath="{.data.SSB_MVE_DATABASE_PASSWORD}" | base64 --decode

Connecting to the Materialized View store

Connecting from within the cluster

If your application runs in the same Kubernetes cluster, use internal service DNS.

  • JDBC URL: jdbc:postgresql://ssb-postgresql.[***NAMESPACE***].svc.cluster.local:5432/ssb_admin
  • Username: ssb_admin (or the username configured in values.yaml)
  • Password: use the value retrieved from the Kubernetes secret

Connecting from outside the cluster

To access the Materialized View store externally, expose the PostgreSQL service.

Option 1: Port forwarding (development/testing)

kubectl port-forward service/ssb-postgresql 5432:5432 -n [***NAMESPACE***]

After forwarding, connect to localhost:5432.

Option 2: Ingress or NodePort (production)

For persistent external access, configure ingress or set the service type to NodePort or LoadBalancer in Helm values, and ensure network policies allow access.

Configuring resource requests

You can adjust CPU and memory resources for the Materialized View PostgreSQL deployment by updating values.yaml:

ssb:
  database:
    resources:
      requests:
        memory: "1Gi"
        cpu: "500m"
      limits:
        memory: "2Gi"
        cpu: "1000m"

Apply configuration changes with helm upgrade.