The Image Management Service (IMS) allows administrators to adjust the log level for image creation and customization jobs. This is useful for troubleshooting and debugging issues during image build or customization processes.
The log level can be changed by editing the IMS ConfigMaps. Different log levels provide varying amounts of detail:
INFO: Standard informational messages (default)WARNING: Warning messages and errors onlyDEBUG: Detailed debug information including API calls, connection details, and internal operationsThe log level can be updated for image creation, image customization, or both.
IMS image creation jobs consist of multiple steps, each running in a separate container. The log level can be adjusted for all steps or for specific steps to debug particular issues.
(ncn-mw#) Edit the IMS image creation ConfigMap:
kubectl -n services edit cm cray-configmap-ims-v2-image-create-kiwi-ng
Locate the log level configuration for the steps to be modified.
There are 4 steps where the log level can be changed:
fetch-recipe: Container that fetches the image recipewait-for-repos: Container that waits for repositories to be readybuild-ca-rpm: Container that builds the CA RPMbuildenv-sidecar: Sidecar container for the build environmentUpdate the LOG_LEVEL value for the desired steps:
- name: LOG_LEVEL
value: "INFO"
Change the value to one of the supported levels: INFO, WARNING, or DEBUG.
Save the changes and exit the editor.
Optionally also Update log level during image customization.
Continue to Apply ConfigMap Changes.
IMS image customization jobs also support log level adjustments for debugging and troubleshooting.
(ncn-mw#) Edit the IMS image customization ConfigMap:
kubectl -n services edit cm cray-configmap-ims-v2-image-customize
Locate the log level configuration for the steps to be modified.
There are two steps where the log level can be changed:
prepare: Container that prepares the image for customizationbuildenv-sidecar: Sidecar container for the build environmentUpdate the LOG_LEVEL value for the desired steps:
- name: LOG_LEVEL
value: "INFO"
Change the value to one of the supported levels: INFO, WARNING, or DEBUG.
Save the changes and exit the editor.
Optionally also Update log level during image creation.
Continue to Apply ConfigMap Changes.
After modifying either or both ConfigMaps, follow these steps to apply the changes:
(ncn-mw#) Restart the IMS deployment for changes to take effect:
kubectl rollout restart deploy cray-ims -n services
(ncn-mw#) Verify that the IMS pods are running:
kubectl get pods -n services | grep ims
Wait until all IMS pods show a Running status.
Create an image creation or customization job and observe the log entries in the corresponding containers.
When LOG_LEVEL is set to DEBUG for image creation, the fetch-recipe container will display detailed logs similar to:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api-gw-service-nmn.local:443
DEBUG:urllib3.connectionpool:https://api-gw-service-nmn.local:443 "PATCH /apis/ims/jobs/94beba5a-d3b2-4c48-b7e4-ec0f40b2c9c4 HTTP/1.1" 200 1012
DEBUG:/scripts/venv/lib/python3.12/site-packages/ims_python_helper/fetch.py:
When LOG_LEVEL is set to DEBUG for image customization, the prepare container will display detailed logs similar to:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api-gw-service-nmn.local:443
DEBUG:urllib3.connectionpool:https://api-gw-service-nmn.local:443 "PATCH /apis/ims/jobs/89de12e7-c762-4a2d-b937-af091719009c HTTP/1.1" 200 1298
DEBUG:/scripts/venv/lib/python3.12/site-packages/ims_python_helper/fetch.py:
DEBUG log level sparingly and only when troubleshooting specific issues, as it generates significantly more log data.INFO after troubleshooting is complete to reduce log volume.