CA Certificate Management¶
This guide explains how to configure Pulp Operator to mount trusted CA certificates into Pulp pods.
Overview¶
Pulp Operator supports two modes for mounting trusted CA certificates into Pulp pods:
- OpenShift Mode: Uses OpenShift's Cluster Network Operator (CNO) to inject CA bundles
- ConfigMap Mode: Mounts CA bundles from a user-specified ConfigMap on vanilla Kubernetes
On vanilla Kubernetes, the ConfigMap can be managed manually or kept up to date automatically using cert-manager's trust-manager.
Prerequisites¶
For ConfigMap mode on vanilla Kubernetes, you need:
- A Kubernetes cluster (non-OpenShift)
- A ConfigMap containing CA certificates
Option A: Manual ConfigMap Management¶
Create a ConfigMap with your CA certificates in the same namespace as your Pulp installation:
kubectl create configmap my-ca-bundle \
--from-file=ca.crt=my-ca-bundle.pem \
--namespace <pulp-namespace>
Option B: Automated Management with trust-manager¶
For automatic CA bundle updates, install cert-manager and trust-manager:
# Install cert-manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.0/cert-manager.yaml
# Install trust-manager
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install trust-manager jetstack/trust-manager --namespace cert-manager
Configuration¶
Option A: Manual ConfigMap¶
If managing the ConfigMap manually, configure your Pulp CR in the same namespace as the ConfigMap:
apiVersion: repo-manager.pulpproject.org/v1
kind: Pulp
metadata:
name: example-pulp
namespace: <pulp-namespace>
spec:
# Enable CA bundle mounting
mount_trusted_ca: true
# Specify the ConfigMap and key containing CA certificates
mount_trusted_ca_configmap_key: "my-ca-bundle:ca.crt"
# ... other Pulp configuration
Option B: Using trust-manager¶
Step 1: Create a Bundle Resource¶
Create a Bundle resource in the same namespace as your Pulp installation. The Bundle will create a ConfigMap in that namespace:
apiVersion: trust.cert-manager.io/v1alpha1
kind: Bundle
metadata:
name: example-pulp-trusted-ca-bundle
namespace: <pulp-namespace>
spec:
sources:
# Include default system CAs
- useDefaultCAs: true
# Optional: Include custom CAs from ConfigMaps
# - configMap:
# name: my-custom-ca
# key: ca.crt
# Optional: Include CAs from cert-manager Certificates
# - secret:
# name: "my-cert"
# key: "ca.crt"
target:
configMap:
key: "ca-bundle.crt"
This will create a ConfigMap named example-pulp-trusted-ca-bundle containing the aggregated CA bundle.
Step 2: Configure Pulp to Use the Bundle¶
In your Pulp CR, reference the trust-manager ConfigMap:
apiVersion: repo-manager.pulpproject.org/v1
kind: Pulp
metadata:
name: example-pulp
namespace: <pulp-namespace>
spec:
# Enable CA bundle mounting
mount_trusted_ca: true
# Specify the ConfigMap and key (format: "configmap-name:key")
# The ConfigMap must be in the same namespace as the Pulp CR
mount_trusted_ca_configmap_key: "example-pulp-trusted-ca-bundle:ca-bundle.crt"
# ... other Pulp configuration
How It Works¶
OpenShift Mode (Automatic)¶
On OpenShift clusters, when you set mount_trusted_ca: true:
- Operator creates an empty ConfigMap in the Pulp namespace with the label
config.openshift.io/inject-trusted-cabundle: true - OpenShift's CNO automatically injects the cluster's CA bundle into this ConfigMap
- Operator mounts the ConfigMap at
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Note: You should NOT set mount_trusted_ca_configmap_key on OpenShift.
ConfigMap Mode (Explicit Configuration)¶
On vanilla Kubernetes clusters:
- A ConfigMap containing CA certificates exists in the Pulp namespace (created manually or by trust-manager)
- When both
mount_trusted_ca: trueandmount_trusted_ca_configmap_keyare set, operator mounts the ConfigMap at/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Important: The ConfigMap must be in the same namespace as the Pulp CR. Cross-namespace ConfigMap references are not supported.
Using trust-manager (Optional)¶
If using trust-manager for automated CA bundle management:
- Trust-manager watches
Bundleresources - Trust-manager aggregates CAs from the specified sources
- Trust-manager creates/updates the target ConfigMap with the CA bundle
- Pulp operator mounts the ConfigMap into pods
ConfigMap Key Format¶
The mount_trusted_ca_configmap_key field uses the format:
configmap-name:key
For example: my-ca-bundle:ca.crt refers to the ca.crt key in the my-ca-bundle ConfigMap.
Mount Path¶
Both modes mount the CA bundle at the same location to ensure compatibility with Red Hat/Fedora-based container images:
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
This is the standard system-wide CA bundle location on RHEL/Fedora systems.
Complete Example¶
See config/samples/simple-trust-manager.yaml for a complete working example.
Affected Components¶
The CA bundle is mounted in all three Pulp core components:
pulpcore-apipodspulpcore-contentpodspulpcore-workerpods
Troubleshooting¶
ConfigMap Not Found¶
If you see errors about the ConfigMap not being found:
- Verify the Bundle resource was created:
kubectl get bundle -n <pulp-namespace> - Check trust-manager logs:
kubectl logs -n cert-manager -l app.kubernetes.io/name=trust-manager - Verify the ConfigMap exists in the Pulp namespace:
kubectl get configmap <configmap-name> -n <pulp-namespace> - Ensure the ConfigMap is in the same namespace as the Pulp CR
CA Bundle Not Being Used¶
If applications in Pulp pods are not trusting your CAs:
-
Verify the mount is present in the pods:
kubectl exec -it -n <pulp-namespace> <pulp-pod> -- ls -la /etc/pki/ca-trust/extracted/pem/ -
Check the CA bundle content:
kubectl exec -it -n <pulp-namespace> <pulp-pod> -- cat /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem -
Ensure your application is configured to use the system CA bundle (most applications do this by default)
Specifying Different Keys¶
The key name in the ConfigMap can be anything:
- Update the Bundle's
target.configMap.keyfield - Update the Pulp CR's
mount_trusted_ca_configmap_keyfield to match
Example:
# Bundle (in pulp namespace)
apiVersion: trust.cert-manager.io/v1alpha1
kind: Bundle
metadata:
name: example-pulp-trusted-ca-bundle
namespace: <pulp-namespace>
spec:
target:
configMap:
key: "custom-bundle.pem"
# Pulp CR (in same namespace)
apiVersion: repo-manager.pulpproject.org/v1
kind: Pulp
metadata:
name: example-pulp
namespace: <pulp-namespace>
spec:
mount_trusted_ca_configmap_key: "example-pulp-trusted-ca-bundle:custom-bundle.pem"
Migration from OpenShift to Vanilla Kubernetes¶
If you're migrating a Pulp instance from OpenShift to vanilla Kubernetes:
- Install trust-manager on the vanilla Kubernetes cluster
- Create a Bundle resource with the desired CAs
- Update the Pulp CR to add
mount_trusted_ca_configmap_key - The existing
mount_trusted_ca: truefield can remain
The operator will automatically detect the presence of mount_trusted_ca_configmap_key and switch to trust-manager mode.