This project provides a Crossplane Composition and CompositeResourceDefinition (XRD) for managing NextDNS profiles using Crossplane and the provider-http with Go templating.
- Crossplane enables you to declaratively manage cloud and external resources using Kubernetes CRDs.
- provider-http allows Crossplane to manage any resource with an HTTP API.
- function-go-templating enables dynamic resource generation using Go templates in Crossplane compositions.
- This composition lets you manage NextDNS profiles as Kubernetes resources, mapping your desired state to the NextDNS API.
- You define a
Profilecustom resource (CR) in Kubernetes, specifying your NextDNS profile configuration. - The composition uses Go templating to generate an HTTP
Requestresource, which interacts with the NextDNS API to create, update, and delete profiles. - Secrets and status are injected back into Kubernetes for use by other resources or applications.
- See
example/nextdnsprofile/claim.yamlfor a sample Profile resource.
- Kubernetes Cluster:
Ensure you have a Kubernetes cluster running (e.g., Minikube, Kind, EKS, GKE).
- v1.29+ recommended
- Install Crossplane: Follow the official docs.
Create a Configuration resource referencing your published package:
apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
name: nextdns-crossplane-composition
spec:
package: ghcr.io/jacaudi/nextdns-crossplane-composition:v1.0.0Apply it:
kubectl apply -f configuration.yaml-
Create the provider config:
kubectl apply -f example/nextdnsprofile/providerconfig.yaml
-
Create a secret with your NextDNS API key:
kubectl create secret generic nextdns-api-key \ --from-literal=api-key=<YOUR_NEXTDNS_API_KEY> \ -n crossplane-system
-
Apply a Profile claim:
kubectl apply -f example/nextdnsprofile/claim.yaml
Check that the package, XRD, and Composition are installed:
kubectl get xrd
kubectl get composition- Ensure all Crossplane pods, provider-http, and function-go-templating pods are running in the
crossplane-systemnamespace. - Check CRD status with
kubectl get crd profiles.nextdns.jacaudi.io. - Check resource status with
kubectl describe profile <name>. - Review provider and function logs for errors.