Skip to content

The Provider enables Terraform to manage cluster registration for Karpor.

License

Notifications You must be signed in to change notification settings

KusionStack/terraform-provider-karpor

Repository files navigation

OSP

Terraform Provider for Karpor

A Terraform provider for managing cluster registration in Karpor

Features

  • Cluster Registration Management (karpor_cluster_registration)

Installation

Local Build & Install

make install  # Install to ~/.terraform.d/plugins

Terraform Configuration

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
}

Usage Example

resource "karpor_cluster_registration" "production" {
  cluster_name    = "production-cluster"
  api_server_url  = "https://k8s.example.com"
  credentials     = file("~/.kube/config")
  description     = "Primary production cluster"
}

Development Guide

Requirements

  • Go 1.21+
  • Terraform 1.5+

Common Commands

make build    # Build provider
make test     # Run unit tests
make testacc  # Run acceptance tests (requires API credentials)

Test Configuration

Set environment variables before testing:

export KARPOR_ENDPOINT="https://api.karpor.example.com"
export KARPOR_API_KEY="your-api-key"

Contributing

  1. Create an issue describing the problem or feature request
  2. Develop on a feature branch (feature/xxx)
  3. Submit a PR with test cases
  4. Pass CI pipeline verification

License

Mozilla Public License 2.0, see LICENSE

About

The Provider enables Terraform to manage cluster registration for Karpor.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published