All Questions
Tagged with go kubernetes
967
questions
1
vote
0
answers
28
views
Unable to connect to Postgres StatefulSet in kubernetes cluster from go web server
I have a web server in Golang that connects to Postgres as a StatefulSet. However, I am getting an error with the connection where there is no such host found. The web server was created using ...
0
votes
0
answers
25
views
How to debug a testify golang code which is deployed in k8s cluster as job using vscode?
I am trying to debug golang test code which is deployed as job in local k8s cluster.
I have installed cloud code extension.
In my dockerfile I have installed dlv.
dockerfile is as below
FROM myorg.com/...
0
votes
1
answer
33
views
Golang K8s operator - what is causing a nil pointer Error?
I'm developing a custom k8s operator that utilizes this go-client library: https://github.com/newrelic/newrelic-client-go/tree/main to makes API calls to New Relic (3rd party service). I've created a ...
1
vote
1
answer
63
views
When is the k8s controller-runtime manager client cache updated
I am working on a k8s controller using the k8s controller-runtime's setupWithManager approach.
During my reconciliation loop, on mgr.GetClient().Status().Update(...) I sometimes hit Operation cannot ...
2
votes
1
answer
74
views
How do I programmatically validate a go structure that has kubebuilder validation markers?
Say I have the following structure with kubebuilder validation markers:
type ToySpec struct {
// +kubebuilder:validation:MaxLength=15
// +kubebuilder:validation:MinLength=1
Name string `...
1
vote
0
answers
23
views
Containerd, extend network interface/access to DIND container to perform docker pull
I have an unusual use case, for a number of reasons my company asked me to rewrite my application and deploy it using containerd on Kubernets.The app does something similar to Github Actions and ...
1
vote
0
answers
20
views
kubernetes: multiple reconcile instances updating the same non-kubernetes object
I have a kubernetes reconciler written in GO. The MaxConcurrentReconciles set to be greater than one.
Every time the target kubernetes object gets deleted, I need to update a list(remove the id of the ...
2
votes
0
answers
64
views
FATA[0005] failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2
I have tried with go version 1.22.5, 1.20.5,1.17, and sdk version:
operator-sdk version
operator-sdk version: "v1.20.0", commit: "deb3531ae20a5805b7ee30b71f13792b80bd49b1", ...
1
vote
0
answers
21
views
Apache Pulsar Go Client created unexpected producer/consumer
I have a Go application which tests sending and receiving messages through Apache Pulsar and deploy them within the same Kubernetes cluster, as follows:
package main
import (
"context"
...
1
vote
0
answers
52
views
Comunicate to a k3s cluster from other docker container on the same network
I have a golang test that setup multiple stand alone docker containers using dockertest lib, and a k8s cluster that I setup using k3s.
As part of the test, I'm creating a docker network with name &...
2
votes
0
answers
95
views
How to create kubernetes client with go sdk for AWS EKS with automatic token refresh
I am using the function newClientset below to create a clientset to send requests to api-server of an AWS EKS cluster.
Arguments clusterCAData and clusterEndpoint are retrieved dynamically by the ...
1
vote
0
answers
70
views
Issue with Go Application on Kubernetes: Informer Blocked on Semaphore
We are encountering an issue in our Go application running as a Kubernetes pod that uses multiple informers. Analysis of the dump file revealed that a goroutine is primarily blocked on acquiring a ...
1
vote
0
answers
275
views
Golang delve in Kubernetes container - "use of closed network connection"
Edit: Before you go through the entire question, note the update at the end (the pod restarts were caused by a liveness probe failing). I am not deleting the question, because:
it links to a very ...
5
votes
1
answer
182
views
Field conflict with kubernetes dynamic client and server-side apply
How do I correctly use the kubernetes client-go library with a dynamic client and server-side apply?
I am creating and then trying to update a Kubernetes resource using the dynamic client, with ...
1
vote
0
answers
48
views
Golang - K8S DeepCopyInto function failing because Secret type undefined
I have the following function, with which I'm trying to copy a secret into another namespace. My GO code fails saying that the Secret type is undefined, but it should be inherited from the core/v1 ...