JonasKs/crosslol

Test implementation of a crossplane provider, with a few resources. Crossplane is cool. :)

★ 0Forks 0GoGitHub ↗Compare

README

provider-crosslol

provider-crosslol is a minimal Crossplane Provider that is meant to be used as a crosslol 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 crosslol to create a new one.
  2. Run make submodules to initialize the "build" Make submodule we use for CI/CD.
  3. Rename the provider by running the following command:
  export provider_name=MyProvider # Camel case, e.g. GitHub
  make provider.prepare provider=${provider_name}
  1. Add your new type by running the following command:
  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}
  1. Replace the sample group with your new group in apis/{provider}.go
  2. Replace the mytype type with your new type in internal/controller/{provider}.go
  3. Replace the default controller and ProviderConfig implementations with your own
  4. 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 guide may also be of use.

Crosslol

Installation

  1. Clone this repository.
  2. git submodule init
  3. git submodule update -- ./yang
  4. Install kind for a local k8s cluster
  5. Install kubectl as the k8s CLI tool
  6. Install k9s to view the k8s cluster
  7. Create a cluster kind create cluster --name crossnet 7.1. kubectl cluster-info --context kind-crossnet to see that the cluster is running
  8. Browse cluster by typing k9s
  9. Install helm
  10. Install crossplane 10.1. helm repo add crossplane-stable https://charts.crossplane.io/stable 10.2. helm install crossplane --kube-context kind-crossnet --namespace crossplane-system --create-namespace crossplane-stable/crossplane -- (ensure your context is the crossnet cluster, see kubectl config get-contexts)

Contributors

JonasKs

Issues