Skip to content

feat: separate helm chart for CRDs#507

Open
mariuskimmina wants to merge 6 commits into
grafana:mainfrom
mariuskimmina:feat-new-helm-chart-for-crds
Open

feat: separate helm chart for CRDs#507
mariuskimmina wants to merge 6 commits into
grafana:mainfrom
mariuskimmina:feat-new-helm-chart-for-crds

Conversation

@mariuskimmina
Copy link
Copy Markdown

Closes #505
Supersedes #506

This is a first draft for a new helm chart k6-crds.

https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts

Examples of other projects following this approach:

The current approach of having of having the CRDs defined under templates/crds is not a recommended pattern by helm. We could move CRDs to a dedicated /crds/ folder but as seen in #506 that creates it's own problems due to a lack of templating.

So far I liked the approach of having a separate chart for CRDs whenever I encountered it.

I think we can do this in two steps

  1. Create the new k6-crds chart (this PR).
  2. Remove the CRDs from k6-operator chart and add k6-crds chart as a dependency.

Converting to Draft as I didn't get to testing this yet.

Signed-off-by: Marius Kimmina <marius@adjoe.io>
@mariuskimmina mariuskimmina marked this pull request as draft December 12, 2024 08:37
Signed-off-by: Marius Kimmina <marius@adjoe.io>
Signed-off-by: Marius Kimmina <marius@adjoe.io>
Signed-off-by: Marius Kimmina <marius@adjoe.io>
Signed-off-by: Marius Kimmina <marius@adjoe.io>
Signed-off-by: Marius Kimmina <marius@adjoe.io>
@mariuskimmina
Copy link
Copy Markdown
Author

Note: might want to wait for #500 and not include the k6 CRD here

@mariuskimmina
Copy link
Copy Markdown
Author

Tested it now and it seems to be working fine.

I tested on a simple kind cluster by first installing the CRDs chart

helm install k6-crds ./k6-crds -n k6-testing 

Then installing removing the crds directory from the operator chart and running

helm install k6-operator ./k6-operator -n k6-testing

I then created a very minimal TestRun

apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
  name: k6-sample
  namespace: k6-testing
spec:
  parallelism: 1
  script:
    configMap:
      name: k6-test
      file: test.js
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: k6-test
  namespace: k6-testing
data:
  test.js: |
    import http from 'k6/http';
    import { sleep } from 'k6';

    export default function () {
      http.get('http://httpbin.org/get');
      sleep(1);
    }

All of this worked so I am going to mark this as ready for review now

@mariuskimmina mariuskimmina marked this pull request as ready for review December 14, 2024 10:50
@yorugac yorugac self-requested a review May 29, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm chart for CRDs

1 participant