kubernetes/kops · error
creating clientset: %w
Error message
creating clientset: %w
What it means
Building the kubernetes.Clientset from the provided rest.Config failed while initializing the pod log dumper; the config is structurally invalid for client-go (bad host URL, auth setup, or TLS data), before any request is made.
Source
Thrown at pkg/dump/podlogs.go:52
const (
podLogDumpConcurrency = 20
)
type podLogDumper struct {
k8sClient *kubernetes.Clientset
artifactsDir string
}
type podLogDumpResult struct {
err error
}
func NewPodLogDumper(k8sConfig *rest.Config, artifactsDir string) (*podLogDumper, error) {
k8sConfig.QPS = 50
k8sConfig.Burst = 100
clientSet, err := kubernetes.NewForConfig(k8sConfig)
if err != nil {
return nil, fmt.Errorf("creating clientset: %w", err)
}
return &podLogDumper{
k8sClient: clientSet,
artifactsDir: artifactsDir,
}, nil
}
func (d *podLogDumper) DumpLogs(ctx context.Context) error {
klog.Info("Dumping k8s pod logs")
allPods, err := d.k8sClient.CoreV1().Pods(v1.NamespaceAll).List(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("listing pods: %w", err)
}
jobs := make(chan v1.Pod, len(allPods.Items))
results := make(chan podLogDumpResult, len(allPods.Items))
View on GitHub (pinned to 4c8573c808)
Solutions
- Regenerate kubeconfig via kops export kubeconfig
- Validate the rest config (server URL, CA data, credentials)
- Check env overrides (KUBECONFIG, proxy variables) pointing at a broken config
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at pkg/dump/podlogs.go:52 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/b81e9b24b25399db.
Report an issue: GitHub.