k8s

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

func KubeconfigPath(connectorName string) string

KubeconfigPath returns the deterministic path for a connector's kubeconfig.

func ValidateKubeconfig

func ValidateKubeconfig(kubeconfigPath string) error

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.

const (
	CloudTypeEKS CloudType = "eks"
	CloudTypeGKE CloudType = "gke"
	CloudTypeAKS CloudType = "aks"
)

func DeriveCloudType

func DeriveCloudType(cloudConnectorType string) (CloudType, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL