Questions tagged [kubeconfig]

105 questions
0
votes
1 answer

adding environment variable inside kubernetes config file

I am trying to set my company proxy inside my KUBECONFIG file hoping it would be picked up when i run kubectl from command line. I have tried many things but nothing helps so far. Here is the my config file. apiVersion: v1 clusters: - cluster: …
0
votes
3 answers

Accessing AKS kubeconfig file from go program

I am trying to write a Go program to get pod logs from the cluster. I am using AKS kubernetes cluster. How can I access the kubeconfig file inside my script? Following is my code: package main import ( "context" "flag" "fmt" "time" …
Sormita Chakraborty
  • 1,015
  • 2
  • 19
  • 36
0
votes
1 answer

Remove kubernetes cluster information from kubectx workflow

Is there a way to remove kubernetes cluster contexts from kubectx? Or can this only be done by manually removing them from kubeconfig?
Wunderbread
  • 898
  • 2
  • 14
  • 34
0
votes
0 answers

Accessing 2 clusters with the same kubeconfig

In the case that there are 2 clusters of kubernetes A and B, being exact replicas, and a DNS entry for the kubernetes API that, some days points to A and other days points to B, how can I do to have a single kubeconfig so that the kubectl user does…
jmhostalet
  • 4,399
  • 4
  • 38
  • 47
0
votes
3 answers

kubectl to allow user to only to copy files in and out of the pods

I have a Kubernetes cluster where my application is deployed. there are some other users they should only be able to copy files into and from a pod. Using kubectl cp command. This user context should not allow the user to do any other operations on…
0
votes
1 answer

Kubeconfig is not working when gcloud is reinstalled in /usr/bin/gcloud

I recently installed by gcloud via apt install gcloud-sdk. So now gcloud is located under /user/bin/glcoud. I updated my ~/.kube/config: xetra11@pop-os:~$ cat ~/.kube/config | grep cmd cmd-args: config config-helper --format=json …
xetra11
  • 7,671
  • 14
  • 84
  • 159
0
votes
0 answers

Connect to dynamically create new cluster on GKE

I am using the cloud.google.com/go SDK to programmatically provision the GKE clusters with the required configuration. I set the ClientCertificateConfig.IssueClientCertificate = true (see…
Ishan Khare
  • 1,745
  • 4
  • 28
  • 59
0
votes
2 answers

How do I switch between different Kubernetes contexts described in distinct kubeconfig yaml files fast?

I need to access several Kubernetes clusters. For each of them, I got a kubeconfig yaml file, e.g. kubeconfig-cluster1.yaml and kubeconfig-cluster2.yaml. How can I easily switch between these configurations? I mean, without setting the KUBECONFIG…
Pierre F
  • 1,332
  • 15
  • 33
0
votes
2 answers

Store data in a file and get reference path to it

I wish to create an environment file not "variable" and get a path to it in the TravisCI pipeline. Attached is the image of how we do the same in gitlab gitlab environment file image I need to store secrets in a file refer is via a path in travisci…
Tannu Priya
  • 313
  • 2
  • 15
0
votes
1 answer

How to use a generated kubeconfig file in the .kube/config

I am using digital ocean to deploy a managed kubernetes cluster and it gives me a config file to download. How do I use the downloaded .yaml file with my default config file in /.kube directory? I tried to merge the config files, but it did not…
0
votes
2 answers

How to fix 'No such file or directory: '/home/jenkins/.kube/config'' when using load_incluster_config in python openshift rest client

I wrote a script that checks some secrets within an OpenShift cluster. I used the python rest-client library for Openshift and the script is executed within the cluster. But i always get IOError: [Errno 2] No such file or directory:…
MartinD
  • 23
  • 1
  • 5
0
votes
0 answers

kubernetes resources jump between namespaces

I have a Kubernetes cluster which has 5 different services. After cluster deployment I can run: kubectl get pods and see all my pods. But after a few minutes when I run the same command again, I see: No resources found. And I'm able to see my pods…
alexarsh
  • 5,123
  • 12
  • 42
  • 51
0
votes
1 answer

How does KubeConfig file is used?

When we setup a kubernetes master using kubeadm init . At the end of the procedure we have to copy the /etc/kubernetes/admin.conf to $home/.kube/config . When I opened the file , I found the below details . certificate authority data client…
Bala
  • 1,077
  • 5
  • 15
  • 35
0
votes
1 answer

How to pass --pod-manifest-path to the kubelet quickly, without creating a new configuration file?

Running kubelet --pod-manifest-path=/newdir returns errors. It's not clear to me where I can add the --pod-manifest-path to a systemd file on Ubuntu. I know for v1.12 there is the KubeletConfiguration type but I am using v1.11.
R678
  • 85
  • 9
-1
votes
1 answer

restore kubeconfig from host system

i set up a k8s cluster and managed to kill my kubeconfig apparently unrecoverably :( I do have access to the nodes though and respectively to the containers running on the controlplance and etcd. Is there any way to retrieve a working kubeconfig…
Peter
  • 96
  • 1
  • 12
1 2 3 4 5 6
7