Skip to content

Developer guide

cguran-ionos edited this page Oct 29, 2024 · 5 revisions

Instructions to compile:

  • Run make submodules
  • To re-generate crd: make generate

In case make generate fails, try deleting .work and .cache folders.

To run locally:

  1. Create cluster, apply crds and load credentials:
kind create cluster --name crossplaneexample
kubectl create namespace crossplane-system
kubectl config use-context kcrossplane-system
kubectl config set-context --current --namespace=crossplane-system
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update
helm install crossplane --namespace crossplane-system crossplane-stable/crossplane
sleep 5
kubectl apply -f package/crds/ -R
sleep 5
kubectl create secret generic --namespace crossplane-system example-provider-secret --from-literal=credentials="{\"user\":\"${IONOS_USERNAME}\",\"password\":\"${IONOS_PASSWORD}\",\"s3_access_key\":\"${IONOS_S3_ACCESS_KEY}\",\"s3_secret_key\":\"${IONOS_S3_SECRET_KEY}\"}"
kubectl apply -f examples/providerconfig/providerconfig.yaml
  1. Start the provider locally:
make run
  1. Apply crd and see if the resource is created in DCD:
kubectl apply -f examples/compute/datacenter.yaml 

Add a new resource

Follow guide here: https://github.com/crossplane/upjet/blob/main/docs/adding-new-resource.md

Run integration tests:

Locally

kubectl create namespace upbound-system
export UPTEST_EXAMPLE_LIST=examples/compute/datacenter.yaml
make e2e

On CI:

Leave a comment on the PR with the path to the crd you want to test:

/test-examples="examples/dns"
/test-examples="examples/compute/datacenter.yaml"
Clone this wiki locally