Skip to content

Conversation

@kvaps
Copy link
Member

@kvaps kvaps commented Dec 9, 2025

What this PR does

Separates the assets server from the main cozystack installer into a dedicated StatefulSet deployment. This improves separation of concerns and allows the assets server to run independently from the installer.

Changes:

  • Created new cozystack-assets StatefulSet in the platform package
  • Added dedicated Dockerfile for assets server image (packages/core/platform/images/cozystack-assets/Dockerfile)
  • Removed assets server container and Service from installer deployment
  • Updated HelmRepository URLs to point to new cozystack-assets service
  • Updated dashboard URLs in monitoring package to use new service
  • Added image build target to platform Makefile
  • Configured assets server with hostNetwork and proper RBAC permissions

Release note

[platform] Separate assets server into dedicated StatefulSet deployment

Summary by CodeRabbit

  • Chores
    • Refactored assets server deployment architecture: separated the assets server into a dedicated, independently deployable service for improved scalability and maintainability.
    • Updated Helm repository and dashboard service endpoints to use the new assets service location.

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This PR refactors the assets server from a sidecar container within the main cozystack deployment to a standalone StatefulSet. It removes assets-related build steps from the cozystack Dockerfile, creates a dedicated assets service and image, and updates repository and dashboard URLs to reference the new cozystack-assets service endpoint.

Changes

Cohort / File(s) Summary
Cozystack installer image cleanup
packages/core/installer/images/cozystack/Dockerfile
Removed build steps for cozystack-assets-server binary and make repos artifact generation; removed COPY instructions for repos, dashboards, and assets-server into final image
Cozystack deployment restructuring
packages/core/installer/templates/cozystack.yaml
Removed assets container from cozystack Deployment; removed standalone cozystack Service resource from cozy-system namespace
New assets server deployment
packages/core/platform/templates/cozystack-assets.yaml
Added StatefulSet (cozystack-assets) with 1 replica, hostNetwork mode, and container running assets-server on port 8123; added Role and RoleBinding for cozystack-assets-reader RBAC access; added Service exposing port 80 to targetPort 8123
Build infrastructure
packages/core/platform/Makefile
Added image and image-assets make targets; image-assets builds cozystack-assets Docker image, captures digest, updates values.yaml with image reference including digest
Assets server Dockerfile
packages/core/platform/images/cozystack-assets/Dockerfile
Added multistage Dockerfile using golang:1.24-alpine builder to compile cozystack-assets-server static binary, install dependencies, run make repos; final alpine:3.22 image copies binary, repos, and dashboards with entrypoint to assets-server
Configuration and references
packages/core/platform/templates/helmrepos.yaml, packages/extra/monitoring/templates/dashboards.yaml, packages/core/platform/values.yaml
Updated HelmRepository URLs from http://cozystack.cozy-system.svc/repos/{name} to http://cozystack-assets.cozy-system.svc/repos/{name}; updated GrafanaDashboard URL to point to cozystack-assets service; added assets.image entry to values.yaml with SHA256 digest
Build system integration
Makefile
Added concurrent image build step: make -C packages/core/platform image

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • RBAC configuration: Verify Role permissions (get/create/update on pods/proxy) are appropriate for assets-server functionality
  • Dockerfile build flow: Ensure all artifacts (binary, repos, dashboards) are correctly copied and accessible in final image
  • URL consistency: Confirm all references to cozystack assets service are updated across helmrepos, dashboards, and any other manifests
  • Build digest handling: Review image-assets target logic for digest capture and values.yaml update reliability
  • StatefulSet configuration: Validate hostNetwork mode, pod naming (cozystack-assets-0), and toleration settings

Possibly Related PRs

Suggested Reviewers

  • nbykov0
  • lllamnyp

Poem

🐰 The assets hop away, so spry and free,
From cozystack's embrace to their own tree,
A StatefulSet now holds them with care,
While URLs dance through the air,
Assets thrive solo, services gleam! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title clearly and concisely summarizes the main architectural change: separating the assets server into a dedicated deployment, which aligns with all file modifications across the Dockerfile, templates, and build configuration.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c48f6a and b1ba1f2.

