Image builder worker configuration for subscription-managed RPM content
Configure the image builder worker to install the Red Hat Edge Manager agent RPM from your Red Hat Enterprise Linux subscription instead of the default public repository.
On Red Hat OpenShift Container Platform, the Image Builder worker runs as a privileged workload. Review Image Builder security requirements before you enable or configure the worker in a restricted cluster.
- Red Hat Edge Manager is deployed with the image builder worker enabled. The Helm value
imageBuilderWorker.enabledistrueby default. - A valid Red Hat Enterprise Linux subscription with the Red Hat Edge Manager RPM repository enabled for your architecture. Use the repository identifier that matches your product version and system architecture.
- Cluster administrator access on Red Hat OpenShift Container Platform, or cluster administration access on other Kubernetes distributions.
Preparing the redhat.repo file for a Kubernetes secret Copy linkLink copied!
Before you create the rhel-yum-repos secret, prepare a copy of /etc/yum.repos.d/redhat.repo from a subscribed Red Hat Enterprise Linux host. The file contains entitlement certificate paths such as /etc/pki/entitlement/1234567890-key.pem. After you mount secrets into the worker pod, those paths must use the generic file names that the pod expects.
- On a subscribed Red Hat Enterprise Linux host, copy the repository definition file:
$ cp /etc/yum.repos.d/redhat.repo /tmp/redhat.repo - Replace the host-specific entitlement paths with generic paths:
$ sed -i \ -e 's|/etc/pki/entitlement/[0-9]*-key.pem|/etc/pki/entitlement/entitlement-key.pem|g' \ -e 's|/etc/pki/entitlement/[0-9]*.pem|/etc/pki/entitlement/entitlement.pem|g' \ /tmp/redhat.repo - Keep
/tmp/redhat.repofor the secret creation steps in the following sections.
The Subscription Manager CA certificate at /etc/rhsm/ca/redhat-uep.pem is required so that dnf can verify TLS to cdn.redhat.com. Configure the rhsmCaSecretName Helm value so that this content is mounted at /etc/rhsm/ca in the worker pod.
Configuring on Red Hat OpenShift Container Platform Copy linkLink copied!
On clusters where Red Hat Enterprise Linux entitlements are in use, OpenShift exposes entitlement data in the etc-pki-entitlement secret in the openshift-config-managed namespace.
- The OpenShift CLI (
oc) is installed and you are authenticated to the cluster. - You prepared
/tmp/redhat.repoas described in Preparing the redhat.repo file for a Kubernetes secret in the Additional resources section.- Set your Red Hat Edge Manager project namespace:
$ export NAMESPACE=<project_name>Replace
<project_name>with the namespace where Red Hat Edge Manager is installed. - Copy the entitlement secret into that namespace:
$ oc get secret etc-pki-entitlement -n openshift-config-managed -o yaml | \ sed "s/namespace: openshift-config-managed/namespace: ${NAMESPACE}/" | \ oc apply -f - - Create a secret that contains the sanitized repository definition:
$ oc create secret generic rhel-yum-repos -n ${NAMESPACE} \ --from-file=redhat.repo=/tmp/redhat.repo - Create a secret from the Subscription Manager configuration directory. Run this command on a system where
/etc/rhsm/is available, typically a subscribed Red Hat Enterprise Linux host withocconfigured for the cluster. Alternatively, copy/etc/rhsm/to your workstation and adjust the path:$ oc create secret generic rhel-rhsm -n ${NAMESPACE} --from-file=/etc/rhsm/ - Create a secret that contains the Subscription Manager CA certificates:
$ oc create secret generic rhel-rhsm-ca -n ${NAMESPACE} --from-file=/etc/rhsm/ca/ - Add the following values to your Red Hat Edge Manager Helm release. In the Red Hat OpenShift Container Platform web console, navigate to Helm
Releases, locate your release, select Upgrade, and edit the YAML values. Merge the example fields with your existing configuration. imageBuilderWorkervalues for Red Hat OpenShift Container PlatformimageBuilderWorker: entitlementCertsSecretName: "etc-pki-entitlement" yumReposSecretName: "rhel-yum-repos" rhsmSecretName: "rhel-rhsm" rhsmCaSecretName: "rhel-rhsm-ca" rpmRepoAdd: false rpmRepoEnable: "edge-manager-1.3-for-rhel-9-x86_64-rpms"Replace
rpmRepoEnablewith your enabled repository identifier if it differs.Note - Setting
rpmRepoAddtofalseprevents adding an external repository URL because repository definitions come from mounted secrets. rpmRepoEnablesets the repository thatdnfuses when it installs the agent RPM (--enablerepo).
- Setting
- Complete the upgrade so that the chart is redeployed. In the console, click Upgrade. If you use the CLI or GitOps, apply the equivalent change.
- Set your Red Hat Edge Manager project namespace:
Configuring on other Kubernetes distributions Copy linkLink copied!
- The Kubernetes CLI (
kubectl) is installed and configured for the cluster where Red Hat Edge Manager runs. - You prepared
/tmp/redhat.repoas described in Preparing the redhat.repo file for a Kubernetes secret in the Additional resources section. - You can run commands on a subscribed Red Hat Enterprise Linux host (or equivalent) to read
/etc/pki/entitlement/and/etc/rhsm/.- Create the secrets in the same namespace as your Red Hat Edge Manager release. Replace
<project_name>with that namespace.$ kubectl create secret generic rhel-entitlement -n <project_name> \ --from-file=/etc/pki/entitlement/ $ kubectl create secret generic rhel-yum-repos -n <project_name> \ --from-file=redhat.repo=/tmp/redhat.repo $ kubectl create secret generic rhel-rhsm -n <project_name> \ --from-file=/etc/rhsm/ $ kubectl create secret generic rhel-rhsm-ca -n <project_name> \ --from-file=/etc/rhsm/ca/ - Update your Helm values for Red Hat Edge Manager to include the following
imageBuilderWorkersettings (merge with your existing values):imageBuilderWorkervalues for KubernetesimageBuilderWorker: entitlementCertsSecretName: "rhel-entitlement" yumReposSecretName: "rhel-yum-repos" rhsmSecretName: "rhel-rhsm" rhsmCaSecretName: "rhel-rhsm-ca" rpmRepoAdd: false rpmRepoEnable: "edge-manager-1.3-for-rhel-9-x86_64-rpms" - Redeploy or upgrade the Helm release so the image builder worker uses the new configuration.
- Create the secrets in the same namespace as your Red Hat Edge Manager release. Replace
Helm parameters for subscription-managed repositories Copy linkLink copied!
The following Helm values control how the image builder worker accesses RPM content. Defaults apply when you use the public repository; set the values below when you use subscription-managed repositories.
| Parameter | Default | Description |
|---|---|---|
|
|
|
Set to |
|
|
empty |
Repository identifier passed to |
|
|
empty |
Kubernetes secret mounted at |
|
|
empty |
Kubernetes secret whose files appear under |
|
|
empty |
Kubernetes secret that contains Subscription Manager configuration under |
|
|
empty |
Kubernetes secret mounted at |
Troubleshooting Copy linkLink copied!
If image builds fail with a package or subscription error, use the following checks:
- Package not found: Confirm network access to Red Hat CDN or your mirrors. Verify that
rpmRepoEnablematches a repository that is enabled for your entitlement. - Subscription or entitlement errors: Verify that each secret exists in the release namespace and that the entitlement key paths in
redhat.repomatch the sanitized names. - Worker logs: Run
kubectl logs deployment/flightctl-imagebuilder-worker -n <project_name>. - Build fails with an
RLIMIT_NOFILEerror: The host’s open-file-descriptor limit is lower than the build container requires. See Troubleshooting image builds that fail with an RLIMIT_NOFILE error in the Additional resources section. - Unauthorized registry errors for builder service images: If builds fail when pulling
podman,bootc-image-builder, orsyftfrom an authenticated mirror, mountauth.jsonat/root/.config/containers/auth.jsonin the worker. Theglobal.imagePullSecretNamevalue authenticates the worker pod image only. Configure registry authentication for builder service images as described in Additional resources.