Registry /
cloud / giantswarm-k8sclient-v4
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
k8sclient
✓ github.com/giantswarm/k8sclient/v4
Create a Kubernetes client and list pods in the default namespace.
package main
import (
"context"
"fmt"
"github.com/giantswarm/k8sclient/v4"
)
func main() {
client, err := k8sclient.New(k8sclient.ClientsConfig{})
if err != nil {
panic(err)
}
pods, err := client.K8sClient().CoreV1().Pods("default").List(context.Background(), metav1.ListOptions{})
if err != nil {
panic(err)
}
fmt.Println(len(pods.Items))
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
4.1.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.