📒 Files selected for processing (9)
  • Makefile (1 hunks)
  • packages/core/installer/images/cozystack/Dockerfile (0 hunks)
  • packages/core/installer/templates/cozystack.yaml (0 hunks)
  • packages/core/platform/Makefile (2 hunks)
  • packages/core/platform/images/cozystack-assets/Dockerfile (1 hunks)
  • packages/core/platform/templates/cozystack-assets.yaml (1 hunks)
  • packages/core/platform/templates/helmrepos.yaml (3 hunks)
  • packages/core/platform/values.yaml (1 hunks)
  • packages/extra/monitoring/templates/dashboards.yaml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the cozystack platform by isolating the asset serving logic into a standalone Kubernetes StatefulSet. This architectural change enhances modularity and security by enforcing HTTPS communication for asset retrieval through the Kubernetes API proxy, backed by newly implemented automated TLS certificate management. The modifications span across the installer, core platform configurations, and monitoring components to seamlessly integrate this new dedicated service.

Highlights

  • Dedicated Assets Server: The asset serving functionality has been extracted from the main cozystack deployment into a new, dedicated Kubernetes StatefulSet named cozystack-assets. This component is responsible solely for serving assets.
  • Secure Asset Access: Access to Helm repositories and other assets is now secured using HTTPS via the Kubernetes API proxy. This involves generating and utilizing TLS certificates for authentication and encryption.
  • Automated Certificate Management: A new script, issue-flux-certificates.sh, has been introduced to automate the generation of client TLS certificates for the cozystack-assets-reader and create corresponding Kubernetes secrets in both cozy-system and cozy-public namespaces.
  • Installer and Configuration Updates: The installer now includes openssl for certificate operations and calls the new certificate generation script. Helm repository URLs and Grafana dashboard configurations have been updated to point to the new secure cozystack-assets service.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kvaps kvaps force-pushed the separate-asset-server branch from f677d58 to f674837 Compare December 9, 2025 19:51
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively separates the assets server into its own dedicated workload, which is a good step towards modularity. The changes involve creating a new StatefulSet for the assets server, updating Helm repository URLs to use the Kubernetes API proxy, and adding a script to generate the necessary client certificates for Flux.

My review has identified a few issues that should be addressed:

  • A critical issue in the new Helm helper template that could prevent Flux from syncing repositories.
  • A bug in the certificate generation script that prevents cleanup of temporary files.
  • A duplicated and misleadingly named Kubernetes manifest.
  • Some opportunities for code cleanup and to improve the robustness of the Kubernetes resource definitions.

Overall, the direction is good, but the implementation needs some refinement.

