Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: separate helm chart for CRDs #507

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mariuskimmina
Copy link

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.

@mariuskimmina mariuskimmina marked this pull request as draft December 12, 2024 08:37
@mariuskimmina
Copy link
Author

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

@mariuskimmina
Copy link
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
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