A Terraform provider for managing cluster registration in Karpor
- Cluster Registration Management (
karpor_cluster_registration
)
make install # Install to ~/.terraform.d/plugins
terraform {
required_providers {
karpor = {
source = "KusionStack/karpor"
version = "0.1.0"
}
}
}
provider "karpor" {
api_endpoint = "https://api.karpor.example.com"
api_key = "<your-api-key>" # Recommend using environment variables
}
resource "karpor_cluster_registration" "production" {
cluster_name = "production-cluster"
api_server_url = "https://k8s.example.com"
credentials = file("~/.kube/config")
description = "Primary production cluster"
}
- Go 1.21+
- Terraform 1.5+
make build # Build provider
make test # Run unit tests
make testacc # Run acceptance tests (requires API credentials)
Set environment variables before testing:
export KARPOR_ENDPOINT="https://api.karpor.example.com"
export KARPOR_API_KEY="your-api-key"
- Create an issue describing the problem or feature request
- Develop on a feature branch (feature/xxx)
- Submit a PR with test cases
- Pass CI pipeline verification
Mozilla Public License 2.0, see LICENSE