## Summary Implements support for private OCI registry and Git repository credentials in platform sources. Adds `--platform-source-secret` flag to the operator and corresponding Helm chart parameter. Closes #2455 ## Changes ### Operator (`cmd/cozystack-operator/main.go`) - Added `--platform-source-secret` flag for specifying Secret name - Updated `generateOCIRepository()` to set `spec.secretRef` when secret is provided - Updated `generateGitRepository()` to set `spec.secretRef` when secret is provided - Secret is expected to be in `cozy-system` namespace ### Helm Chart - **`packages/core/installer/values.yaml`**: Added `cozystackOperator.platformSourceSecret` parameter with documentation - **`packages/core/installer/templates/cozystack-operator.yaml`**: Pass `--platform-source-secret` flag to operator container ## Usage Example ### For private OCI registry (e.g., GitLab Container Registry): ```bash # Create registry credentials secret kubectl create secret docker-registry gitlab-registry-creds \ --namespace cozy-system \ --docker-server=registry.gitlab.example.com \ --docker-username=<username> \ --docker-password=<token> ``` ```yaml # Helm values cozystackOperator: platformSourceUrl: 'oci://registry.gitlab.example.com/mygroup/cozystack-packages' platformSourceRef: 'tag=v1.0.0' platformSourceSecret: 'gitlab-registry-creds' ``` ### For private Git repository: ```bash # Create Git credentials secret (SSH key or basic auth) kubectl create secret generic git-creds \ --namespace cozy-system \ --from-literal=username=<username> \ --from-literal=password=<token> ``` ```yaml # Helm values cozystackOperator: platformSourceUrl: 'https://github.com/private-org/cozystack-packages' platformSourceRef: 'branch=main' platformSourceSecret: 'git-creds' ``` ## Testing Manually verified: - OCIRepository resource is created with `spec.secretRef` when secret name is provided - GitRepository resource is created with `spec.secretRef` when secret name is provided - Resources are created without `spec.secretRef` when secret name is empty (backward compatible) - Helm chart renders correctly with and without `platformSourceSecret` parameter ## Checklist - [x] Code follows project style and conventions - [x] Operator supports both OCI and Git source types - [x] Helm chart parameter documented with comments - [x] Backward compatible (empty secret name is handled correctly) - [x] Closes referenced issue (#2455) ## Release note ```release-note feat(operator): add `--platform-source-secret` flag to authenticate the platform package source against private OCI registries (kubernetes.io/dockerconfigjson) and private Git repositories (basic-auth, bearer token, or SSH key). Empty value preserves existing public-registry behaviour. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for configuring a Kubernetes Secret for the platform source. * Installer settings and startup options now let you provide a secret name for Flux source credentials. * **Bug Fixes** * Generated platform source resources can now reference the provided Secret, enabling authenticated access for OCI and Git sources. * **Documentation** * Updated configuration docs to explain the new secret setting and required secret format. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Cozystack
Cozystack is a free platform and framework for building clouds.
Cozystack is a CNCF Sandbox Level Project that was originally built and sponsored by Ænix.
With Cozystack, you can transform a bunch of servers into an intelligent system with a simple REST API for spawning Kubernetes clusters, Database-as-a-Service, virtual machines, load balancers, HTTP caching services, and other services with ease.
Use Cozystack to build your own cloud or provide a cost-effective development environment.
Use-Cases
-
Using Cozystack to build a public cloud
You can use Cozystack as a backend for a public cloud -
Using Cozystack to build a private cloud
You can use Cozystack as a platform to build a private cloud powered by Infrastructure-as-Code approach -
Using Cozystack as a Kubernetes distribution
You can use Cozystack as a Kubernetes distribution for Bare Metal
Documentation
The documentation is located on the cozystack.io website.
Read the Getting Started section for a quick start.
If you encounter any difficulties, start with the troubleshooting guide and work your way through the process that we've outlined.
Versioning
Versioning adheres to the Semantic Versioning principles.
A full list of the available releases is available in the GitHub repository's Release section.
Contributions
Contributions are highly appreciated and very welcomed!
In case of bugs, please check if the issue has already been opened by checking the GitHub Issues section. If it isn't, you can open a new one. A detailed report will help us replicate it, assess it, and work on a fix.
You can express your intention to on the fix on your own. Commits are used to generate the changelog, and their author will be referenced in it.
If you have a concrete feature request, open an issue. For a cross-cutting or architectural change, open a design proposal in the community repo. For questions or early ideas, use GitHub Discussions. See CONTRIBUTING.md for the full routing.
Community
You are welcome to join our Telegram group and come to our weekly community meetings. Add them to your Google Calendar or iCal for convenience.
License
Cozystack is licensed under Apache 2.0.
The code is provided as-is with no warranties.
Commercial Support
A list of companies providing commercial support for this project can be found on official site.
