provider-palette
is a Crossplane provider built using Upjet code generation tools. It exposes XRM-conformant managed resources for the Palette API. provider-palette
manages Palette resources declaratively using the Spectro Cloud Palette Terraform provider.
- A kubernetes cluster with crossplane pre-installed OR install kind
- Install helm
- Install kubectl
- Install up (optional)
-
If you have access to a kubernetes cluster with crossplane pre-installed, ensure that your
KUBECONFIG
is properly configured. Otherwise, deploy a kind cluster locally, then follow the crossplane installation instructions. -
Create a secret containing your Palette credentials:
export PALETTE_API_KEY="" # Edit me export PALETTE_PROJECT_NAME=Default export PALETTE_HOST=api.spectrocloud.com cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Secret metadata: name: palette-creds namespace: crossplane-system type: Opaque stringData: credentials: | { "api_key": "$PALETTE_API_KEY", "project_name": "$PALETTE_PROJECT_NAME", "host": "$PALETTE_HOST" } EOF
-
Install
provider-palette
using the following command:up ctp provider install crossplane-contrib/provider-palette:v0.19.2
Alternatively, you may install by creating a
Provider
resource:cat <<EOF | kubectl apply -f - apiVersion: pkg.crossplane.io/v1 kind: Provider metadata: name: provider-palette spec: package: crossplane-contrib/provider-palette:v0.19.2 EOF
Important
Ensure the image tag you use matches the latest release
-
Create a ProviderConfig to authenticate the Provider:
cat <<EOF | kubectl apply -f - apiVersion: palette.crossplane.io/v1beta1 kind: ProviderConfig metadata: name: provider-palette-config spec: credentials: source: Secret secretRef: name: palette-creds namespace: crossplane-system key: credentials EOF
-
Refer to the examples, examples-generated, and API reference to learn how to start creating Palette resources.
Before getting started, you should read the Upjet docs. At a minimum, read about generating a provider.
# Install dependencies
go install golang.org/x/tools/cmd/goimports@latest
# Prepare repo for generation
make submodules vendor vendor.check
# Generate provider-palette. To upgrade, you must first edit TERRAFORM_PROVIDER_VERSION in the Makefile.
make generate
- Run
provider-palette
in debug mode against a Kubernetes cluster:make run
- Build, push, and install:
make all
- Build xpkgs:
make -j2 build
- Install CRDs
kubectl apply -f package/crds/
- Edit the
Debug
configuration in.vscode/launch.json
:- Ensure
env.KUBECONFIG
is correct - Optionally specify
env.TF_REATTACH_PROVIDERS
to hook into your dev Terraform provider
- Ensure
- Execute the
Debug
launch configuration
For filing bugs, suggesting improvements, or requesting new features, please open an issue.