S3 Storage Configuration
This document describes how to configure S3-compatible storage (such as Ceph) for Tekton Results log archival.
TOC
OverviewKey BenefitsPrerequisitesStorage System RequirementsPermissionsConfiguration OverviewConfiguration Parameters ReferenceS3-Specific Parameters in SecretParameter DetailsBasic Configuration1. Prepare Your S3 Storage2. Create S3 Credentials Secret3. Configure TektonConfig Resource4. Apply the ConfigurationAdvanced ConfigurationCustom Multipart SizeCeph-Specific ConfigurationComplete Production Configuration ExampleMinIO-Specific Configuration ExampleMax Log Size ConfigurationFeature Gate ConfigurationMax Log Size Configuration ExampleOperationsUpdating S3 ConfigurationVerification CommandsBest PracticesSecurity ConsiderationsPerformance OptimizationStorage ManagementNaming ConventionsOperational RecommendationsS3-Compatible Storage Specific RecommendationsSecurity ConsiderationsCredential ManagementNetwork SecurityMonitoring and AuditingTroubleshootingCommon IssuesSecurity-Related IssuesDiagnostic CommandsVerification StepsLog AnalysisPerformance IssuesOverview
Tekton Results supports storing archived logs in S3-compatible object storage systems like Ceph, AWS S3, MinIO, etc. This provides a scalable and durable solution for long-term log retention, replacing less efficient storage mechanisms like PVC-based storage.
Key Benefits
- Scalability: Object storage scales horizontally without the limitations of block storage
- Durability: Built-in redundancy and replication in object storage systems
- Cost-effectiveness: Lower storage costs compared to persistent volumes
- Long-term retention: Suitable for compliance and historical troubleshooting
Prerequisites
Storage System Requirements
- S3-compatible object storage service (Ceph, AWS S3, MinIO, etc.)
- Access to create buckets and manage credentials
- Network connectivity from your Kubernetes cluster to the S3 endpoint
Permissions
- Ability to create buckets
- Read/write/delete permissions for the designated log bucket
- Proper IAM policies or access controls configured
Configuration Overview
S3 storage configuration for Tekton Results involves two main components:
- S3 credentials and connection parameters are stored in Kubernetes Secrets
- S3 configuration is enabled in the TektonConfig custom resource under
spec.result
Configuration Parameters Reference
S3-Specific Parameters in Secret
Parameter Details
- S3_BUCKET_NAME: The name of the S3 bucket where Tekton logs will be stored. Ensure this bucket exists and has appropriate permissions.
- S3_ENDPOINT: The S3 service endpoint URL. For AWS S3, this can be omitted. For S3-compatible services like Ceph, MinIO, etc., this is required.
- S3_REGION: The region where the S3 service is hosted. For AWS S3, use the appropriate AWS region identifier. For S3-compatible services, use the region identifier configured in your service.
- S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY: Credentials for authenticating with the S3 service.
- S3_HOSTNAME_IMMUTABLE: Used for certain S3-compatible services that require hostname immutability.
- S3_MULTI_PART_SIZE: Defines the size threshold for when to use multipart uploads. Larger values can improve performance for large files.
Basic Configuration
For a basic S3 storage setup, follow these steps:
1. Prepare Your S3 Storage
Before configuring Tekton Results, ensure you have:
- An S3-compatible storage system ready (Ceph, AWS S3, MinIO, etc.)
- A dedicated bucket for Tekton logs
- Valid access credentials with appropriate permissions (read, write, delete)
- Network connectivity from your Kubernetes cluster to the S3 endpoint
2. Create S3 Credentials Secret
Create a Kubernetes Secret containing your S3 credentials and configuration:
Step-by-step creation process:
-
Identify your S3 parameters:
- Bucket name where logs will be stored
- S3 endpoint URL (e.g.,
https://ceph.example.comfor Ceph) - Appropriate region identifier
- Access credentials with read/write/delete permissions
-
Create the secret using kubectl:
Example Output:
-
Verify the secret was created:
Example Output:
3. Configure TektonConfig Resource
Enable S3 storage in your TektonConfig configuration:
You can combine S3 storage configuration with external database configuration for a complete production setup.
4. Apply the Configuration
-
Apply the TektonConfig configuration:
Example Output:
-
Wait for the components to restart:
Example Output:
Example Output:
-
Verify the configuration is active:
Example Output:
Advanced Configuration
Custom Multipart Size
For optimizing upload performance, you can adjust the multipart size:
Ceph-Specific Configuration
When using Ceph as your S3-compatible storage:
- Set
S3_HOSTNAME_IMMUTABLEto"true"if required by your Ceph configuration - Use the correct endpoint URL provided by your Ceph cluster
- Ensure your Ceph RGW (RADOS Gateway) is properly configured for S3 compatibility
Complete Production Configuration Example
Complete configuration combining S3 storage and external database with detailed explanations:
MinIO-Specific Configuration Example
Configuration example for MinIO object storage:
Max Log Size Configuration
To limit the size of logs stored per TaskRun, you can configure the max-log-size parameter using the spec.result.options field in TektonConfig. IMPORTANT: This feature requires enabling the MaxLogSize feature gate first. This is a enhancement feature (patch-based) and is not currently available in community Tekton Results.
Feature Gate Configuration
Before configuring max-log-size, you need to enable the MaxLogSize feature gate by setting the appropriate feature flags.
To enable the feature gate, you can set the FEATURE_GATES environment variable with MaxLogSize=true:
Another method is to configure the FEATURE_GATES environment variable directly on the tekton-results-api deployment via TektonConfig options:
Note: The MaxLogSize feature flag is typically implemented via the MaxResultSize configuration in the Tekton feature flags (as seen in the FeatureFlags struct), which controls the maximum size of results that can be stored.
Max Log Size Configuration Example
Once the feature gate is enabled, you can configure the max-log-size parameter:
Configuration Details:
- Purpose: Limits the size of each TaskRun log to prevent unbounded storage growth and ensure stable query performance
- Default: 5 MiB (5242880 bytes) is used as the default value
- Behavior: When a TaskRun log exceeds the configured limit, the system preserves the Head of the log and discards the tail. Set
max-log-sizeto "0" to disable this size limit feature and upload the full logs content. - Note: This is an enhancement feature (patch-based) and is not currently available in upstream Tekton Results
- Prerequisite: The MaxLogSize feature gate must be enabled for this functionality to work.
Important Warning
This is an alpha stage feature, the behavior may be changed in the later released version.
Operations
Updating S3 Configuration
After modifying the S3 configuration, you need to restart the Tekton Results components for changes to take effect.
Restart the API server:
Example Output:
Restart the watcher:
Example Output:
Verification Commands
Example Output:
Example Output:
Example Output:
Example Output:
Best Practices
Security Considerations
- Use dedicated credentials: Create specific S3 credentials for Tekton Results with minimal required permissions (read, write, delete on the specific bucket)
- Secure credential storage: Store credentials in Kubernetes Secrets, not in plain text configuration files
- Regular credential rotation: Implement a process to rotate S3 access keys periodically (e.g., quarterly)
- Network security: Ensure secure network connectivity between cluster and S3 endpoint, preferably using private networks or VPNs
- Least privilege principle: Grant only the minimum required permissions to the S3 credentials
- Encryption: Ensure your S3-compatible storage supports server-side encryption for stored logs
Performance Optimization
- Proper multipart size: Adjust
S3_MULTI_PART_SIZEbased on your network conditions (default is 5MB, but 10-15MB may be better for high-latency networks) - Bucket placement: Place S3 bucket in the same region as your cluster when possible to minimize latency
- Monitoring: Set up monitoring for S3 storage usage, upload/download performance, and error rates
- Connection pooling: Tekton Results automatically manages connection pooling to S3 services
- Bandwidth considerations: Ensure adequate network bandwidth between your cluster and S3 storage
Storage Management
- Retention policies: Implement S3 bucket lifecycle policies for automatic cleanup of old logs
- Storage classes: Consider using different S3 storage classes for different log retention periods
- Compression: Enable compression on your S3-compatible storage if supported
- Object tagging: Use S3 object tagging to organize logs by namespace, pipeline, or other criteria
Naming Conventions
- Use descriptive bucket names that include environment information (e.g.,
tekton-logs-prod,tekton-logs-staging) - Apply consistent naming for secrets (e.g.,
tekton-results-s3-credentials) - Include environment-specific prefixes when running multiple instances
- Use clear, consistent naming for configuration resources
Operational Recommendations
- Health monitoring: Regularly monitor the health of both Tekton Results components and S3 storage connectivity
- Backup strategies: While S3 provides durability, ensure you have procedures for accessing logs in case of system failures
- Capacity planning: Plan for log storage growth based on your typical PipelineRun/TaskRun volume
- Testing: Regularly test log retrieval functionality to ensure S3 connectivity remains operational
- Documentation: Maintain updated documentation of your S3 endpoint details and access procedures
S3-Compatible Storage Specific Recommendations
- Ceph: Ensure your Ceph RGW is properly configured and tested for S3 compatibility
- MinIO: Verify MinIO server settings for optimal performance with Tekton Results
- AWS S3: Review AWS IAM policies and ensure proper cross-account access if applicable
- Performance tuning: Different S3-compatible storage systems may require different multipart sizes or connection settings
Security Considerations
Credential Management
- Secure Storage: Store S3 credentials in Kubernetes Secrets, never in plain text configuration files
- Access Control: Restrict access to the secrets containing S3 credentials using RBAC
- Rotation Process: Implement a regular rotation schedule for S3 access credentials
- Principle of Least Privilege: Grant only the minimum required permissions (read, write, delete on the specific bucket)
Network Security
- Encrypted Connections: Always use HTTPS/SSL for connections to S3-compatible storage
- Private Networks: Where possible, use private networks or VPNs to connect to S3 endpoints
- Firewall Rules: Configure appropriate firewall rules to restrict access to S3 endpoints
- Certificate Validation: Ensure proper certificate validation is configured for SSL connections
Monitoring and Auditing
- Access Logging: Enable access logging on your S3-compatible storage to track operations
- Anomaly Detection: Monitor for unusual access patterns or failed authentication attempts
- Audit Trails: Maintain audit trails for credential access and configuration changes
- Security Alerts: Set up alerts for security-related events
Troubleshooting
Common Issues
-
S3 Connection Errors:
- Verify S3 endpoint URL is correct and accessible
- Check network connectivity from cluster to S3 endpoint
- Validate SSL certificates if using HTTPS
- Confirm the endpoint is reachable from inside the cluster
-
Authentication Failures:
- Confirm access key and secret key are correct
- Verify IAM policies grant required permissions
- Check region configuration matches S3 service region
- Ensure credentials haven't expired or been rotated
-
Permission Denied:
- Ensure credentials have read/write/delete permissions on the bucket
- Verify bucket policies allow access from your cluster
- Check if bucket exists and is accessible with provided credentials
-
Slow Log Uploads:
- Adjust multipart size for optimal performance
- Check network bandwidth between cluster and S3 endpoint
- Verify S3 service performance
- Monitor for network congestion or throttling
-
Missing Logs:
- Verify that the watcher component is properly capturing logs
- Check if logs are being stored in S3 but not accessible through the API
- Confirm retention policies aren't prematurely removing logs
-
Configuration Issues:
- Ensure all required S3 parameters are correctly specified
- Verify that the TektonConfig resource is properly configured
- Check that secrets are correctly formatted and accessible
Security-Related Issues
-
Credential Exposure:
- Check that secrets are not exposed in logs or error messages
- Verify that credentials are not stored in configuration files
- Ensure RBAC policies properly restrict access to sensitive resources
-
Unauthorized Access:
- Monitor for unexpected access patterns
- Verify that only authorized services can access the S3 storage
- Check that authentication is properly enforced
Diagnostic Commands
Example Output:
Example Output:
Example Output:
Example Output:
Example Output:
Example Output:
Example Output:
Verification Steps
-
Verify Components Are Running:
Example Output:
-
Create PipelineRun for Log Upload:
Example Output:
-
Validate S3 Connectivity:
- Check if logs appear in your S3 bucket
- Verify the log structure matches expectations
- Confirm retention policies are working as expected
Log Analysis
Monitor these key logs to troubleshoot S3 configuration:
- Tekton Results API logs for S3 upload/download operations
- Tekton Results Watcher logs for initial log capture and forwarding
- S3 service logs (if available) to confirm object creation/deletion
- Kubernetes event logs for any resource-related issues
Look for specific error patterns:
- Authentication failures
- Connection timeouts
- Permission errors
- Network connectivity issues
- SSL/TLS handshake failures
Performance Issues
If experiencing performance issues:
-
Check resource utilization:
Example Output:
-
Monitor network performance:
- Check bandwidth between cluster and S3 endpoint
- Monitor for packet loss or high latency
-
Adjust multipart settings:
- Increase
S3_MULTI_PART_SIZEfor better performance on high-latency networks - Consider tuning worker pool sizes if processing large volumes of logs
- Increase