Thank you for your interest in contributing to the OpenDataHub GitOps repository! This document provides guidelines and instructions for contributing to this project.
- Contributing to OpenDataHub GitOps Repository
- Table of Contents
- Getting Started
- Add a New Kustomize Dependency Operator
- Step 1: Create a New Operator Component
- Step 2: Create Required Manifests
- Step 3: Create Dependency Operator Directory
- Step 4: Update Operators Parent Kustomization
- Step 5: Add Base Configuration for Your Operator
- Step 6: Update Configurations Parent Kustomization
- Step 7: Update Scripts
- Step 8: Document the Operator
- Step 9: Test Your Changes
- Contributing to the Helm Chart
- Testing Your Changes
- Pull Requests
- Git
kubectlorocCLI- Access to an OpenShift cluster (for testing)
- Kustomize v5 or later
When adding a new dependency operator required by OpenDataHub:
Create a new directory under components/operators/ named after your operator:
mkdir -p components/operators/your-operatorCreate the files required to install the dependency operator in your operator directory, including a kustomization.yaml file.
Note
Do not set the namespace name in the kustomization.yaml file, but set it as a string in the individual resource files where needed.
Create a new directory under dependencies/operators/ named after your operator:
mkdir -p dependencies/operators/your-operatorAdd a kustomization.yaml file to the directory, for example:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
components:
- ../../../components/operators/your-operator/Add patches if needed.
If your operator depends on other operators, add them to the components list.
For an example, see the kueue operator directory.
Add your operator to dependencies/operators/kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
components:
- ../../../components/operators/cert-manager/
- ...
- ../../../components/operators/your-operator/ # Add this lineIf your operator needs a configuration which depends on CRDs installed by OLM, you can add it to the configurations/your-operator folder.
For an example, see the Kueue configuration directory.
Add your operator to configurations/kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ...
- your-operatorUpdate the maintenance scripts to support your new operator.
Add your operator to scripts/verify-dependencies.sh to enable automated verification.
The script performs the following checks:
- Verifies the operator's Subscription is in the
Succeededphase - Confirms the operator's ClusterServiceVersion (CSV) is in the
Succeededphase - Optionally validates additional resources managed by the operator
You can extend the verification logic to include custom health checks for resources created by your operator.
Only update scripts/remove-dependencies.sh if your operator requires special cleanup steps during uninstallation (e.g., removing CRDs, finalizers, or dependent resources that block deletion).
For most operators, the default cleanup process is sufficient, and no changes are needed.
Add documentation about your operator:
- Update
README.mdwith operator information. - Add any special configuration requirements.
See Testing Your Changes section below.
The repository includes a Helm chart (chart/) that provides an alternative installation method alongside Kustomize. When adding or modifying dependencies, you should also update the Helm chart.
When adding a new dependency operator, follow these steps:
Add your dependency to chart/values.yaml under the dependencies section.
Structure:
enabled: Tri-state value -auto(install if needed by a component),true(always install),false(never install)dependencies: Other dependencies this dependency requires (for transitive deps)olm: OLM subscription configurationconfig(optional): CR spec fields - user can add any fields supported by the CR
dependencies:
yourOperator:
# -- Enable your-operator: auto (if needed), true (always), false (never)
enabled: auto
# -- Dependencies required by your-operator
dependencies:
certManager: true
olm:
channel: stable
name: your-operator
namespace: your-operator-namespace
targetNamespaces: [] # optional, for OperatorGroups with specific target namespaces
config: # optional
# -- YourOperator CR spec (user can add any fields supported by the CR)
spec:
managementState: ManagedCreate a new directory chart/templates/dependencies/your-operator/ with:
operator.yaml - OLM installation:
{{- $dep := .Values.dependencies.yourOperator -}}
{{- $shouldInstall := include "rhoai-dependencies.shouldInstall" (dict "dependencyName" "yourOperator" "dependency" $dep "dependencies" .Values.dependencies "components" .Values.components) -}}
{{- if eq $shouldInstall "true" }}
{{- $installType := include "rhoai-dependencies.installationType" (dict "dependency" $dep "global" .Values.global) -}}
{{- if eq $installType "olm" }}
{{ include "rhoai-dependencies.operator.olm" (dict "name" $dep.olm.name "namespace" $dep.olm.namespace "channel" $dep.olm.channel "root" $) }}
{{- end }}
{{- end }}config.yaml (optional) - CR configuration:
{{- $dep := .Values.dependencies.yourOperator -}}
{{- $shouldInstall := include "rhoai-dependencies.shouldInstall" (dict "dependencyName" "yourOperator" "dependency" $dep "dependencies" .Values.dependencies "components" .Values.components) -}}
{{- if and (eq $shouldInstall "true") (include "rhoai-dependencies.crdExists" (dict "crdName" "yourresources.your.domain.io" "root" $)) }}
apiVersion: your.domain.io/v1
kind: YourResource
metadata:
name: cluster
labels:
{{- include "rhoai-dependencies.labels" . | nindent 4 }}
{{- with $dep.config.spec }}
spec:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}Add your dependency to chart/values.schema.json to enable validation.
Run make helm-docs to regenerate chart/api-docs.md.
Components are high-level features (like kserve, kueue, aipipelines) that configure the DataScienceCluster and auto-enable their required dependencies.
Add your component to chart/values.yaml under the components section.
Structure:
dependencies: Dependencies required (or optional) your component requiresdsc: Configuration that goes into the DataScienceCluster CRdefaults(optional): Operator-type-specific defaults for dsc fields (odh or rhoai)
components:
# -- Your component description
yourComponent:
# -- Dependencies required by YourComponent
dependencies:
certManager: true
# -- DSC configuration for YourComponent
dsc:
# -- Management state for YourComponent (Managed or Removed)
managementState: Managed
# -- Operator-type-specific defaults for dsc fields
defaults:
odh:
someField: odh-value
rhoai:
someField: rhoai-valueAdd your component to chart/templates/operator/datasciencecluster.yaml:
spec:
components:
kserve:
{{- include "rhoai-dependencies.componentDSCConfig" (dict "component" .Values.components.kserve "root" $) | nindent 6 }}
yourComponent:
{{- include "rhoai-dependencies.componentDSCConfig" (dict "component" .Values.components.yourComponent "root" $) | nindent 6 }}Add your component to chart/values.schema.json under the components section.
- Update
chart/README.mdwith component information - Run
make helm-docsto regeneratechart/api-docs.md
-
Lint the chart:
helm lint ./chart
-
Update snapshots:
make chart-snapshots
-
Test on a cluster:
make helm-install-verify
Always test your changes before submitting a PR.
- Validate Kustomize Build:
Run make validate-all to validate the kustomization files.
-
Check for YAML Errors:
kustomize build . | kubectl apply --dry-run=client -f -
-
Validate Installation on a Real Cluster: Test the operator installation on an actual OpenShift cluster to ensure it works as expected.
-
Lint the chart:
helm lint ./chart
-
Update snapshots:
make chart-snapshots
-
Update documentation:
make helm-docs
-
Optional: deploy OpenDataHub Operator Catalog:
bash ./scripts/install-catalog-source.sh
-
Test on a cluster:
make helm-install-verify
If you want to use the custom catalog from step 4, run:
make helm-install-verify HELM_EXTRA_ARGS="--set operator.odh.olm.source=opendatahub-catalog-test --set operator.odh.olm.channel=fast"
- Fork the Repository: Create your own fork of the repository to work on your changes.
- Create a Branch: Create your own branch for the feature or bug fix off of the
mainbranch. - Work on Your Changes: Commit often, and ensure Kustomize builds correctly.
- Testing: Make sure to test your changes in a real cluster. See the Testing Your Changes section above.
- Open a PR Against
main: See the PR guidelines below.
- Link to Jira Issue: Include the Jira issue link in your PR description.
- Description: Provide a detailed description of the changes and what they fix or implement.
- Add Testing Steps: Provide information on how the PR has been tested, and list testing steps for reviewers.
- Review Request: Tag the relevant maintainers or team members for a review. We follow the Kubernetes review process.
- Resolve Feedback: Be open to feedback and iterate on your changes.
We follow the Conventional Commits format for writing commit messages. A good commit message should include:
- Type:
fix,feat,docs,chore, etc. Note: All commits exceptchorerequire an associated Jira issue. Please add a link to your Jira issue. - Scope: A short description of the area affected.
- Summary: A brief explanation of what the commit does.