Skip to content

feat: add Helm chart scaffolding and core templates#155

Open
Venkatesh1505 wants to merge 9 commits into
kubernetes-sigs:mainfrom
Venkatesh1505:feat/helm-chart-scaffold
Open

feat: add Helm chart scaffolding and core templates#155
Venkatesh1505 wants to merge 9 commits into
kubernetes-sigs:mainfrom
Venkatesh1505:feat/helm-chart-scaffold

Conversation

@Venkatesh1505
Copy link
Copy Markdown
Contributor

What this PR does

Adds an initial Helm chart under dist/chart/ that produces the same resources as the current kustomize deployment with default values.

Closes #132

Resources included

  • CRD (crds/mcp.x-k8s.io_mcpservers.yaml) — copied from config/crd/bases/
  • ServiceAccount — conditional via serviceAccount.create
  • RBAC — manager ClusterRole/Binding, leader-election Role/Binding, metrics-auth ClusterRole/Binding, metrics-reader ClusterRole (conditional via
    rbac.create)
  • Deployment — controller manager with hardened security context
  • Metrics Service — port 8443

Configurability (values.yaml)

All values are documented with # -- comments. Key options:

Value Default Description
image.repository mcp-lifecycle-operator Image repo
image.tag "" (uses appVersion) Image tag
replicas 1 Replica count
serviceAccount.create true Create SA
rbac.create true Create RBAC resources
nodeSelector {} Node selector
tolerations [] Tolerations
affinity {} Affinity rules

Validation

  • helm lint — passes
  • helm template — all 10 resources render correctly
  • helm install on Kind cluster — pod 1/1 Running, controller healthy
  • helm install --dry-run — passes

Follow-ups (separate issues)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 6, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit a7ee27e
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a1fd0d96954ce000892b323
😎 Deploy Preview https://deploy-preview-155--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 6, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @Venkatesh1505. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 6, 2026
@Venkatesh1505 Venkatesh1505 force-pushed the feat/helm-chart-scaffold branch from e41c668 to 54d8880 Compare May 6, 2026 14:09
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 6, 2026
@Venkatesh1505
Copy link
Copy Markdown
Contributor Author

@aliok Sending it for your review. TIA

Comment thread dist/chart/Chart.yaml Outdated
Comment thread dist/chart/templates/deployment.yaml Outdated
@aliok aliok requested a review from Copilot May 7, 2026 07:25
Copy link
Copy Markdown

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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dist/chart-crds/templates/mcp.x-k8s.io_mcpservers.yaml
@aliok aliok mentioned this pull request May 7, 2026
Comment thread dist/chart/templates/manager-clusterrole.yaml
Comment thread dist/chart/Chart.yaml Outdated
Copy link
Copy Markdown
Member

@aliok aliok left a comment

Choose a reason for hiding this comment

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

Thanks @Venkatesh1505 !

I had a quick look and have some comments. I want to take a 2nd look later, possibly after comments are addressed.

Comment thread dist/chart/Chart.yaml Outdated
Comment thread dist/chart/values.yaml Outdated
Copy link
Copy Markdown
Member

@aliok aliok May 7, 2026

Choose a reason for hiding this comment

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

What would happen if we put the CRD under dist/chart/crds rather then dist/chart/templates?

I understand that keeping it upper level would mean no automatic CRD upgrades with helm install but when one does helm uninstall, CRD and thus all the instances are kept.

If we put it under templates, we would have automatic CRD upgrade but introduce this deletion risk.

I don't have that much Helm experience TBH.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cc @ibm-adarsh @Cali0707 @matzew @koksay (Helm expert)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@aliok looking here it seems like the two best ways to handle CRDs in a PR is:

  1. In crds
  2. In a separate CRD only chart

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Helm does not automatically update CRDs during a helm update when they live in the crds directory.

If you expect frequent CRD updates, I suggest moving them to a separate chart. Otherwise, for a couple of updates a year, you can include in the upgrade doc that users update them manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO we should move the CRDs to a separate chart then. Thoughts @aliok ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're gonna have frequent updates, as the project is new. So, let's do a separate chart for that.