Comment on lines 24 to 48
{{- define "cozystack.kubernetesAPIEndpoint" -}}
{{- $cozyDeployment := lookup "apps/v1" "Deployment" "cozy-system" "cozystack" }}
{{- $cozyContainers := dig "spec" "template" "spec" "containers" list $cozyDeployment }}
{{- $kubernetesServiceHost := "" }}
{{- $kubernetesServicePort := "" }}
{{- range $cozyContainers }}
{{- if eq .name "cozystack" }}
{{- range .env }}
{{- if eq .name "KUBERNETES_SERVICE_HOST" }}
{{- $kubernetesServiceHost = .value }}
{{- end }}
{{- if eq .name "KUBERNETES_SERVICE_PORT" }}
{{- $kubernetesServicePort = .value }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq $kubernetesServiceHost "" }}
{{- $kubernetesServiceHost = "kubernetes.default.svc" }}
{{- end }}
{{- if eq $kubernetesServicePort "" }}
{{- $kubernetesServicePort = "443" }}
{{- end }}
{{- printf "%s:%s" $kubernetesServiceHost $kubernetesServicePort }}
{{- end -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The logic in this helper to determine the Kubernetes API endpoint is overly complex and likely incorrect. It attempts to read the KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT environment variables from the cozystack deployment, which are set to localhost and 7445. This will result in Flux's source-controller trying to connect to localhost:7445 to reach the API server, which will fail.

The standard way to access the API server from within a cluster is via the kubernetes.default.svc service on port 443. The helper should be simplified to use these values directly.

I suggest replacing the entire cozystack.kubernetesAPIEndpoint definition with:

{{- define "cozystack.kubernetesAPIEndpoint" -}}
{{- printf "kubernetes.default.svc:443" -}}
{{- end -}}


# make temp directory and cleanup handler
TMPDIR=$(mktemp -d)
trap "echo rm -rf $TMPDIR" EXIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The trap command is configured to echo the cleanup command instead of executing it. This means the temporary directory created by mktemp will not be removed when the script exits, leaving orphaned files on the system. The echo should be removed.

Suggested change
trap "echo rm -rf $TMPDIR" EXIT
trap "rm -rf $TMPDIR" EXIT

Comment on lines 32 to 35
IMAGE="$(REGISTRY)/installer:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/installer.json -o json -r)" \
yq -i '.cozystack.image = strenv(IMAGE)' values.yaml
IMAGE="$(REGISTRY)/installer:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/installer.json -o json -r)" \
yq -i '.cozystack.image = strenv(IMAGE)' ../platform/values.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is code duplication here. The IMAGE variable is being constructed twice, and the yq command is run in two separate steps. This can be simplified to make it more readable and maintainable by calculating the image string once and applying it to both files in a more concise way. You could combine these into a single command since yq can operate on multiple files.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (5)
packages/core/installer/Makefile (1)

32-35: Consider consolidating the duplicate image update commands.

The same IMAGE variable construction and yq update pattern is repeated for two different files. This duplication could be simplified for better maintainability.

packages/core/platform/templates/_helpers.tpl (1)

24-48: Reconsider the API endpoint resolution logic.

Reading KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT from the cozystack Deployment's environment variables may return values configured for that specific pod (e.g., localhost:7445), which will not be reachable from other pods like Flux's source-controller. The standard approach is to use kubernetes.default.svc:443 directly.

packages/core/platform/templates/daemonset-assets-server.yaml (1)

1-76: Address file duplication and misleading filename.

This file appears to duplicate resources from packages/core/platform/templates/cozystack-assets.yaml, and the filename daemonset-assets-server.yaml is misleading since it defines a StatefulSet, not a DaemonSet.

scripts/issue-flux-certificates.sh (1)

14-14: Trap statement echoes instead of executing the cleanup command.

The echo keyword causes the cleanup command to be printed rather than executed, preventing the temporary directory from being removed on script exit. This will leave orphaned files on the system.

Apply this diff to fix the trap statement:

-trap "echo rm -rf $TMPDIR" EXIT
+trap "rm -rf $TMPDIR" EXIT
packages/core/platform/templates/cozystack-assets.yaml (1)

31-32: Wildcard toleration permits unnecessary node taints.

The toleration operator: Exists without a key acts as a wildcard that makes the pod tolerate all taints on all nodes. This can result in unwanted scheduling on nodes with undesirable taints.

Specify tolerations explicitly for only the necessary taints, for example:

-      tolerations:
-      - operator: Exists
+      tolerations:
+      - key: "node.kubernetes.io/not-ready"
+        operator: "Exists"
+        effect: "NoSchedule"
+      - key: "node.cilium.io/agent-not-ready"
+        operator: "Exists"
+        effect: "NoSchedule"
🧹 Nitpick comments (2)
packages/core/platform/templates/daemonset-assets-server.yaml (2)

40-48: Tightly coupled RBAC to specific pod name.

The RBAC role grants permissions specifically to cozystack-assets-0 (line 44), which tightly couples the authorization to StatefulSet naming conventions. If the StatefulSet is recreated or scaled, this could break.

Consider whether this tight coupling is intentional for security isolation or if a label selector approach would be more flexible.


20-30: Consider adding resource limits and requests.

The container specification lacks resource limits and requests. This can lead to resource contention and unpredictable behavior under load.

Apply this diff to add resource constraints:

       - name: assets-server
         image: "{{ .Values.cozystack.image }}"
         command:
         - /usr/bin/cozystack-assets-server
         - "-dir=/cozystack/assets"
         - "-address=:8123"
+        resources:
+          requests:
+            cpu: 100m
+            memory: 128Mi
+          limits:
+            cpu: 500m
+            memory: 512Mi
         ports:
         - name: http
           containerPort: 8123
           hostPort: 8123
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8513dd6 and f674837.

📒 Files selected for processing (11)
  • packages/core/installer/Makefile (1 hunks)
  • packages/core/installer/images/cozystack/Dockerfile (1 hunks)
  • packages/core/installer/templates/cozystack.yaml (0 hunks)
  • packages/core/platform/templates/_helpers.tpl (1 hunks)
  • packages/core/platform/templates/cozystack-assets.yaml (1 hunks)
  • packages/core/platform/templates/daemonset-assets-server.yaml (1 hunks)
  • packages/core/platform/templates/helmrepos.yaml (3 hunks)
  • packages/core/platform/values.yaml (1 hunks)
  • packages/extra/monitoring/templates/dashboards.yaml (1 hunks)
  • scripts/installer.sh (1 hunks)
  • scripts/issue-flux-certificates.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/core/installer/templates/cozystack.yaml
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-07-14T16:23:12.803Z
Learnt from: NickVolynkin
Repo: cozystack/cozystack PR: 1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/core/installer/Makefile
📚 Learning: 2025-07-26T18:26:01.447Z
Learnt from: NickVolynkin
Repo: cozystack/cozystack PR: 1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/templates/dashboards.yaml
📚 Learning: 2025-07-11T06:11:25.438Z
Learnt from: lllamnyp
Repo: cozystack/cozystack PR: 1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/core/platform/templates/_helpers.tpl
📚 Learning: 2025-06-26T04:29:24.830Z
Learnt from: NickVolynkin
Repo: cozystack/cozystack PR: 1117
File: packages/apps/mysql/Makefile:8-8
Timestamp: 2025-06-26T04:29:24.830Z
Learning: The cozystack project uses yq v4+ on their CI runner, so yq v4 syntax (-o json --indent 4) is compatible and version checks are not needed.

Applied to files:

  • packages/core/platform/values.yaml
🪛 Shellcheck (0.11.0)
scripts/issue-flux-certificates.sh

[warning] 14-14: Use single quotes, otherwise this expands now rather than when signalled.

(SC2064)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (5)
packages/core/installer/images/cozystack/Dockerfile (1)

37-37: LGTM!

The addition of openssl is appropriate for the TLS certificate provisioning workflow introduced in this PR.

packages/core/platform/values.yaml (1)

1-2: LGTM!

The image reference with SHA256 digest pinning provides immutability and security. The value is correctly propagated from the Makefile.

packages/extra/monitoring/templates/dashboards.yaml (1)

14-14: Service endpoint is correctly configured.

The cozystack-assets.cozy-system.svc endpoint aligns with the properly defined StatefulSet and Service in packages/core/platform/templates/cozystack-assets.yaml. The Service (name: cozystack-assets, namespace: cozy-system) correctly selects pods with the label app: cozystack-assets and maps port 80 to the container port 8123 where the assets server listens. The endpoint is reachable within the cluster.

packages/core/platform/templates/helmrepos.yaml (1)

12-13: TLS secret provisioning order is correctly implemented in the installation sequence.

The issue-flux-certificates.sh script is called in scripts/installer.sh (line 73) before the platform chart is deployed (line 76), ensuring that the cozystack-assets-tls secrets are created in both cozy-system and cozy-public namespaces before the HelmRepository resources are reconciled by Flux. The script creates the secrets with the required TLS certificate and key files that the HelmRepository resources reference via certSecretRef.

packages/core/platform/templates/cozystack-assets.yaml (1)

22-22: > Likely an incorrect or invalid review comment.

@kvaps kvaps force-pushed the separate-asset-server branch 5 times, most recently from 99a3152 to 3c48f6a Compare December 9, 2025 21:11
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
packages/core/platform/templates/cozystack-assets.yaml (1)

31-32: Overly permissive toleration. The toleration operator: Exists without a key acts as a wildcard that allows the pod to tolerate all taints, including undesirable ones. Prior review feedback recommended explicit tolerations.

Consider using specific tolerations that align with the target environment:

      tolerations:
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoSchedule"
      - key: "node.cilium.io/agent-not-ready"
        operator: "Exists"
        effect: "NoSchedule"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f674837 and 3c48f6a.

📒 Files selected for processing (10)
  • Makefile (1 hunks)
  • packages/core/installer/images/cozystack/Dockerfile (1 hunks)
  • packages/core/installer/templates/cozystack.yaml (0 hunks)
  • packages/core/platform/Makefile (2 hunks)
  • packages/core/platform/images/cozystack-assets/Dockerfile (1 hunks)
  • packages/core/platform/templates/assets-server.yaml (1 hunks)
  • packages/core/platform/templates/cozystack-assets.yaml (1 hunks)
  • packages/core/platform/templates/helmrepos.yaml (3 hunks)
  • packages/core/platform/values.yaml (1 hunks)
  • packages/extra/monitoring/templates/dashboards.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/core/installer/templates/cozystack.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core/platform/values.yaml
  • packages/core/platform/templates/helmrepos.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-26T18:26:01.447Z
Learnt from: NickVolynkin
Repo: cozystack/cozystack PR: 1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/templates/dashboards.yaml
🪛 checkmake (0.2.2)
packages/core/platform/Makefile

[warning] 24-24: Target "image" should be declared PHONY.

(phonydeclared)

🔇 Additional comments (5)
Makefile (1)

29-29: LGTM. The addition of the platform image build is correctly integrated into the main build target.

packages/extra/monitoring/templates/dashboards.yaml (1)

14-14: LGTM. The dashboard backend URL correctly points to the new assets service endpoint.

packages/core/installer/images/cozystack/Dockerfile (1)

33-33: LGTM. Addition of openssl is appropriate for the installer, and removal of assets-related artifacts aligns with the separation of concerns.

packages/core/platform/images/cozystack-assets/Dockerfile (1)

1-25: LGTM. The multistage Dockerfile correctly builds the assets server static binary and packages assets/dashboards for the final image.

packages/core/platform/Makefile (1)

25-34: LGTM. The image-assets target correctly orchestrates the Docker build, captures the image digest, and updates values.yaml with the new image reference, enabling the assets server deployment to reference the freshly built image.

@kvaps kvaps force-pushed the separate-asset-server branch 2 times, most recently from 61161dc to 4f95309 Compare December 9, 2025 21:17
@kvaps kvaps changed the title [platform] Separate assets server into dedicated daemonset [platform] Separate assets server into dedicated deployment Dec 9, 2025
Comment on lines +6 to +7
RUN apk add --no-cache make git
RUN apk add helm --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this does is server static assets, right? Do we need these packages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need.
Helm and make are used to generate index

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 10, 2025
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps force-pushed the separate-asset-server branch from b5d1fb2 to b1ba1f2 Compare December 10, 2025 18:26
@kvaps kvaps merged commit 680f70c into main Dec 10, 2025
2 checks passed
@kvaps kvaps deleted the separate-asset-server branch December 10, 2025 18:26
kvaps added a commit that referenced this pull request Dec 10, 2025
This change is extracted from
- #1641

and reworked to work standalone

requires:

- #1705


## What this PR does

Adds a new `flux-aio` module and migration script to upgrade FluxCD to
version 22. This introduces a new modular approach to FluxCD
installation using the flux-aio OCI module.

Changes:
- Created new `flux-aio` package with Chart.yaml, Makefile, and CUE
configuration
- Added flux-aio module configuration using OCI module from
`ghcr.io/stefanprodan/modules/flux-aio`
- Generated large fluxcd.yaml template (11956+ lines) for FluxCD
resources
- Added migration script (migrations/21) to handle upgrade from version
21 to 22
- Updated installer to include flux-aio module
- Added script `issue-flux-certificates.sh` for managing TLS
certificates for cozystack-assets
- Updated platform templates to support flux-aio module
- Updated cozystack-assets service references

### Release note

```release-note
[fluxcd] Add flux-aio module and migration
```



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added TLS certificate support for Helm package repositories with
automatic certificate provisioning.

* **Chores**
  * Refactored FluxCD integration using Helm chart-based deployment.
  * Updated system to version 22 with automatic migration support.
  * Enhanced security dependencies (OpenSSL).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 8, 2026
kvaps added a commit that referenced this pull request Jan 9, 2026
Separates the assets server from the main cozystack installer into a
dedicated StatefulSet deployment. This improves separation of concerns
and allows the assets server to run independently from the installer.

Changes:
- Created new `cozystack-assets` StatefulSet in the platform package
- Added dedicated Dockerfile for assets server image
(`packages/core/platform/images/cozystack-assets/Dockerfile`)
- Removed assets server container and Service from installer deployment
- Updated HelmRepository URLs to point to new `cozystack-assets` service
- Updated dashboard URLs in monitoring package to use new service
- Added image build target to platform Makefile
- Configured assets server with hostNetwork and proper RBAC permissions

```release-note
[platform] Separate assets server into dedicated StatefulSet deployment
```
kvaps added a commit that referenced this pull request Jan 9, 2026
This change is extracted from
- #1641

and reworked to work standalone

requires:

- #1705

Adds a new `flux-aio` module and migration script to upgrade FluxCD to
version 22. This introduces a new modular approach to FluxCD
installation using the flux-aio OCI module.

Changes:
- Created new `flux-aio` package with Chart.yaml, Makefile, and CUE
configuration
- Added flux-aio module configuration using OCI module from
`ghcr.io/stefanprodan/modules/flux-aio`
- Generated large fluxcd.yaml template (11956+ lines) for FluxCD
resources
- Added migration script (migrations/21) to handle upgrade from version
21 to 22
- Updated installer to include flux-aio module
- Added script `issue-flux-certificates.sh` for managing TLS
certificates for cozystack-assets
- Updated platform templates to support flux-aio module
- Updated cozystack-assets service references

```release-note
[fluxcd] Add flux-aio module and migration
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added TLS certificate support for Helm package repositories with
automatic certificate provisioning.

* **Chores**
  * Refactored FluxCD integration using Helm chart-based deployment.
  * Updated system to version 22 with automatic migration support.
  * Enhanced security dependencies (OpenSSL).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kvaps added a commit that referenced this pull request Jan 9, 2026
## What this PR does

Separates the assets server from the main cozystack installer into a
dedicated StatefulSet deployment. This improves separation of concerns
and allows the assets server to run independently from the installer.

Changes:
- Created new `cozystack-assets` StatefulSet in the platform package
- Added dedicated Dockerfile for assets server image
(`packages/core/platform/images/cozystack-assets/Dockerfile`)
- Removed assets server container and Service from installer deployment
- Updated HelmRepository URLs to point to new `cozystack-assets` service
- Updated dashboard URLs in monitoring package to use new service
- Added image build target to platform Makefile
- Configured assets server with hostNetwork and proper RBAC permissions

### Release note

```release-note
[platform] Separate assets server into dedicated StatefulSet deployment
```
kvaps added a commit that referenced this pull request Jan 9, 2026
This change is extracted from
- #1641

and reworked to work standalone

requires:

- #1705


## What this PR does

Adds a new `flux-aio` module and migration script to upgrade FluxCD to
version 22. This introduces a new modular approach to FluxCD
installation using the flux-aio OCI module.

Changes:
- Created new `flux-aio` package with Chart.yaml, Makefile, and CUE
configuration
- Added flux-aio module configuration using OCI module from
`ghcr.io/stefanprodan/modules/flux-aio`
- Generated large fluxcd.yaml template (11956+ lines) for FluxCD
resources
- Added migration script (migrations/21) to handle upgrade from version
21 to 22
- Updated installer to include flux-aio module
- Added script `issue-flux-certificates.sh` for managing TLS
certificates for cozystack-assets
- Updated platform templates to support flux-aio module
- Updated cozystack-assets service references

### Release note

```release-note
[fluxcd] Add flux-aio module and migration
```



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added TLS certificate support for Helm package repositories with
automatic certificate provisioning.

* **Chores**
  * Refactored FluxCD integration using Helm chart-based deployment.
  * Updated system to version 22 with automatic migration support.
  * Enhanced security dependencies (OpenSSL).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants