All updates
Written by Jan 19, 2026

k8s: Uniform API server access using clientcmd

Jan 19, 2026

This article explains how to use the clientcmd library (part of client-go) to make Go CLI tools access the Kubernetes API with the same kubeconfig/kubectl semantics users expect. It covers loading rules, configuration overrides, building and binding flags, merging behavior, creating a merged ClientConfig (interactive or non-interactive), and obtaining a kubernetes client, plus relevant gotchas and an example.

Sponsored by GitAds