Skip to content

Conversation

@zeroalphat
Copy link
Contributor

@zeroalphat zeroalphat commented Aug 6, 2025

This PR adds the Helm chart for ofen.
The mechanism for releasing the Helm chart will be added in a separate PR.

@zeroalphat zeroalphat self-assigned this Aug 6, 2025
@zeroalphat zeroalphat force-pushed the add-helm-chart branch 2 times, most recently from 52faba1 to e31aed6 Compare August 7, 2025 06:45
@zeroalphat zeroalphat requested a review from Copilot August 7, 2025 06:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a complete Helm chart implementation for the Ofen Kubernetes controller, allowing users to deploy the application via Helm instead of just raw Kubernetes manifests. The changes include generating Helm templates from existing Kustomize configurations and updating resource naming conventions.

  • Renamed service account and related RBAC resources from imageprefetch-controller to controller-manager for consistency
  • Added comprehensive Helm chart under charts/ofen/ with configurable values, templates, and documentation
  • Updated build tooling to generate Helm templates from Kustomize configurations using yq

Reviewed Changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
config/rbac/*.yaml Renamed service account and RBAC resources to use consistent controller-manager naming
config/manager/*.yaml Updated service account references and enabled leader election by default
config/kustomize-to-helm/ Added Kustomize overlays and components for Helm template generation
charts/ofen/ Complete Helm chart implementation with templates, values, documentation, and helper functions
cmd/imageprefetch-controller/main.go Enabled leader election by default for high availability
Makefile Added yq tool and targets for generating Helm templates from Kustomize configurations

Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
@zeroalphat zeroalphat marked this pull request as ready for review August 12, 2025 02:01
@zeroalphat zeroalphat added the enhancement New feature or request label Aug 12, 2025
@zeroalphat zeroalphat requested a review from masa213f August 12, 2025 02:19
Copy link

@masa213f masa213f left a comment

Choose a reason for hiding this comment

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

Sorry for the late review.

I think the PDB for the controller is necessary for actual operation. Please include PDB in helm as well.

Comment on lines +5 to +11
- includeSelectors: true
pairs:
app.kubernetes.io/name: '{{ include "ofen.name" . }}'
- pairs:
app.kubernetes.io/version: '{{ .Chart.AppVersion }}'
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
helm.sh/chart: '{{ include "ofen.chart" . }}'

Choose a reason for hiding this comment

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

Similar labels are defined in multiple places. Is it possible to reduce the definitions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@masa213f
The labels are defined in both .../kustomization.yaml and _helpers.tpl. Am I correct in understanding that you want to use only the definitions from _helpers.tpl, like in the example below?

metadata:
  labels:
    {{- include "ofen.labels" . | nindent 4  }}

I looked into whether this was possible, but it seems difficult to add only the keys to the labels field using tools like yq or Kustomize. Therefore, consolidating them into a single source appears to be challenging.

Copy link

Choose a reason for hiding this comment

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

it seems difficult to add only the keys to the labels field using tools like yq or Kustomize.

Oh, that's right. Thank you for confirming.
The redundancy in charts/ofen/templates/configmap.yaml has been reduced, so that's sufficient.

Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
…nstraints, and priorityClassName in controller values

Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
…sName in daemon values

Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
…oyment templates

Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
Signed-off-by: zeroalphat <taichi-takemura@cybozu.co.jp>
@zeroalphat zeroalphat requested a review from masa213f September 4, 2025 04:50
Copy link

@masa213f masa213f left a comment

Choose a reason for hiding this comment

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

LGTM

@zeroalphat zeroalphat merged commit 6e01cdb into main Sep 4, 2025
5 checks passed
@zeroalphat zeroalphat deleted the add-helm-chart branch September 4, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants