https://github.com/crossplane/provider-template
A template for building @crossplane providers.
https://github.com/crossplane/provider-template
Last synced: about 1 year ago
JSON representation
A template for building @crossplane providers.
- Host: GitHub
- URL: https://github.com/crossplane/provider-template
- Owner: crossplane
- License: apache-2.0
- Created: 2020-07-16T21:59:01.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T12:56:00.000Z (about 1 year ago)
- Last Synced: 2025-04-09T15:05:21.588Z (about 1 year ago)
- Language: Go
- Homepage: https://crossplane.io
- Size: 354 KB
- Stars: 149
- Watchers: 10
- Forks: 82
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# provider-template
`provider-template` is a minimal [Crossplane](https://crossplane.io/) Provider
that is meant to be used as a template for implementing new Providers. It comes
with the following features that are meant to be refactored:
- A `ProviderConfig` type that only points to a credentials `Secret`.
- A `MyType` resource type that serves as an example managed resource.
- A managed resource controller that reconciles `MyType` objects and simply
prints their configuration in its `Observe` method.
## Developing
1. Use this repository as a template to create a new one.
1. Run `make submodules` to initialize the "build" Make submodule we use for CI/CD.
1. Rename the provider by running the following command:
```shell
export provider_name=MyProvider # Camel case, e.g. GitHub
make provider.prepare provider=${provider_name}
```
4. Add your new type by running the following command:
```shell
export group=sample # lower case e.g. core, cache, database, storage, etc.
export type=MyType # Camel casee.g. Bucket, Database, CacheCluster, etc.
make provider.addtype provider=${provider_name} group=${group} kind=${type}
```
5. Replace the *sample* group with your new group in apis/{provider}.go
5. Replace the *mytype* type with your new type in internal/controller/{provider}.go
5. Replace the default controller and ProviderConfig implementations with your own
5. Run `make reviewable` to run code generation, linters, and tests.
5. Run `make build` to build the provider.
Refer to Crossplane's [CONTRIBUTING.md] file for more information on how the
Crossplane community prefers to work. The [Provider Development][provider-dev]
guide may also be of use.
[CONTRIBUTING.md]: https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md
[provider-dev]: https://github.com/crossplane/crossplane/blob/master/contributing/guide-provider-development.md