Catalog System
Rancher’s catalog system (CatalogV2) provides a powerful framework for managing Helm chart repositories, deploying applications, and creating custom catalogs. Built on top of Kubernetes custom resources, it enables seamless integration with Helm repositories and OCI registries.Overview
The catalog system consists of several core components:- ClusterRepo: Custom resource representing a Helm chart repository
- Content Manager: Handles retrieval and caching of chart information
- Repository Types: Support for Git, HTTP, and OCI-based repositories
- Index Management: Efficient caching and filtering of chart indexes
Repository Types
Git Repositories
Git-based repositories allow you to host Helm charts in a Git repository. The system automatically clones and updates repositories:- Automatic cloning and fetching
- Branch and commit-based tracking
- Support for private repositories with authentication
- Bundled mode for air-gapped environments
HTTP/HTTPS Repositories
Standard Helm HTTP repositories are fully supported:OCI Registries
Rancher supports OCI-compliant container registries for Helm charts:Chart Index Management
The content manager provides efficient caching and filtering of chart indexes:Index Caching
Chart indexes are cached in ConfigMaps and retrieved through theManager struct:
- Thread-safe index caching
- Automatic cache invalidation based on resource version
- Gzip compression for storage efficiency
- Deep copying to prevent race conditions
Version Filtering
The system automatically filters chart versions based on:- Rancher version constraints:
catalog.cattle.io/rancher-versionannotation - Kubernetes version constraints:
catalog.cattle.io/kube-versionannotation - Helm kubeVersion: Standard Helm
kubeVersionfield
Application Deployment
Retrieving Charts
The catalog system provides methods to retrieve chart information and content:Chart Installation
Charts are deployed using Helm operations: Location:pkg/catalogv2/helmop/operation.go
The system handles:
- Chart installation and upgrades
- Release management
- Rollback operations
- Status tracking
Custom Catalogs
Creating a Custom Repository
-
Prepare your Helm chart repository with an
index.yamlfile - Create a ClusterRepo resource:
- Create authentication secret (if needed):
Adding Version Constraints
Add annotations to your chart’sChart.yaml:
Air-Gapped Environments
For air-gapped deployments, Rancher supports bundled catalogs:Bundled Mode
Set the system catalog to bundled mode:- Charts are included in the Rancher installation
- No external network access required
- Git repositories use local copies
- Icons fall back to UI defaults
Repository Configuration
Authentication Options
HTTP Basic Auth:TLS Configuration
Custom CA Bundle:Catalog Refresh
Repositories are automatically refreshed based on:- ConfigMap updates
- Resource version changes
- Manual refresh triggers
system-feature-chart-refresh-seconds setting (default: 6 hours).
Troubleshooting
Common Issues
Charts not appearing:- Check version constraints in chart annotations
- Verify the
skip-helm-index-filteringsetting - Ensure the index ConfigMap is properly created
- Verify secret exists in the correct namespace
- Check secret format (username/password for HTTP, SSH key for Git)
- Ensure credentials have appropriate permissions
- Add CA bundle for self-signed certificates
- Verify certificate chain is complete
- Check that hostnames match certificate SANs
Debugging
Enable debug logging to troubleshoot catalog issues:Related Resources
- Source Code:
pkg/catalogv2/ - Content Manager:
pkg/catalogv2/content/content.go - Git Operations:
pkg/catalogv2/git/ - Helm Integration:
pkg/catalogv2/helm/ - OCI Support:
pkg/catalogv2/oci/
Best Practices
- Use version constraints to ensure compatibility
- Enable TLS verification for production repositories
- Use secrets for authentication credentials
- Monitor ConfigMap size for large repositories
- Test charts before adding to production catalogs
- Document custom annotations for your charts
- Use semantic versioning for chart versions
- Implement CI/CD for chart repository updates