CAPIProvider Resource
The CAPIProvider resource allows managing Cluster API Operator manifests in a declarative way. It is used to provision and configure Cluster API providers like AWS, vSphere etc.
CAPIProvider follows a GitOps model - the spec fields are declarative user inputs. The controller only updates status.
Every field provided by the upstream CAPI Operator resource for the desired spec.type is also available in the spec of the CAPIProvider resouce. Feel free to refer to upstream configuration guides for advanced scenarios.
Usage
To use the CAPIProvider resource:
-
Create a
CAPIProviderresource with the desired provider name, type, credentials, configuration, and features. -
The
CAPIProvidercontroller will handle templating the required Cluster API Operator manifests based on theCAPIProviderspec. -
The status field on the
CAPIProviderresource will reflect the state of the generated manifests. -
Manage the
CAPIProviderobject declaratively to apply changes to the generated provider manifests.
Here is an example CAPIProvider manifest:
apiVersion: turtles-capi.cattle.io/v1alpha1
kind: CAPIProvider
metadata:
name: aws-infra
namespace: default
spec:
name: aws
type: infrastructure
credentials:
rancherCloudCredential: aws-creds # Rancher credentials secret for AWS
configSecret:
name: aws-config
features:
clusterResourceSet: true
This will generate an AWS infrastructure provider with the supplied mapping for rancher credential secret and custom enabled features.
The CAPIProvider controller will own all the generated provider resources, allowing garbage collection by deleting the CAPIProvider object.
Specification
The key fields in the CAPIProvider spec are:
-
name- Name of the provider (aws, vsphere etc). Inherited frommetadata.nameif is not specified. -
type- Kind of provider resource (infrastructure, controlplane etc) -
credentials- Source credentials for provider specification -
configSecret- Name of the provider config secret, where the variables and synced credential will be stored. By default if not specified, will inherit the name of theCAPIProviderresource -
features- Enabled provider features -
variables- Variables is a map of environment variables to add to the content of theconfigSecret
Full documentation on the CAPIProvider resource - here.