This document provides instructions for deploying and testing the kaniko-builder pipeline.
Before deploying this pipeline, ensure you have:
-
GitLab CI/CD Variables configured:
ECR_REGISTRY: Your ECR registry URL (e.g.,123456789.dkr.ecr.us-east-1.amazonaws.com/your-repo)CICD_TAG_AMD64: Runner tag for amd64 builds (e.g.,redacted-sandbox-amd64)CICD_TAG_ARM64: Runner tag for arm64 builds (e.g.,redacted-sandbox-arm64)CICD_TAG: Legacy runner tag for prepare stage (can use either architecture)
-
GitLab Runners:
- AMD64 Runner: Deployed with
redacted-sandbox-amd64tag, node selector for amd64 - ARM64 Runner: Deployed with
redacted-sandbox-arm64tag, node selector for arm64 - ECR authentication configured (ecr-login credential helper)
- Docker-in-Docker or Kaniko support
- Note: See
IMPLEMENTATION_PLAN.mdfor runner deployment details
- AMD64 Runner: Deployed with
-
ECR Repository:
- ECR repository created and accessible
- Proper IAM permissions for push/pull operations
-
Create a test branch:
git checkout -b test-kaniko-build
-
Make a small change to trigger the pipeline:
echo "# Test change" >> kaniko/README.md git add kaniko/README.md git commit -m "Test: trigger kaniko build" git push origin test-kaniko-build
-
Create a merge request to main branch and observe the pipeline execution.
-
Monitor the pipeline stages:
prepare: Should detect thekanikodirectorybuild_arm64: Should build Kaniko for arm64build_amd64: Should build Kaniko for amd64manifest: Should create multi-arch manifest
-
Verify the built images:
# Check if images exist in ECR aws ecr describe-images --repository-name your-repo --region us-east-1
-
Trigger curl build:
echo "# Test curl build" >> curl/README.md git add curl/README.md git commit -m "Test: trigger curl build" git push origin test-kaniko-build
-
Verify both projects build in parallel
- Configure a scheduled pipeline in GitLab CI/CD settings
- Verify it uses
rebuild-weekly.txtto build all projects
After a successful pipeline run, you should have:
-
Kaniko Images:
kaniko-YYYYMMDD-{commit-sha}kaniko-v1.25.3kaniko-latest
-
Curl Images:
curl-YYYYMMDD-{commit-sha}curl-latestcurl-test
-
Multi-arch Support:
- Each image should support both
linux/amd64andlinux/arm64 - Automatic architecture selection when pulling
- Each image should support both
# Test pulling on different architectures
docker pull $ECR_REGISTRY:kaniko-latest
docker inspect $ECR_REGISTRY:kaniko-latest | grep Architecture
# Should show the correct architecture for your platform-
ECR Authentication Failures:
- Verify ECR credentials are configured on runners
- Check IAM permissions for ECR operations
-
Architecture-specific Build Failures:
- Ensure runners support the target architecture
- Verify correct runner tags are configured (
CICD_TAG_AMD64,CICD_TAG_ARM64) - Check if upstream Dockerfile supports multi-arch builds
- Confirm Karpenter can provision nodes of the requested architecture
-
Runner Scheduling Issues:
- Verify architecture-specific runners are deployed and registered
- Check node selectors are correctly configured
- Ensure spot-pool supports both amd64 and arm64 nodes
-
Manifest Creation Failures:
- Verify both architecture builds completed successfully
- Check manifest-tool has proper ECR access
-
prepare_diff.sh Failures:
- Ensure script has execute permissions
- Check git history is available in the pipeline
# Check pipeline artifacts
ls -la *.tag *.tags
# Verify ECR authentication
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $ECR_REGISTRY
# Test manifest-tool locally
manifest-tool inspect $ECR_REGISTRY:kaniko-latest
# Check GitLab runner registration and tags
kubectl get pods -n gitlab-runner -o wide
kubectl logs -n gitlab-runner deployment/gitlab-runner-amd64
kubectl logs -n gitlab-runner deployment/gitlab-runner-arm64
# Verify node architecture availability
kubectl get nodes -o wide --show-labels | grep kubernetes.io/archAfter successful deployment:
- Add more projects by creating new directories with
build-config.yaml - Configure scheduled rebuilds for security updates
- Set up monitoring for build failures
- Consider caching strategies for faster builds
- Can build Kaniko v1.25.3 for arm64
- Can build Kaniko v1.25.3 for amd64
- Multi-arch manifest created and pushed
- Can build curl project with a Dockerfile
- Images pushed to ECR with proper tags
- Pipeline triggered on merge to main
- Documentation explains how to add new projects
- Build Time: Expect 10-20 minutes per architecture for Kaniko
- Parallel Execution: arm64 and amd64 builds run in parallel
- Resource Usage: Each build requires ~2GB RAM, 2 CPU cores
- Storage: Each image ~100-500MB depending on the project