Questions tagged [client-go]
208 questions
0
votes
1 answer
How to get fresh list of GKE worker nodes using k8s client-go
I am using k8s client-go SDK's NodeInterface to get list of all nodes of GKE cluster. API returns the list correctly. When I update (reduce) size of GKE node-pool, some of the worker nodes gets killed. I wait for cluster to become stable.
Invoking…

vinayakshnd
- 303
- 2
- 8
0
votes
1 answer
What can I do to get k8s to return json in the form of an underscore instead of a camel case
I need to use client-go to get the state of deployment in k8s, but when json serialization is done, k8s is serialized by camel case by default, while I need to pass it to the front end in the form of underscore division. What do I need to do?

Dom.Dou
- 1
0
votes
0 answers
How can I login(in golang using client-go) a k8s pod with multi-containers by webshell?
Description:
There is no problem to login a container/pod by client-go/remotecommand.NewSPDYExecutor when there is only one container in a pod.
But when there are many containers in a pod, I cannot login by point a container id.
Can anyone help or…

tony
- 21
- 7
0
votes
1 answer
Generating kubernetes client code with reference to existing kubernetes type
I am playing around with writing a CRD for kubernetes, and am having trouble getting the code-generator to work. In particular, generating deepcopy functions is failing for a particular struct, which has reference to a batch.JobTemplateSpec.…

user3769061
- 21
- 1
0
votes
1 answer
Getting container resource metrics from kubernetes cluster
I am exploring client-go library for collecting resource metric for a kubernetes cluster. I am more keen on collecting the container metrics from all the pods.
But according to the wiki,…

Venkat Teki
- 2,233
- 4
- 21
- 28
0
votes
1 answer
When Kubernetes client-go Remotecommand Stream finishes?
I am using this Remotecommand here https://github.com/kubernetes/client-go/blob/master/tools/remotecommand/remotecommand.go#L108 to execute a command on a pod and stream the result to an io.Writer. As stated in the command above the function in the…

Techradar
- 3,506
- 3
- 18
- 28
0
votes
2 answers
Get cluster API url with Kubernetes client-go
I'm using client-go for Kubernetes and trying to get the API url of the current cluster, i.e. something similar to the output of kubectl cluster-info.
I found a function called getCluster:
func (config *DirectClientConfig) ClientConfig()…

lawful_neutral
- 633
- 8
- 29
0
votes
1 answer
kubectl timeout inside kube-addon-manager
I was debugging a issue from my cluster, seems kubectl commands timeout inside the kube-addon-manager pod, while the equivalent curl command works fine.
bash-4.3# kubectl get node --v 10
I1119 16:35:55.506867 54 round_trippers.go:386] curl -k…

flynn
- 23
- 1
- 6
-1
votes
3 answers
io.Pipe() not working as desired. What am I doing wrong here?
I have been testing exec functionality to a kubernetes pod with client-go. This is the code that works perfectly with os.Stdin
{
// Prepare the API URL used to execute another process within the Pod. In
// this case, we'll run a remote…

Kumar Abishek
- 11
- 5
-1
votes
1 answer
golang syntax in client-go
someone can help me to understand these code?
in the client-go project, there are some codes i can't understand.
code path is \tols\cache\store.go
Add(obj interface{}) error
Update(obj interface{}) error
Delete(obj interface{}) error
…

charlie
- 9
- 3
-2
votes
1 answer
types conflict on Golang Api Kind Struct Creation
I face an issue while creating types.go in client-go.
kind: Kafka
metadata:
name: my-cluster
namespace: sample-system
spec:
kafka:
version: 2.5.0
replicas: 3
listeners:
plain:
authentiation:
type:…

charan kumar
- 335
- 2
- 11
-2
votes
1 answer
How to manipulate kubernetes PodSpec object
I am looking for some help with the golang code to modify the podspec based on user input.
This is my flow.
User provides an incomplete yaml file to create deployment. Assume they are missing/update environment variables information.
User also gives…

Nitin Mathur
- 11
- 3
-3
votes
2 answers
Unable to return any k8s client-go objects
I have to following code:
package analyzer
import (
"context"
"os"
"path/filepath"
"k8s.io/api/apps/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
_…

Ishan Khare
- 1,745
- 4
- 28
- 59