Initial setup and design
Currently we have the following things defined in the setup:
- A local kind cluster that will be used to provision our bootstraping cluster on GKE,
this can be useful for cases when we want to teardown / reset upstream infra.
- Create a local kind cluster with
make orch-cluster
- Install
crossplane
and crossplane gcp-provider
on this local kind cluster - make install-crossplane
- We are now ready to provision our bootstrap GKE cluster and load it with
provider-helm
and crossplane
itself.
make create-bootstrap-cluster
- At the end of above steps we should have a GKE Cluster provisioned, and the crossplane chart deployed on this cluster through helm.
- Get the bootstrap cluster creds locally with
make get-credentials
.
- Install knative-eventing onto this cluster –
make install-knative-eventing
- Install tekton and setup required RBAC –
make install-tekton
Use existing cluster as a bootstrap cluster
If we already have a cluster to use as a bootstrap cluster - to host crossplane and other bootstrapping
utilities, then we can skip a few steps and directly jump to the following:
- Install crossplane on the bootstrapping cluster -
make install-crossplane
- Install tekton -
make install-tekton
- Install knative eventing -
make install-knative-eventing
- Apply tekton resources -
make install-tekton-resources
. This sets up the following tekton resources:
ClusterRole
and ClusterRoleBinding
for default
SA
PipelineResource
of the git repository to fetch from
- Tekton
Task
for applying the crossplane Cluster
and NodePool
yaml manifests.
- Tekton
EventListener
, TriggerBinding
and TriggerTemplate
resources
At the end of this, we have a fully connected flow all the way from an event listener to creating a cluster through crossplane.
Controllers and types
Currently we have all the existing types and controllers defined in provider-template
ProviderConfig
– will hold configuration for CDEvents like endpoint to connect to, callback URL etc.
MyType
- just for reference, will be removed
Cluster controller
- controller for the github.com/crossplane/provider-gcp/apis/container/v1beta2
resource, we would track this and wait for Status.Conditions[].Ready == True
and trigger the CDEvent for the start
provider-template
provider-template
is a minimal Crossplane 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
- Use this repository as a template to create a new one.
- Find-and-replace
provider-template
with your provider's name.
- Run
make
to initialize the "build" Make submodule we use for CI/CD.
- Run
make reviewable
to run code generation, linters, and tests.
- Replace
MyType
with your own managed resource implementation(s).
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.