Go module: github.com/kcore/kcore-crossplane
This repository implements a Crossplane provider that reconciles Kubernetes custom resources against the kcore controller gRPC API (Controller service), using definitions aligned with proto/kcore/controller/v1/controller.proto (mirrored from the kcore project).
Compatibility: the checked-in protobuf matches kcore / kcoreOS 0.2.x (including nodes booted from the 0.2.0 appliance ISO). Run make generate after syncing controller.proto from the kcore tree.
| Path | Purpose |
|---|---|
cmd/provider |
Provider controller manager entrypoint |
apis/kcore/v1alpha1 |
CRD Go types (kcore.crossplane.io/v1alpha1) |
apis/apis.go |
Scheme registration |
internal/controller/ |
Reconcilers: config, sshkey, network, securitygroup, securitygroupattachment, vm, workload, plus kcore gRPC dial helpers |
proto/kcore/controller/v1/ |
Protobuf source; buf.yaml / buf.gen.yaml |
gen/proto/... |
Generated Go gRPC + protobuf (buf generate) |
package/crds/ |
Generated CRD YAML (controller-gen crd) |
examples/cluster/ |
Kind + Helm bootstrap for Crossplane and Argo CD |
examples/manifests/ |
Namespace, ProviderConfig, RBAC, Deployment, sample managed resources |
examples/argocd/ |
Example Argo CD Application (set repoURL to your Git remote) |
flake.nix |
nix develop shell: Go, buf, protobuf, kind, kubectl, helm, argocd, yq, jq |
Makefile |
make generate, make build, make test |
Dockerfile |
Multi-stage build → distroless image provider-kcore |
Group: kcore.crossplane.io/v1alpha1
- Provider configuration:
ProviderConfig,ClusterProviderConfig, and usage types (ProviderConfigUsage,ClusterProviderConfigUsage). - Managed resources:
SSHKey— register SSH public keysNetwork— create/list/delete networksSecurityGroup— create/delete security groupsSecurityGroupAttachment— attach/detach a security group to a VM or networkVirtualMachine— create/update/delete VMs (CreateVm,UpdateVm, …)Workload— VM or container workloads (CreateWorkload, …)
The ControllerAdmin gRPC service (replication, ApplyNixConfig, etc.) is not exposed as managed resources in this provider.
ProviderConfig specifies:
spec.endpoint— controller gRPC addresshost:portspec.insecure— iftrue, use plaintext gRPC (development only)spec.credentials— typicallysource: Secretwith a KubernetesSecretcontaining PEM material:ca.crt(optional),tls.crt,tls.key
The CRD requires secretRef.key for schema compatibility; the controller reads ca.crt / tls.crt / tls.key from the Secret Data (the key field is not used to select a single blob).
For plaintext dev, use insecure: true and credentials.source: None.
nix develop # optional: dev tools
make generate # buf + deepcopy + CRDs
make build # outputs bin/providerOr: go build -o bin/provider ./cmd/provider
Non-interactive script (Kind cluster, Crossplane via Helm, Argo CD):
./examples/cluster/bootstrap.shThen install CRDs and wire the provider Deployment (see examples/manifests/).
docker build -t provider-kcore:dev .
kind load docker-image provider-kcore:dev --name "${CLUSTER_NAME:-kcore-crossplane}"The Nix shell suggests installing the Crossplane CLI (crank) if crossplane is not on PATH:
go install github.com/crossplane/crossplane/cmd/crank@latestUnder examples/manifests/:
20-providerconfig-insecure.yaml— dev ProviderConfig30-providerconfig-tls.yaml— mTLS ProviderConfig (replace Secret contents)41-provider-rbac.yaml+42-deployment-provider.yaml— run the provider in-cluster (tighten RBAC for production)50–55-sample-*.yaml— one example per managed resource kind (placeholders must match your cluster)
Provider controller code follows the same Apache 2.0 style as upstream Crossplane templates where noted; protobuf-generated files carry their own codegen headers.