Configuring the Environment

Before a single data scientist writes a line of code, the infrastructure must be bulletproof. Let’s lay the groundwork.

As a Platform Architect, your Day 0 responsibility is establishing the rules of engagement. If you hand over a raw cluster without wiring up corporate security, database persistence, and standardized credentials, your teams will invent their own risky workarounds.

This phase covers the steps you execute at the cluster-admin level. We are going to establish certificate trust, mandate persistent metadata stores, and extend the OpenShift AI dashboard to natively speak to your corporate data warehouses.

1. Internal Certificate Authority (CA)

In an enterprise environment, your data lakes (MinIO, Ceph) and relational databases (Amazon RDS, internal Postgres) are almost certainly secured by internal, self-signed certificates.

If OpenShift AI does not explicitly trust your internal Certificate Authority (CA), platform components will silently fail to connect, throwing x509: certificate signed by unknown authority errors. Chasing down TLS handshake failures across a distributed system is a massive drain on engineering time.

By injecting your cluster’s CA bundle into the DSCI (Data Science Cluster Initialization) resource so that all OpenShift AI components trust your internal endpoints.

# 1. Fetch the current OpenShift AI trusted CA configuration and save it locally
oc get dscinitializations.dscinitialization.opendatahub.io default-dsci -o json | jq -r '.spec.trustedCABundle.customCABundle' > /tmp/my-custom-ca-bundles.crt

# 2. Append the cluster's internal kube-root-ca.crt to your bundle
oc get configmap kube-root-ca.crt -o jsonpath="{['data']['ca\.crt']}" >> /tmp/my-custom-ca-bundles.crt

# 3. Patch the DSCI resource to apply the global trust
oc patch dscinitialization default-dsci --type='json' -p='[{"op":"replace","path":"/spec/trustedCABundle/customCABundle","value":"'"$(awk '{printf "%s\\n", $0}' /tmp/my-custom-ca-bundles.crt)"'"}]'

2. The Database Baseline

In OpenShift AI 3.3, setting up database connections is no longer just for custom data science workloads; it is a strict requirement for the platform’s control plane.

You will need to architect connections to the following external systems to support production AI:

A. The Model Registry (Metadata)

  • Requirement: External MySQL (version 5.x or 8.x) or MariaDB (version 10.3+).

  • Why: Local SQLite files are deprecated for production metadata. The Model Registry interacts directly with the underlying relational database to track lineage, quantization schemas, and pipeline deployment events without database locking issues.

B. Llama Stack (Retrieval-Augmented Generation)

When deploying GenAI models that require RAG architectures (giving LLMs access to your private documents), you must connect to specialized vector databases.

  • Vector Store (Large Scale): Requires a connection to Remote Milvus. This typically utilizes a gRPC endpoint on port 19530.

  • Vector Store (Transactional): Requires a connection to PostgreSQL with the pgvector extension, typically on port 5432.

  • State/Metadata: Llama Stack requires PostgreSQL to persist critical GenAI state data, including agent states and conversation history.

3. Extending the Dashboard (Custom Connection Types)

Out of the box, OpenShift AI provides UI templates for S3, OCI, and URI connections. However, it does not inherently know what fields are required to connect to Snowflake, MongoDB, or your newly mandated PostgreSQL databases.

If you do not build a "Socket" for these databases, data scientists will inevitably hardcode passwords directly into their Jupyter Notebooks to get their work done.

To prevent this, you define a ConnectionType Custom Resource (CR). This CR instructs the OpenShift AI dashboard on how to render a secure input form and maps the user’s plain-text inputs directly to standardized Environment Variables inside the pods.

Action: Define a Corporate PostgreSQL Standard

Apply this configuration to your cluster to create a standardized, reusable PostgreSQL connection template:

apiVersion: dashboard.opendatahub.io/v1alpha
kind: ConnectionType
metadata:
  name: corporate-postgres-v1
  labels:
    opendatahub.io/dashboard: "true"
    opendatahub.io/managed: "true" (1)
spec:
  displayName: "Corporate PostgreSQL"
  description: "Standard connection for read-only transactional databases."
  category: "Database"
  fields:
    - name: Host
      type: text
      required: true
      envVar: DB_HOST
    - name: Port
      type: text
      defaultValue: "5432"
      required: true
      envVar: DB_PORT
    - name: Database
      type: text
      required: true
      envVar: DB_NAME
    - name: Username
      type: text
      required: true
      envVar: DB_USER
    - name: Password
      type: password (2)
      required: true
      envVar: DB_PASSWORD
1 UI Visibility: The opendatahub.io/managed: "true" label is mandatory. Without it, the dashboard will entirely ignore this template.
2 Security Masking: Declaring type: password ensures the input is obscured in the UI and mounted securely as an opaque Kubernetes Secret.

Once you apply this CR, developers simply select "Corporate PostgreSQL" from a dropdown in the UI.

They can then write clean, portable code using os.getenv("DB_PASSWORD") without ever seeing or exposing the underlying credentials in their repositories.

import os
import psycopg2

# The Platform injects the correct values based on the environment.
conn = psycopg2.connect(
    host=os.getenv("DB_HOST"),
    database=os.getenv("DB_NAME"),
    user=os.getenv("DB_USER"),
    password=os.getenv("DB_PASSWORD")
)