Documentation
¶
Overview ¶
Package k8sconfig generates kubeconfig files for Kubernetes clusters using CSP CLI tools (aws, gcloud, az). It replaces the previous k8sauth package which used Go SDK calls directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(ctx context.Context, cfg GenerateConfig) (string, error)
Generate creates a kubeconfig file using CSP CLI tools and returns its path. The file path is deterministic: /tmp/simrun-kubeconfig-{connector-name}.yaml
func KubeconfigPath ¶
KubeconfigPath returns the deterministic path for a connector's kubeconfig.
func ValidateKubeconfig ¶
ValidateKubeconfig verifies the generated kubeconfig file has the expected structure. The actual cluster connectivity is validated by the CLI tools during Generate (they call DescribeCluster/list-clusters and fail if credentials or cluster are invalid).
Types ¶
type CloudType ¶
type CloudType string
CloudType identifies the Kubernetes provider.
func DeriveCloudType ¶
DeriveCloudType determines the Kubernetes provider from the cloud connector type.
type GenerateConfig ¶
type GenerateConfig struct {
ConnectorName string // Used for deterministic file path
CloudType CloudType // Auto-detected from cloud connector
ClusterName string
Region string
Project string // GKE only
ResourceGroup string // AKS only
Credentials map[string]string // Cloud credentials as env vars
}
GenerateConfig holds the parameters for kubeconfig generation.