Creating a Custom Crossplane Package
There are several reasons why you might want to create a custom Crossplane Package. For example:
- Customization: You want to tweak the default setup, for example to set a custom service plan.
- White labeling: You want to rename the API shared by Klutch to reflect your own company name.
- Adding new functionality: You want to add a new, currently unsupported service.
There are two different ways to add a custom package:
- Adding a new configuration by modifying the default configuration
- Adding a completely new API
Modifying the existing Configuration
If you want to make small changes to the default configuration, you can use the example for updating or adding a service or plan in a8s Data Services. For adding or updating a service, follow the instructions in the same page and adjust or remove the default configuration as needed.
Once you have made the modifications you want, you can push the configuration package to a OCI image registry of your choice, and deploy your changes to the control plane cluster by running:
# Get the name of the configuration
$ kubectl get configurations.pkg.crossplane.io
NAME INSTALLED HEALTHY PACKAGE AGE
w5n9a2g2-anynines-dataservices True True public.ecr.aws/w5n9a2g2/anynines/dataservices:v1.5.1 73d
# edit the configuration
$ kubectl edit configurations.pkg.crossplane.io w5n9a2g2-anynines-dataservices
and then edit spec.package to the configuration package you have pushed to your image registry.
Adding a new API
To add a new API, you need to create a crossplane package with the API you want to add. As a starting point you can look into the crossplane documentation for Composite Resource Definitions, Compositions, and Package at (https://docs.crossplane.io/v1.20/concepts/).
Once you have created your custom API and installed it on the Provider cluster, you can add it to Klutch by following the steps for adding a custom api to klutch-bind to make it accessible to your users.