Chapter 8. Working with certificates
When you install Red Hat OpenShift AI, OpenShift automatically applies a default Certificate Authority (CA) bundle to manage authentication for most OpenShift AI components, such as workbenches and model servers. These certificates are trusted self-signed certificates that help secure communication. However, as a cluster administrator, you might need to configure additional self-signed certificates to use some components, such as the AI pipeline server and object storage solutions. If an OpenShift AI component uses a self-signed certificate that is not part of the existing cluster-wide CA bundle, you have the following options for including the certificate:
- Add it to the OpenShift cluster-wide CA bundle.
- Add it to a custom CA bundle, separate from the cluster-wide CA bundle.
As a cluster administrator, you can also change how to manage authentication for OpenShift AI as follows:
- Manually manage certificate changes, instead of relying on the OpenShift AI Operator to handle them automatically.
- Remove the cluster-wide CA bundle, either from all namespaces or specific ones. If you prefer to implement a different authentication approach, you can override the default OpenShift AI behavior, as described in Removing the CA bundle.
8.1. Understanding how OpenShift AI handles certificates Copy linkLink copied to clipboard!
After installing OpenShift AI, the Red Hat OpenShift AI Operator automatically creates an empty odh-trusted-ca-bundle configuration file (ConfigMap). The Cluster Network Operator (CNO) injects the cluster-wide CA bundle into the odh-trusted-ca-bundle configMap with the label "config.openshift.io/inject-trusted-cabundle".
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/part-of: opendatahub-operator
config.openshift.io/inject-trusted-cabundle: 'true'
name: odh-trusted-ca-bundle
After the CNO operator injects the bundle, it updates the ConfigMap with the contents of the ca-bundle.crt file.
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/part-of: opendatahub-operator
config.openshift.io/inject-trusted-cabundle: 'true'
name: odh-trusted-ca-bundle
data:
ca-bundle.crt: |
<BUNDLE OF CLUSTER-WIDE CERTIFICATES>
The management of CA bundles is configured through the Data Science Cluster Initialization (DSCI) object. Within this object, you can set the spec.trustedCABundle.managementState field to one of the following values:
-
Managed: (Default) The Red Hat OpenShift AI Operator manages theodh-trusted-ca-bundleConfigMap and adds it to all non-reserved existing and new namespaces. It does not add the ConfigMap to any reserved or system namespaces, such asdefault,openshift-\*orkube-*. The Red Hat OpenShift AI Operator automatically updates the ConfigMap to reflect any changes made to thecustomCABundlefield. Unmanaged: The Red Hat OpenShift AI administrator manually manages theodh-trusted-ca-bundleConfigMap, instead of allowing the Operator to manage it. Changing themanagementStatefromManagedtoUnmanageddoes not remove theodh-trusted-ca-bundleConfigMap. However, the ConfigMap is no longer automatically updated if changes are made to thecustomCABundlefield.The
Unmanagedsetting is useful if your organization implements a different method for managing trusted CA bundles, such as Ansible automation, and does not want the Red Hat OpenShift AI Operator to handle certificates automatically. This setting provides greater control, preventing the Operator from overwriting custom configurations.Removed: The Red Hat OpenShift AI Operator removes theodh-trusted-ca-bundleConfigMap, if present, and prevents ConfigMaps from being created in new namespaces. Changing this field fromManagedtoRemovedalso deletes the ConfigMap from existing namespaces. This is the default value after upgrading Red Hat OpenShift AI from 2.7 or earlier versions to 3.5.The
Removedsetting reduces complexity and mitigates security risks, such as unauthorized certificate changes. In high-security environments, removing the CA bundle ensures that only approved CAs are trusted, reducing the risk of cyberattacks. For example, your organization might want to restrict cluster administrators from creating trusted CA bundles to prevent OpenShift pods from communicating externally.
8.2. Adding certificates Copy linkLink copied to clipboard!
If you must use a self-signed certificate that is not part of the existing cluster-wide CA bundle, you have two options for configuring the certificate:
Add it to the cluster-wide CA bundle.
This option is useful when the certificate is needed for secure communication across multiple services or when it’s required by security policies to be trusted cluster-wide. This option ensures that all services and components in the cluster trust the certificate automatically. It simplifies management because the certificate is trusted across the entire cluster, avoiding the need to configure the certificate separately for each service.
Add it to a custom CA bundle that is separate from the OpenShift cluster-wide bundle.
Consider this option for the following scenarios:
- Limit scope: Only specific services need the certificate, not the whole cluster.
- Isolation: Keeps custom certificates separate, preventing changes to the global configuration.
- Avoid global impact: Does not affect services that do not need the certificate.
- Easier management: Makes it simpler to manage certificates for specific services.
8.3. Adding certificates to a cluster-wide CA bundle Copy linkLink copied to clipboard!
You can add a self-signed certificate to a cluster-wide Certificate Authority (CA) bundle (ca-bundle.crt).
When the cluster-wide CA bundle is updated, the Cluster Network Operator (CNO) automatically detects the change and injects the updated bundle into the odh-trusted-ca-bundle ConfigMap, making the certificate available to OpenShift AI components.
Note: By default, the management state for the Trusted CA bundle is Managed (that is, the spec.trustedCABundle.managementState field in the Red Hat OpenShift AI Operator’s DSCI object is set to Managed). If you change this setting to Unmanaged, you must manually update the odh-trusted-ca-bundle ConfigMap to include the updated cluster-wide CA bundle.
Alternatively, you can add certificates to a custom CA bundle, as described in Adding certificates to a custom CA bundle.
Prerequisites
-
You have created a self-signed certificate and saved the certificate to a file. For example, you have created a certificate using OpenSSL and saved it to a file named
example-ca.crt. - You have cluster administrator access for the OpenShift cluster where Red Hat OpenShift AI is installed.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
Create a ConfigMap that includes the root CA certificate used to sign the certificate, where
</path/to/example-ca.crt>is the path to the CA certificate bundle on your local file system:oc create configmap custom-ca \ --from-file=ca-bundle.crt=</path/to/example-ca.crt> \ -n openshift-configUpdate the cluster-wide proxy configuration with the newly-created ConfigMap:
oc patch proxy/cluster \ --type=merge \ --patch='{"spec":{"trustedCA":{"name":"custom-ca"}}}'
Verification
Run the following command to verify that all non-reserved namespaces contain the odh-trusted-ca-bundle ConfigMap:
oc get configmaps --all-namespaces -l app.kubernetes.io/part-of=opendatahub-operator | grep odh-trusted-ca-bundle
Additional resources
- Configuring certificates in the OpenShift Container Platform documentation
- Injecting a custom CA Bundle in the Red Hat OpenShift Service on AWS documentation
- Injecting a custom CA Bundle in the OpenShift Dedicated documentation
8.4. Adding certificates to a custom CA bundle Copy linkLink copied to clipboard!
You can add self-signed certificates to a custom CA bundle that is separate from the OpenShift cluster-wide bundle.
This method is ideal for scenarios where components need access to external resources that require a self-signed certificate. For example, you might need to add self-signed certificates to grant AI pipelines access to S3-compatible object storage.
Prerequisites
-
You have created a self-signed certificate and saved the certificate to a file. For example, you have created a certificate using OpenSSL and saved it to a file named
example-ca.crt. - You have cluster administrator access for the OpenShift cluster where Red Hat OpenShift AI is installed.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
- Log in to OpenShift.
Go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
- Click the DSC Initialization tab.
- Click the default-dsci object.
- Click the YAML tab.
In the
spec.trustedCABundlesection, add the custom certificate to thecustomCABundlefield, as shown in the following example:spec: trustedCABundle: managementState: Managed customCABundle: | -----BEGIN CERTIFICATE----- examplebundle123 -----END CERTIFICATE------ Click Save.
The Red Hat OpenShift AI Operator automatically updates the ConfigMap to reflect any changes made to the customCABundle field. It adds the odh-ca-bundle.crt file containing the certificates to the odh-trusted-ca-bundle ConfigMap, as shown in the following example:
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/part-of: opendatahub-operator
config.openshift.io/inject-trusted-cabundle: 'true'
name: odh-trusted-ca-bundle
data:
ca-bundle.crt: |
<BUNDLE OF CLUSTER-WIDE CERTIFICATES>
odh-ca-bundle.crt: |
<BUNDLE OF CUSTOM CERTIFICATES>
Verification
Run the following command to verify that a non-reserved namespace contains the odh-trusted-ca-bundle ConfigMap and that the ConfigMap contains your customCABundle value. In the following command, example-namespace is the non-reserved namespace and examplebundle123 is the customCABundle value.
oc get configmap odh-trusted-ca-bundle -n example-namespace -o yaml | grep examplebundle123
8.5. Using self-signed certificates with OpenShift AI components Copy linkLink copied to clipboard!
Some OpenShift AI components have additional options or required configuration for self-signed certificates.
8.5.1. Accessing S3-compatible object storage with self-signed certificates Copy linkLink copied to clipboard!
To securely connect OpenShift AI components to object storage solutions or databases that are deployed within an OpenShift cluster that uses self-signed certificates, you must provide a certificate authority (CA) certificate. Each namespace includes a config map named kube-root-ca.crt, which contains the CA certificate of the internal API Server.
Use this procedure only when the object storage endpoint serves TLS by using a certificate that is signed by an internal or cluster CA. You do not need this procedure in the following cases:
- The endpoint serves plain HTTP and does not use TLS.
- The endpoint presents a certificate that the cluster-wide CA bundle already includes.
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift.
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS.
- You have deployed an object storage solution or database in your OpenShift cluster.
Procedure
In a terminal window, log in to the OpenShift CLI (
oc) as shown in the following example:oc login api.<cluster_name>.<cluster_domain>:6443 --webRetrieve the current OpenShift AI trusted CA configuration and store it in a new file. This step preserves any existing custom CA bundle, so that the later steps add the internal CA for the cluster to it instead of replacing it:
oc get dscinitializations.dscinitialization.opendatahub.io default-dsci -o json | jq -r '.spec.trustedCABundle.customCABundle' > /tmp/my-custom-ca-bundles.crtAdd the
kube-root-ca.crtconfig map for the cluster to the OpenShift AI trusted CA configuration:oc get configmap kube-root-ca.crt -o jsonpath="{['data']['ca\.crt']}" >> /tmp/my-custom-ca-bundles.crtNoteThe
kube-root-ca.crtconfig map is identical in every namespace, so this command returns the same CA certificate regardless of your current project.Update the OpenShift AI trusted CA configuration to trust certificates issued by the certificate authorities in
kube-root-ca.crt: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)"'"}]'
Verification
From a workbench pod that mounts the updated trusted CA bundle, send a test request to the HTTPS endpoint of your object storage and confirm that the TLS handshake succeeds:
$ oc exec -n <namespace> <workbench-pod> -- \ curl -sS -o /dev/null -w "%{http_code}\n" https://<s3-endpoint>Any HTTP response code, such as
200or403, confirms that the TLS handshake succeeded and that the cluster trusts the certificate. Acurlerror that mentions a self-signed certificate or a certificate verification failure indicates that the trusted CA bundle does not include the issuing CA.- A component that is configured to use the in-cluster object storage or database starts successfully. For example, a pipeline server that is configured to use an in-cluster database reaches a running state.
For a more thorough, end-to-end check, you can confirm the certificate configuration by working through the OpenShift AI tutorial - Fraud Detection example, which exercises in-cluster object storage and AI pipelines against the updated trusted CA bundle.
For more information about installing local object storage buckets and creating connections, see Running a script to install local object storage buckets and create connections.
For more information about enabling AI pipelines, see Enabling pipelines.
8.5.2. Configuring a certificate for pipelines Copy linkLink copied to clipboard!
By default, OpenShift AI includes OpenShift cluster-wide certificates in the odh-trusted-ca-bundle config map. These cluster-wide certificates cover most components, such as workbenches and model servers. However, the pipeline server might require additional Certificate Authority (CA) configuration, especially when interacting with external systems that use self-signed or custom certificates.
You have the following options for adding the certificate for AI pipelines:
- Add them to the cluster-wide CA bundle, as described in Adding certificates to a cluster-wide CA bundle.
- Add them to a custom bundle as described in Adding certificates to a custom CA bundle.
- Provide a CA bundle that is only used for AI pipelines, as described in the following procedure.
Prerequisites
- You have cluster administrator access for the OpenShift cluster where Red Hat OpenShift AI is installed.
-
You have created a self-signed certificate and saved the certificate to a file. For example, you have created a certificate using OpenSSL and saved it to a file named
example-ca.crt. - You have configured a pipeline server and it is available. For more information, see Configuring a pipeline server.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
- Log in to the OpenShift web console as a cluster administrator.
Create a config map with the required bundle for your target AI pipeline:
-
In the Administrator perspective, click Workloads
ConfigMaps. - From the Project list, select the project that contains the target AI pipeline.
- Click Create ConfigMap.
In the Configure via section, select the YAML view option.
The Create ConfigMap page opens, with default YAML code automatically added.
Update the default YAML code for the required bundle for your target AI pipeline:
kind: ConfigMap apiVersion: v1 metadata: name: custom-ca-bundle data: ca-bundle.crt: | # contents of ca-bundle.crt- Click Create.
-
In the Administrator perspective, click Workloads
Update the
.spec.apiServer.cABundlefield of the underlyingDataSciencePipelinesApplication(DSPA):-
Click Home
Search. -
From the Resources list, search for
DataSciencePipelinesApplicationand then select it from the list of results. - Click the YAML tab.
Add or update the following snippet to the
.spec.apiServer.cABundlefield:apiVersion: datasciencepipelinesapplications.opendatahub.io/v1 kind: DataSciencePipelinesApplication metadata: name: data-science-dspa spec: apiServer: cABundle: configMapName: custom-ca-bundle configMapKey: ca-bundle.crtwhere:
configMapName- Required. Specifies the name of the source config map that you created.
configMapKey- Required. Specifies the key in the source config map that holds the CA bundle.
Optional: To mount the bundle at a path or file name other than the default
/dsp-custom-certs/dsp-ca.crt, set thecaBundleFileMountPathandcaBundleFileNamefields underspec.apiServer:spec: apiServer: caBundleFileMountPath: /tmp/custom-dsp-certs caBundleFileName: custom-dsp-ca.crtwhere:
caBundleFileMountPath-
Optional. Overrides the default mount directory,
/dsp-custom-certs. caBundleFileName-
Optional. Overrides the default file name,
dsp-ca.crt.
Click Save to save your changes. The pipeline server pod automatically redeploys with the updated bundle.
NoteThe pipeline controller generates a managed config map that is named
dsp-trusted-ca-__<dspa-name>__. For example, a DSPA nameddspaproduces a managed config map that is nameddsp-trusted-ca-dspa. The running pipeline server pod mounts this managed config map, not any source config map that you create.The controller creates this managed config map even when you do not set
cABundle. WhenpodToPodTLSis enabled, which is the default, the controller always adds the cluster service CA to the managed config map. When you setcABundle, the controller adds the CA certificates from your source config map to the same managed config map.
-
Click Home
Verification
In a terminal window, log in to your OpenShift cluster and confirm that the pipeline controller generated the managed CA bundle config map, which is named
dsp-trusted-ca-__<dspa-name>__:$ oc get configmap dsp-trusted-ca-<dspa-name> -n <namespace>Get the name of the pipeline API server pod, which has the
ds-pipeline-__<dspa-name>__-prefix:$ oc get pods -n <namespace> | grep ds-pipeline-<dspa-name>-Confirm that the CA bundle is mounted in the pipeline API server container at the default path,
/dsp-custom-certs/:$ oc exec -n <namespace> <pipeline-api-server-pod> -c ds-pipeline-api-server -- \ ls -l /dsp-custom-certs/If you set
caBundleFileMountPathorcaBundleFileName, substitute your configured mount path and file name.Confirm that the bundle file contains the expected certificates:
$ oc exec -n <namespace> <pipeline-api-server-pod> -c ds-pipeline-api-server -- \ cat /dsp-custom-certs/dsp-ca.crt | head -5The output begins with a
-----BEGIN CERTIFICATE-----line.Confirm that the pipeline API server sets the related certificate environment variables:
$ oc exec -n <namespace> <pipeline-api-server-pod> -c ds-pipeline-api-server -- \ env | grep -iE CABUNDLE|SSL_CERT_DIR|ARTIFACT_COPYThe output includes
SSL_CERT_DIR, which lists/dsp-custom-certsfirst (for example,SSL_CERT_DIR=/dsp-custom-certs:/etc/ssl/certs:/etc/pki/tls/certs), and theARTIFACT_COPY_STEP_CABUNDLE_*variables.
8.5.3. Configuring a certificate for workbenches Copy linkLink copied to clipboard!
OpenShift AI workbenches automatically trust the cluster-wide and custom CA bundles. When you configure cluster-wide certificates, the workbench mounts the combined bundle at /etc/pki/tls/custom-certs/ca-bundle.crt and presets several environment variables, so that common tools and client libraries use the bundle without extra configuration. Use this procedure to apply the certificate to a workbench and, where required, to point an individual package at the bundle.
The workbench presets the following environment variables, all of which point to /etc/pki/tls/custom-certs/ca-bundle.crt:
SSL_CERT_FILE- The default CA bundle for OpenSSL and many Python libraries.
REQUESTS_CA_BUNDLE-
The CA bundle for the Python
requestslibrary. PIP_CERT-
The CA bundle that
pipuses to connect to package repositories. GIT_SSL_CAINFO-
The CA bundle that
gituses for HTTPS connections. KF_PIPELINES_SSL_SA_CERTS-
The CA bundle that the Elyra extension reads and passes to the Kubeflow Pipelines SDK (
kfp) when it submits pipelines to the AI pipeline server.
Prerequisites
- You are logged in to Red Hat OpenShift AI.
- You have configured cluster-wide certificates, as described in Adding certificates to a cluster-wide CA bundle.
- You have access to a workbench in OpenShift AI.
Procedure
Apply the certificate to the workbench:
- For a new workbench, create the workbench after you configure cluster-wide certificates. The workbench trusts the bundle automatically. For more information about how to create workbenches, see Creating a workbench.
- For an existing workbench, stop and then restart the workbench. For more information, see Starting a workbench.
ImportantBy default, self-signed certificates apply only to workbenches that you create after you configure cluster-wide certificates. Restarting an existing workbench applies the current bundle to it.
Optional: For a package that does not read any of the preset environment variables, pass the certificate path explicitly. For example, the
kfppackage connects to the AI pipeline server by using thessl_ca_certparameter:from kfp.client import Client with open(sa_token_file_path, 'r') as token_file: bearer_token = token_file.read() client = Client( host='https://<pipeline_server_route>/', existing_token=bearer_token, ssl_ca_cert='/etc/pki/tls/custom-certs/ca-bundle.crt' ) print(client.list_experiments())NoteThe Elyra extension reads the preset
KF_PIPELINES_SSL_SA_CERTSvariable and applies this bundle automatically when you build and submit pipelines in the visual editor. When you call thekfpclient directly, as in this example, passssl_ca_certexplicitly so that the client trusts the bundle.
Verification
Open a terminal in the workbench and confirm that the environment variables point to the bundle file:
$ env | grep -E 'SSL_CERT_FILE|REQUESTS_CA_BUNDLE|PIP_CERT|GIT_SSL_CAINFO|KF_PIPELINES_SSL_SA_CERTS'Each variable points to
/etc/pki/tls/custom-certs/ca-bundle.crt.Confirm that the bundle file exists and contains certificates:
$ head -5 /etc/pki/tls/custom-certs/ca-bundle.crtThe output begins with a
-----BEGIN CERTIFICATE-----line.
8.5.4. Using the cluster-wide CA bundle for the model serving platform Copy linkLink copied to clipboard!
By default, the model serving platform in OpenShift AI uses a self-signed certificate generated at installation for the endpoints that are created when deploying a server.
If you have configured cluster-wide certificates on your OpenShift cluster, they are used by default for other types of endpoints, such as endpoints for routes.
The following procedure explains how to use the same certificate that you already have for your OpenShift cluster.
Prerequisites
- You have cluster administrator access for the OpenShift cluster where Red Hat OpenShift AI is installed.
- You have configured cluster-wide certificates in OpenShift.
Procedure
- Log in to the OpenShift web console as a cluster administrator.
Go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
-
From the list of projects, open the
openshift-ingressproject. - Click YAML.
-
Search for "cert" to find a secret with a name that includes "cert". For example,
rhods-internal-primary-cert-bundle-secret. The contents of the secret should contain two items that are used for all OpenShift Routes:tls.cert(the certificate) andtls.key(the key). - Copy the reference to the secret.
-
From the list of projects, open the
istio-systemproject. -
Create a YAML file and paste the reference to the secret that you copied from the
openshift-ingressYAML file. Edit the YAML code to keep only the relevant content, as shown in the following example. Replace
rhods-internal-primary-cert-bundle-secretwith the name of your secret:kind: Secret apiVersion: v1 metadata: name: rhods-internal-primary-cert-bundle-secret data: tls.crt: >- LS0tLS1CRUd... tls.key: >- LS0tLS1CRUd... type: kubernetes.io/tls-
Save the YAML file in the
istio-systemproject. - Log in to the OpenShift web console as a cluster administrator.
From the OpenShift web console, go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
-
Click Data Science Cluster, and then click default-dsc
YAML. Edit the
kserveconfiguration section to refer to your secret as shown in the following example. Replacerhods-internal-primary-cert-bundle-secretwith the name of the secret that you created in Step 8.kserve: devFlags: {} managementState: Managed serving: ingressGateway: certificate: secretName: rhods-internal-primary-cert-bundle-secret type: Provided managementState: Managed name: knative-serving
8.5.5. About CA bundle configuration for OGX Copy linkLink copied to clipboard!
By default, the OGX server image trusts only public Certificate Authorities (CAs). To enable the OGX server to communicate over TLS with external inference, embedding, or vector store providers that present self-signed certificates or certificates issued by a private CA, configure a custom CA bundle for the OGXServer custom resource (CR).
When you configure or change the CA bundle for a OGXServer CR, the OGX Operator restarts the OGX server pod so that the new certificates take effect. Plan for a brief service interruption when you apply or update the CA bundle on a OGXServer CR that is serving production traffic.
You have the following options for trusting a self-signed or private CA from the OGX server:
- Add the CA to the cluster-wide CA bundle, as described in Adding certificates to a cluster-wide CA bundle.
- Add the CA to a custom CA bundle, as described in Adding certificates to a custom CA bundle.
- Provide a CA bundle that is only used for the OGX server, as described in Configuring a CA bundle for OGX.
The best pattern is to add the CA to the cluster-wide or custom CA bundle and then reference the resulting odh-trusted-ca-bundle config map from the OGXServer CR. The odh-trusted-ca-bundle config map is automatically maintained in every non-reserved namespace and contains both the cluster-wide CA bundle and any custom CAs that you have added through the DSCInitialization (DSCI) object. Alternatively, you can create a dedicated config map that contains certificates that are specific to the OGX server.
When you reference a config map from the spec.server.tlsConfig.caBundle field of a OGXServer CR, the OGX Operator performs the following actions:
- Reads the CA certificates from the source config map and validates each certificate.
-
Concatenates the valid certificates into a single bundle and stores the bundle in a managed config map that is named
<instance-name>-ca-bundle. -
Mounts the managed config map into the OGX server pod at
/etc/ssl/certs/ca-bundle/ca-bundle.crt. -
Sets the
SSL_CERT_FILEenvironment variable on the server container so that TLS clients in the server use the bundle automatically.
When you change the source config map or the field reference, the OGX Operator regenerates the managed config map and restarts the OGX server pod so that the new certificates take effect.
For details about the supported caBundle fields, the validation rules, and the limits that the OGX Operator enforces, see CA bundle configuration reference for OGX.
8.5.6. Configuring a CA bundle for OGX Copy linkLink copied to clipboard!
To enable the OGX server to trust certificates that are issued by a self-signed or private Certificate Authority (CA), reference a config map that contains the CA certificates from the spec.server.tlsConfig.caBundle field of your OGXServer custom resource (CR).
When you complete this procedure, the OGX Operator restarts the OGX server pod so that the new certificates take effect. Plan for a brief service interruption when you apply or update the CA bundle on a OGXServer CR that is serving production traffic.
The following procedure uses the best pattern of referencing the odh-trusted-ca-bundle config map, which OpenShift AI automatically maintains in every non-reserved namespace. To use a dedicated config map, or to reference a config map in a different namespace, see CA bundle configuration for OGX for the alternative configuration patterns.
Prerequisites
- You have installed OpenShift 4.19 or later.
- You have logged in to Red Hat OpenShift AI.
- You have cluster administrator privileges for your OpenShift cluster.
- You have activated the OGX Operator in OpenShift AI. For more information, see Activating the OGX Operator.
-
You have deployed at least one
OGXServerinstance in OpenShift AI. For more information, see Deploying a OGX server. - You have added the required CAs to the cluster-wide CA bundle or to a custom CA bundle, as described in Adding certificates to a cluster-wide CA bundle and Adding certificates to a custom CA bundle.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for Openshift Container Platform.
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS.
Procedure
- Log in to the OpenShift AI web console as a cluster administrator.
-
From the Project list, select the project that contains your
OGXServerCR. Confirm that the
odh-trusted-ca-bundleconfig map is present in your project:-
In the Administrator perspective, click Workloads
ConfigMaps. -
In the list of config maps, locate
odh-trusted-ca-bundleand click its name. Confirm that the config map contains the following two keys, both of which the OGX Operator reads:
ca-bundle.crt- The cluster-wide CA bundle that the Cluster Network Operator (CNO) injects.
odh-ca-bundle.crt-
Custom CAs that you have added through the
customCABundlefield of the DSCI object.
-
In the Administrator perspective, click Workloads
Reference the
odh-trusted-ca-bundleconfig map from yourOGXServerCR.-
Click Home
Search. -
From the Resources list, search for
OGXServerand select it. The cluster also exposes a OGX resource, which is an internal OpenShift AI resource that is managed by the Red Hat OpenShift AI Operator. Do not selectOGX. -
From the list of
OGXServerinstances, click the name of the instance that you want to update. - Click the YAML tab.
Add a
tlsConfig.caBundlefield to the spec, as shown in the following example:apiVersion: ogx.io/v1beta1 kind: OGXServer metadata: name: my-ogx namespace: my-ogx-namespace spec: distribution: name: rh-dev workload: replicas: 1 tlsConfig: caBundle: configMapName: odh-trusted-ca-bundle1 configMapKeys:2 - ca-bundle.crt - odh-ca-bundle.crt- Click Save. The OGX server pod automatically redeploys with the updated bundle.
-
Click Home
Verification
In a terminal window, log in to your OpenShift cluster from the OpenShift CLI (
oc):$ oc login --token=<token> --server=<openshift_cluster_url>Confirm that the OGX Operator created the managed CA bundle config map. The managed config map is named
<instance-name>-ca-bundle:$ oc get configmap <instance-name>-ca-bundle -n <namespace>The output shows the managed config map.
Confirm that the
OGXServerCR reports a successful CA bundle configuration in its status:$ oc get ogxserver <instance-name> -n <namespace> -o yamlIn the
status.conditionsfield of the output, verify that theDeploymentReadycondition hasstatus: "True"and that no condition reports a CA bundle validation failure in itsmessagefield.Confirm that the OGX server pod is running with the CA bundle mounted:
$ oc get pods -n <namespace> -l app.kubernetes.io/instance=<instance-name>Confirm that the CA bundle file is present in the server container at the expected mount path and that the
SSL_CERT_FILEenvironment variable points to it:$ oc exec -n <namespace> <pod-name> -- ls -l /etc/ssl/certs/ca-bundle/ca-bundle.crt$ oc exec -n <namespace> <pod-name> -- printenv SSL_CERT_FILEThe output of the
printenvcommand shows/etc/ssl/certs/ca-bundle/ca-bundle.crt.Confirm that the bundle file contains the expected CA certificates:
$ oc exec -n <namespace> <pod-name> -- \ head -20 /etc/ssl/certs/ca-bundle/ca-bundle.crtThe output begins with a
-----BEGIN CERTIFICATE-----line, followed by the encoded certificate data of the first certificate in the bundle.Confirm that the OGX server can establish a trusted TLS connection to your external endpoint by sending a test request from inside the pod:
$ oc exec -n <namespace> <pod-name> -- \ curl -sS -o /dev/null -w "%{http_code}\n" <external-endpoint-url>A successful HTTP status code, such as
200, indicates that the certificate chain is validated. Acurlerror that mentions a self-signed certificate or a certificate verification failure indicates that the bundle does not include the correct issuing CA.
8.5.7. CA bundle configuration for OGX Copy linkLink copied to clipboard!
Use this reference to look up the supported subfields of spec.server.tlsConfig.caBundle on a OGXServer custom resource (CR), the alternative configuration patterns, the validation rules and limits that the OGX Operator enforces, the conditions that cause CA bundle validation to fail, and the bundle path that client code can use to establish trusted TLS connections from inside the OGX server pod.
8.5.7.1. caBundle subfields Copy linkLink copied to clipboard!
The spec.server.tlsConfig.caBundle field accepts the following subfields:
configMapName- Required. The name of the source config map that contains the CA certificates.
configMapNamespace-
Optional. The namespace of the source config map. If you omit this field, the OGX Operator reads the config map from the namespace of the
OGXServerCR. Cross-namespace references require that the OGX Operator service account has read access to the source config map. configMapKeys-
Optional. A list of keys in the source config map that contain CA bundles. The OGX Operator reads every listed key and concatenates the certificates into a single bundle. If you omit this field, the OGX Operator reads only the default key,
ca-bundle.crt. SetconfigMapKeyswhen the source config map holds CA data under one or more keys with names other than the default, for example,odh-trusted-ca-bundle, which holds CA data under bothca-bundle.crtandodh-ca-bundle.crt.
8.5.7.2. Configuration examples Copy linkLink copied to clipboard!
The following examples show the alternative patterns for referencing a source config map. For the best pattern, which uses the odh-trusted-ca-bundle config map, see Configuring a CA bundle for OGX.
Referencing a dedicated config map
To use a config map that contains certificates that are specific to the OGX server, create the config map in the same namespace as the OGXServer CR and reference it by name. The following example references a dedicated config map that contains a single CA bundle in the default ca-bundle.crt key:
apiVersion: ogx.io/v1beta1
kind: OGXServer
metadata:
name: my-ogx
namespace: my-ogx-namespace
spec:
distribution:
name: rh-dev
workload:
replicas: 1
tlsConfig:
caBundle:
configMapName: external-llm-ca
- 1
- Specifies the name of the dedicated config map that you created. Because no
configMapKeysvalue is set, the OGX Operator reads the default key,ca-bundle.crt.
To create a dedicated config map, run the following command, in which __<ca-bundle-configmap>__ is the name of the config map to create, __<path/to/ca-bundle.crt>__ is the path to a file on your local file system that contains one or more PEM-encoded CA certificates, and __<namespace>__ is the namespace that contains your OGXServer CR:
$ oc create configmap <ca-bundle-configmap> \
--from-file=ca-bundle.crt=<path/to/ca-bundle.crt> \
-n <namespace>
To include multiple CA certificates in the dedicated config map, concatenate their PEM blocks in the file before you create the config map.
Referencing a config map in a different namespace
To reference a config map in a namespace other than the namespace of the OGXServer CR, set the configMapNamespace field. Cross-namespace references require that the OGX Operator service account has read access to the source config map. The following example references a config map named enterprise-ca-bundle in the security-system namespace:
spec:
server:
tlsConfig:
caBundle:
configMapName: enterprise-ca-bundle
configMapNamespace: security-system
8.5.7.3. Validation rules Copy linkLink copied to clipboard!
The OGX Operator processes only PEM blocks of type CERTIFICATE. PEM blocks of other types, such as PRIVATE KEY, are ignored without error. Each block must parse as a valid X.509 certificate. The combined bundle must contain at least one valid CERTIFICATE block; if no valid certificates are found, the OGX Operator does not create the managed config map and reports a validation failure on the CR status.
8.5.7.4. Limits Copy linkLink copied to clipboard!
The OGX Operator enforces the following limits:
| Limit | Value | Description |
|---|---|---|
| Maximum bundle size | 10 MB | The total size of the concatenated PEM bundle that the OGX Operator generates from the selected keys. Bundles that exceed this size are rejected. |
| Maximum certificate count | 1000 |
The maximum number of valid X.509 |
| Accepted PEM block type |
|
Only PEM blocks of type |
The standard 1 MB Kubernetes config map size limit applies to the source config map. The 10 MB limit applies to the concatenated bundle that the OGX Operator builds from the selected keys.
8.5.7.5. CA bundle validation failure conditions Copy linkLink copied to clipboard!
When a CA bundle validation error occurs, the OGX Operator does not deploy the OGX server pod with an invalid bundle. Instead, the OGX Operator surfaces the error on the status.conditions field of the OGXServer CR.
A OGXServer CR publishes the following condition types:
DeploymentReady-
Set to
"True"when the OGX server deployment has been created and rolled out successfully. CA bundle validation errors cause the OGX Operator to set this condition to"False", with amessagefield that describes the underlying error. ServiceReady-
Set to
"True"when the OGX server service is available. HealthCheck-
Set to
"True"when the OGX server passes its readiness checks.
The CR also publishes a status.phase field that summarizes the overall lifecycle state of the OGXServer instance, with values such as Initializing, Ready, and Failed.
The following conditions cause a CA bundle validation failure:
- The referenced config map does not exist in the specified namespace.
- The selected key does not exist in the source config map.
-
The selected keys do not contain any valid X.509
CERTIFICATEPEM blocks. - The concatenated bundle exceeds the 10 MB size limit.
- The concatenated bundle contains more than 1000 certificates.
- The OGX Operator service account does not have read access to the source config map.
After you correct the source config map or the CR reference, the OGX Operator reconciles the change automatically and updates the managed config map.
8.5.7.6. Using the CA bundle from client code Copy linkLink copied to clipboard!
After the OGX Operator mounts the CA bundle into the OGX server pod, the bundle is available to client code that runs inside the pod at the following path:
/etc/ssl/certs/ca-bundle/ca-bundle.crt
The OGX Operator also sets the SSL_CERT_FILE environment variable on the server container to point to this path. Most Python HTTP libraries, including httpx and requests, honor SSL_CERT_FILE automatically and use the bundle without further configuration.
If your client code uses a library that does not honor SSL_CERT_FILE, pass the bundle path explicitly. For example, the OGX Python client accepts a custom certificate bundle through its TLS configuration:
from ogx_client import OgxClient
import httpx
http_client = httpx.Client(verify="/etc/ssl/certs/ca-bundle/ca-bundle.crt")
client = OgxClient(
base_url="https://my-ogx.my-ogx-namespace.svc:8321",
http_client=http_client,
)
8.6. Managing certificates without the Red Hat OpenShift AI Operator Copy linkLink copied to clipboard!
By default, the Red Hat OpenShift AI Operator manages the odh-trusted-ca-bundle config map, which contains the trusted CA bundle and is applied to all non-reserved namespaces in the cluster. The Operator automatically updates this config map whenever changes are made to the CA bundle.
If your organization prefers to manage trusted CA bundles independently, for example, by using Ansible automation, you can disable this default behavior to prevent automatic updates by the Red Hat OpenShift AI Operator.
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift.
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS.
Procedure
In the OpenShift web console, go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
- Click the Red Hat OpenShift AI Operator.
- Click the DSC Initialization tab.
- Click the default-dsci object.
- Click the YAML tab.
In the
specsection, change the value of themanagementStatefield fortrustedCABundletoUnmanaged, as shown:spec: trustedCABundle: managementState: UnmanagedClick Save.
Changing the
managementStatefromManagedtoUnmanagedprevents automatic updates when thecustomCABundlefield is modified, but does not remove theodh-trusted-ca-bundleconfig map.
Verification
In the
specsection, set thecustomCABundlefield to a test value (for example,example123), and then click Save:spec: trustedCABundle: managementState: Unmanaged customCABundle: example123Confirm that your test value is not propagated while the trusted CA bundle is
Unmanaged. Display theodh-ca-bundle.crtkey of theodh-trusted-ca-bundleconfig map in any non-reserved namespace, and confirm that it does not contain the test value:$ oc get configmap odh-trusted-ca-bundle -n <namespace> -o jsonpath={.data.odh-ca-bundle\.crt}Because the trusted CA bundle is
Unmanaged, the Operator does not reconcile the bundle, so the output does not include the test value.
8.7. Removing the CA bundle Copy linkLink copied to clipboard!
If you prefer to implement a different authentication approach for your OpenShift AI installation, you can override the default behavior by removing the CA bundle.
You have two options for removing the CA bundle:
- Remove the CA bundle from all non-reserved projects in OpenShift AI.
- Remove the CA bundle from a specific project.
8.7.1. Removing the CA bundle from all namespaces Copy linkLink copied to clipboard!
You can remove a Certificate Authority (CA) bundle from all non-reserved namespaces in OpenShift AI. This process changes the default configuration and disables the creation of the odh-trusted-ca-bundle config map, as described in Working with certificates (OpenShift AI Self-Managed) or Working with certificates (OpenShift AI Self-Managed in a disconnected environment).
The odh-trusted-ca-bundle config maps are only deleted from namespaces when you set the managementState of trustedCABundle to Removed; deleting the DSC Initialization does not delete the config maps.
To remove a CA bundle from a single namespace only, see Removing the CA bundle from a single namespace (OpenShift AI Self-Managed) or Removing the CA bundle from a single namespace (OpenShift AI Self-Managed in a disconnected environment).
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for Openshift Container Platform.
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS.
Procedure
- Log in to the OpenShift web console as a cluster administrator.
Go to the Installed Operators page. The navigation path depends on your OpenShift version:
-
On OpenShift 4.20 and later, click Ecosystem
Installed Operators. -
On OpenShift 4.19, click Operators
Installed Operators.
-
On OpenShift 4.20 and later, click Ecosystem
- Click the Red Hat OpenShift AI Operator.
- Click the DSC Initialization tab.
- Click the default-dsci object.
- Click the YAML tab.
In the
specsection, change the value of themanagementStatefield fortrustedCABundletoRemoved:spec: trustedCABundle: managementState: Removed- Click Save.
Verification
Run the following command to verify that the
odh-trusted-ca-bundleconfig map has been removed from all namespaces:$ oc get configmaps --all-namespaces | grep odh-trusted-ca-bundleThe command should not return any config maps.
Confirm that the Operator does not create the
odh-trusted-ca-bundleconfig map in new namespaces whilemanagementStateisRemoved. Create a test namespace, and then check for the config map:$ oc create namespace <test-namespace> $ oc get configmap odh-trusted-ca-bundle -n <test-namespace>The
oc getcommand reports that the config map is not found, which confirms that the Operator no longer injects the bundle.Delete the test namespace when you finish:
$ oc delete namespace <test-namespace>
8.7.2. Removing the CA bundle from a single namespace Copy linkLink copied to clipboard!
You can remove a custom Certificate Authority (CA) bundle from individual namespaces in OpenShift AI. This process disables the creation of the odh-trusted-ca-bundle config map for the specified namespace only.
To remove a CA bundle from all namespaces, see Removing the CA bundle from all namespaces (OpenShift AI Self-Managed) or Removing the CA bundle from all namespaces (OpenShift AI Self-Managed in a disconnected environment).
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for Openshift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
Run the following command to remove a CA bundle from a namespace. In the following command, example-namespace is the non-reserved namespace.
$ oc annotate ns example-namespace security.opendatahub.io/inject-trusted-ca-bundle=false
Verification
Run the following command to verify that the CA bundle has been removed from the namespace. In the following command, example-namespace is the non-reserved namespace.
$ oc get configmap odh-trusted-ca-bundle -n example-namespaceThe command should return
configmaps "odh-trusted-ca-bundle" not found.To restore the
odh-trusted-ca-bundleconfig map in the namespace, remove the annotation. The Operator recreates the config map. In the following command, example-namespace is the non-reserved namespace.$ oc annotate ns example-namespace security.opendatahub.io/inject-trusted-ca-bundle- $ oc get configmap odh-trusted-ca-bundle -n example-namespaceThe
oc getcommand shows the recreated config map.