Enabling caching proxy for builds
Konflux supports HTTP proxy caching to improve build performance. When enabled, container build operations can use a Squid HTTP proxy to cache layers, reducing build times for subsequent builds.
Prerequisites
The caching proxy requires Squid to be installed on the cluster. Cluster administrators can install Squid using the Helm chart from the caching repository.
How it works
The caching proxy feature uses two levels of configuration:
-
Pipeline level: The
enable-cache-proxyparameter controls whether a specific pipeline uses the caching proxy. -
Cluster level: A
cluster-configConfigMap in thekonflux-infonamespace provides the proxy configuration and can disable proxy usage cluster-wide.
The pipeline’s init task reads the configuration and emits HTTP_PROXY and NO_PROXY values to be used by the buildah task.
Enabling the caching proxy
The caching proxy is disabled by default. To enable the caching proxy for a component’s build pipeline, set the enable-cache-proxy pipeline parameter to true.
-
In the PipelineRun YAML files in the
.tektondirectory, set theenable-cache-proxyparameter totruein thespec.paramssection:spec: params: - name: enable-cache-proxy value: "true" -
Commit your changes to the repository of the component.
Cluster-level configuration
The caching proxy behavior can be configured at the cluster level using a ConfigMap named cluster-config in the konflux-info namespace. This ConfigMap is globally readable from all namespaces in the cluster, but writable only by the infrastructure team.
The ConfigMap supports the following keys:
allow-cache-proxy-
When set to
false, disables the caching proxy for all pipelines in the cluster, regardless of individual pipeline settings. When set totrueor unset, pipelines can use the proxy if they haveenable-cache-proxyset totrue.data: allow-cache-proxy: "true" http-proxy-
The HTTP proxy URL to use for builds. If not set, defaults to
squid.caching.svc.cluster.local:3128.data: http-proxy: "squid.caching.svc.cluster.local:3128" no-proxy-
A comma-separated list of hosts that should bypass the proxy. If not set, the init task uses a default list of common container registries.
data: no-proxy: "quay.io,registry.redhat.io,docker.io"
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-config
namespace: konflux-info
data:
allow-cache-proxy: "true"
http-proxy: "squid.caching.svc.cluster.local:3128"
no-proxy: "quay.io,registry.redhat.io,docker.io"
Configuration precedence
The caching proxy is enabled only when both of the following conditions are met:
-
The pipeline parameter
enable-cache-proxyis set totrue. -
The cluster-level
allow-cache-proxyis either set totrueor is unset.
If allow-cache-proxy is explicitly set to false at the cluster level, the proxy is disabled for all pipelines, even if individual pipelines have enable-cache-proxy set to true.
Supported registries
The caching proxy supports the following container image registries:
-
quay.ioand other registry proxies that use it as a backend (for example,registry.access.redhat.comandregistry.redhat.io) -
docker.io -
nvcr.io -
registry.fedoraproject.org
The following registry hosts are not supported at this time:
-
gcr.io -
*.pkg.dev
Logging
The init task logs the proxy configuration applied to the pipeline run and the reasoning for the applied settings. You can view these logs in the pipeline run’s init task output.
Fetching cluster-config from konflux-info namespace...
Cache proxy enabled (cluster-enabled: true, task-enable: true)
Setting HTTP_PROXY to squid.caching.svc.cluster.local:3128
Setting NO_PROXY to quay.io,registry.redhat.io,docker.io
Fetching cluster-config from konflux-info namespace...
Cache proxy disabled (cluster-enabled: true, task-enable: false)
Setting HTTP_PROXY to
Setting NO_PROXY to
If the cluster-config ConfigMap is not found, the init task logs a warning and proceeds with default values:
Warning: Failed to fetch cluster-config ConfigMap. Proceeding with defaults.
Troubleshooting
If the caching proxy is not working after setting enable-cache-proxy to true, your pipeline YAML may be missing required configuration. The proxy feature requires a complete chain of parameter passing:
-
The
enable-cache-proxypipeline parameter must be defined in the pipeline’sparamssection. -
The
inittask must receive theenable-cache-proxyparameter. -
The
inittask outputshttp-proxyandno-proxyresults. -
The
buildahtask (or variant) must receiveHTTP_PROXYandNO_PROXYparameters that reference theinittask results.
If any part of this chain is missing, the proxy will not work. MintMaker automatically applies these configurations through task migrations.
Checking for missing configuration
-
Check your repository for any unmerged MintMaker pull requests that update the pipeline configuration.
-
Merge any unmerged MintMaker PRs. The migration adds all required parameters automatically.
-
If no MintMaker PR exists, manually add the missing configuration to your pipeline YAML:
-
Add the pipeline parameter
enable-cache-proxy:spec: pipelineSpec: params: - name: enable-cache-proxy default: "false" description: Enable cache proxy configuration type: string -
Add the
enable-cache-proxyparameter to theinittask:tasks: - name: init params: - name: enable-cache-proxy value: $(params.enable-cache-proxy) taskRef: name: init version: "0.2" -
Add the
HTTP_PROXYandNO_PROXYparameters to thebuildahtask (or variant likebuildah-remote,buildah-oci-ta) to receive proxy values from theinittask results:- name: build-container params: - name: HTTP_PROXY value: $(tasks.init.results.http-proxy) - name: NO_PROXY value: $(tasks.init.results.no-proxy) # ... other params taskRef: name: buildah
-
-
Verify that the caching proxy is working by checking the
initandbuildahtask logs for the proxy configuration messages.
Verifying proxy configuration in logs
After enabling the caching proxy, check the task logs to confirm the configuration is applied correctly.
init task log output when cache proxy is enabledFetching cluster-config from konflux-info namespace...
Cache proxy enabled (cluster-enabled: true, task-enable: true)
Setting HTTP_PROXY to squid.caching.svc.cluster.local:3128
Setting NO_PROXY to quay.io,registry.redhat.io,docker.io
buildah task log output when cache proxy is enabled[2026-01-27T10:15:30.123456789+00:00] Setting proxy to squid.caching.svc.cluster.local:3128
[2026-01-27T10:15:30.123456789+00:00] Bypassing proxy for quay.io,registry.redhat.io,docker.io
init task log output when cache proxy is disabledFetching cluster-config from konflux-info namespace...
Cache proxy disabled (cluster-enabled: true, task-enable: false)
Setting HTTP_PROXY to
Setting NO_PROXY to
If you see only "Unsetting proxy" messages without the preceding "Setting proxy" messages in the buildah task logs, the HTTP_PROXY and NO_PROXY parameters may not be correctly wired from the init task results.