cc @Venkatesh1505

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done in f13ce27 — moved the CRD to a separate dist/chart-crds/ chart (mcp-lifecycle-operator-crds).

The CRD is now a regular template in the new chart, so helm upgrade will update it automatically. The main chart's crds/ directory has been removed, and NOTES.txt updated to mention installing the CRD chart first.

Tested on a kind cluster:

  • helm install mcp-lifecycle-operator-crds dist/chart-crds/ — CRD created
  • helm upgrade mcp-lifecycle-operator-crds dist/chart-crds/ — CRD updated (revision 2)
  • helm install mcp-lifecycle-operator dist/chart/ — pod 1/1 Running, all RBAC resources created
  • helm uninstall — both charts cleaned up

Comment thread dist/chart/templates/_helpers.tpl
Comment thread dist/chart/templates/deployment.yaml Outdated
Comment thread dist/chart/templates/metrics-service.yaml Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@aliok looking here it seems like the two best ways to handle CRDs in a PR is:

  1. In crds
  2. In a separate CRD only chart

@aliok aliok self-requested a review May 12, 2026 06:05
@aliok
Copy link
Copy Markdown
Member

aliok commented May 14, 2026

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 14, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Venkatesh1505
Once this PR has been reviewed and has the lgtm label, please assign soltysh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@aliok aliok requested a review from Copilot June 2, 2026 11:22
Copy link
Copy Markdown

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.

Copilot wasn't able to review any files in this pull request.

@aliok aliok requested a review from Copilot June 2, 2026 11:33
Copy link
Copy Markdown

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.

Copilot wasn't able to review any files in this pull request.

Copy link
Copy Markdown
Contributor

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Left two comments.
But I am also wondering if there is a way to keep the chart manifests in sync with what we have actually in config/, so dist would only be the result of some kustomize patches for example 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file seems to be out of sync with the CRD in config/crd/bases/mcp.x-k8s.io_mcpservers.yaml.
It seems to miss

  • extraAnnotations field
  • extraLabels field
  • mcp section under spec

Can we make sure those are updated as part of make manifests too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I want to tackle that sync with #134

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW: in #207 we added a Makefile target which checks if the generated files & manifests are up-to-date. This also runs then in a workflow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In #204, we added get and list permissions on pods. This seems to be missing here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is done now

Venkatesh1505 and others added 9 commits June 3, 2026 09:54
Add initial Helm chart under dist/chart/ with core templates that
produce the same resources as the kustomize deployment:

- Chart.yaml, values.yaml, .helmignore
- CRD (crds/mcp.x-k8s.io_mcpservers.yaml)
- ServiceAccount (conditional via serviceAccount.create)
- RBAC: manager ClusterRole/Binding, leader-election Role/Binding,
  metrics-auth ClusterRole/Binding, metrics-reader ClusterRole
  (conditional via rbac.create)
- Controller manager Deployment with configurable image, resources,
  nodeSelector, tolerations, affinity, podAnnotations, podLabels
- Metrics Service (port 8443)
- NOTES.txt with post-install instructions
- _helpers.tpl with standard naming/labeling helpers

Part of kubernetes-sigs#132

Signed-off-by: Venkatesh1505 <venkyravi97@gmail.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
@aliok aliok force-pushed the feat/helm-chart-scaffold branch from f13ce27 to a7ee27e Compare June 3, 2026 06:59
@aliok
Copy link
Copy Markdown
Member

aliok commented Jun 3, 2026

@creydr can you take a new look?

@creydr
Copy link
Copy Markdown
Contributor

creydr commented Jun 3, 2026

@creydr can you take a new look?

Looks good from my side (but I can't LGTM because I am not in the org)

{{- include "mcp-lifecycle-operator.labels" . | nindent 4 }}
spec:
ports:
- name: metrics
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Helm chart has name: metrics, while the kustomize file has name: https ( see line 15), and the ServiceMonitor explicitly expects port: https (line 17, with a comment reinforcing it). A Helm-deployed instance would breakPrometheus scraping if someone applies the existing ServiceMonitor config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm chart scaffolding and core templates

9 participants