Questions tagged [kubeconfig]

105 questions
1
vote
1 answer

Unable to use-context from kubeconfig file

I'm trying to add a new cluster and its context in the kubeconfig file using username and password but its failing. Below are the commands I'm using to set-context. kubectl config set-cluster lab101 --server=https://api-kube.example.com:8443…
cbrdy
  • 792
  • 1
  • 8
  • 27
1
vote
1 answer

Remove kubernetes deployment based on jsonnet file

I am using jsonnet to describe deployment configuration for Kubernetes. { apiVersion: 'apps/v1', kind: 'Deployment', metadata: { name: 'dapi-test-pod', }, spec: { selector: { matchLabels: { app: 'dapi-test-pod', …
Uladzislau Kaminski
  • 2,113
  • 2
  • 14
  • 33
1
vote
2 answers

How to reduce the retry count for kubernetes cluster in kubernetes-client-python

I need to reduce the retry count for unavailable/deleted kubernetes cluster using kubernetes-client-python, currently by default it is 3. WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken…
1
vote
4 answers

kubectl with custom kubeconfig file for a serviceaccount gives unauthorized error

I created a serviceaccount and created a kubeconfig for that service account, but when I ran kubectl --kubeconfig=sa.kubeconfig get nodes or get pods I first got the error: > error: You must be logged in to the server (Unauthorized). And now I get…
bramvdk
  • 1,347
  • 4
  • 21
  • 31
0
votes
1 answer

Accessing kubeconfig file from Azure artifacts

I am new to Azure DevOps and have a requirement where AKS cluster is provisioned through terraform which creates two kubeconfig admin & user files in Azure Devops artifacts. Now I have to call this kubeconfig files to another pipeline to manage…
Nolan1513
  • 1
  • 1
0
votes
0 answers

Kubectl forbidden error with service account & kubeconfig

TL;DR Kubectl Forbidden error when using a service account with kubeconfig, but not other authentication methods. What could I did wrong ? Apologies in advance if dupplicate, I couldn't find my specific scenario and tried all answers that popped on…
peppie
  • 35
  • 7
0
votes
1 answer

kubeconfig exec - running a binary to get the path for the command

I currently have something like this in my kubeconfig exec: apiVersion: client.authentication.k8s.io/v1 command: PATH_DETERMINED_VIA_BINARY/token_generator args: - --ACCESS_TOKEN interactiveMode: Never …
James Franco
  • 4,516
  • 10
  • 38
  • 80
0
votes
1 answer

How to operate a Kubernetes cluster on Digitalocean from Python?

the question I am running a Kubernetes cluster in Digitalocean and I want to connect to it from certain Python app, in order to retrieve information about running services. I am able to setup the connection from my local (where kubeconfig created…
FN_
  • 715
  • 9
  • 27
0
votes
1 answer

Github Actions: How to store kubeconfig in github secrets

I have this kubeconfig file apiVersion: v1 clusters: - cluster: certificate-authority-data: *** server: *** name: *** contexts: - context: cluster: *** user: webhook name: ***** current-context: ***** kind: Config preferences:…
Amin Ba
  • 1,603
  • 1
  • 13
  • 38
0
votes
0 answers

gcloud container clusters get-credentials doesn't work through jenkins pipeline shell, works fine on the instance terminal

When i try to run gcloud container clusters get-credentials --region --project through the jenkins pipeline, I get the following error: ERROR: (gcloud.container.clusters.get-credentials) environment variable…
0
votes
1 answer

How to regenerate kubeconfig on a freshly setup kubernetes cluster

I setup a kubernetes cluster using this tutorial 2 days ago - https://www.linuxtechi.com/install-kubernetes-on-ubuntu-22-04. The setup went fine, and I could run kubectl commands, create deployments, etc. However when I login now, 2 days later and…
Ufder
  • 527
  • 4
  • 20
0
votes
1 answer

kubectl use config for authentication

I'm creating a pipeline to deploy some application in kubernetes. I've been given the authentication credentials as a yaml file similar to the following: apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0tL******0tLS0t …
DeejonZ
  • 2,451
  • 2
  • 17
  • 19
0
votes
2 answers

Error from server (Forbidden): pods is forbidden: User cannot list resource "pods" in API group at the cluster scope

My private AKS Cluster is accessible only to the root user using kubectl on a jumphost. But for a non-root user it throws below error message: someuser@jump-vm$ kubectl get pods -A Error from server (Forbidden): pods is forbidden: User…
Rajesh Swarnkar
  • 601
  • 1
  • 6
  • 18
0
votes
1 answer

How to access EKS cluster with kubeconfig even when disabling endpoint public access

So, I am trying to setup an EKS cluster using Terraform EKS Module. Everything is good, until I try to set the cluster_endpoint_public_access to false. I can no more access the cluster with my kubeconfig and I can no more applying terraform changes…
0
votes
0 answers

Unable to change kube context

I run this AWS command to update my kubeconfig to point to a remote server. Everything works as expected and it's cool. aws --profile XXXXX eks update-kubeconfig --name ${1} Updated context arn:aws:eks:us-east-1:XXXXXXX:cluster/XXXXXXXX in…
Gauraang Khurana
  • 707
  • 1
  • 8
  • 18