Questions tagged [kubectl]

The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.

3648 questions
1
vote
0 answers

Merge kubectl config into ~/.kube/config

To use kubectl(to talk to kubernetes api-server) with merged config, below two commands can be used to merge kubeConfig: KUBECONFIG=~/.kube/config:/path/to/another/config.yml kubectl config view --flatten > ~/.kube/config-new.yaml and then cp…
overexchange
  • 15,768
  • 30
  • 152
  • 347
1
vote
1 answer

Kubernetes:delete PODs/services/Configmaps based on age

Anyone know or can point me to where i could find how one can delete kuberenets resources based on Age? I’m trying to build a cron job that would delete old services, pods, jobs, configmaps of a specific namespace. So for example something that…
MSa'ad
  • 13
  • 2
1
vote
1 answer

kubernetes cannot pull a public image

kubernetes cannot pull a public image. Standard images like nginx are downloading successfully, but my pet project is not downloading. I'm using minikube for launch kubernetes-cluster apiVersion: apps/v1 kind: Deployment metadata: name:…
MiyRon
  • 406
  • 7
  • 15
1
vote
1 answer

Jenkins plugin to generate kube config for kubectl after changes to kubectl authentication for GKE

Since for kubectl to access gke, now gke-gcloud-auth-plugin also needs to be installed. I am using jenkins to deploy the changes to gke using the kubectl plugin but now after this change, not able to use the same plugin. Can anyone suggest any…
1
vote
0 answers

my first EKS - error: You must be logged in to the server (Unauthorized)

I've seen this error in many previous questions, but as a complete beginner I'm not sure if those questions were relevant to my situation. I've created a cluster called wiz_try using the AWS EKS gui. When it asked for a role, I've created a new one…
of313
  • 11
  • 2
1
vote
1 answer

why I cannot see the logs in k8s klog via kubectl logs?

I saw some source codes in k8s: // delete immediately, or no graceful deletion supported klog.V(6).Infof("going to delete %s from registry: ", name) if _, _, err := e.Delete(ctx, accessor.GetName(), deleteValidation, options); err !=…
og f91
  • 37
  • 5
1
vote
2 answers

How to update ingress controller with a new deployment

I am very new to azure kubernetes! Right now I am just playing around with it, trying to work out how to create things using kubectl. I already have my cluster set up, and I have created a couple of pods using an existing container in our registry.…
evolmonster
  • 237
  • 1
  • 5
  • 16
1
vote
0 answers

Kubespray - Kubectl localhost AND external load balancer

I have an external load balancer configured via loadbalancer_apiserver but on the kube_control_nodes kubectl tries to connect to localhost:8080 and fails. I assume this is because there is no internal load balancer? Is there anyway I could make the…
user3498593
  • 113
  • 1
  • 1
  • 11
1
vote
0 answers

golang urfave/cli run another binary with all args and flags

I want to invoke other urfave/cli based CLIs, e.g., kubectl with myapp kubectl command. For that, I've a minimal project . ├── go.mod ├── go.sum ├── main.go └── pkg └── cmds └── kubectl.go 2 directories, 4…
1
vote
1 answer

Kubectl Patch Error: does not contain declared merge key: name

Trying to update the resources of my Deployment using kubectl patch command: kubectl patch statefulset test -n test --patch '{"spec": {"template": {"spec": {"containers": [{"resources": [{"limits": [{"cpu": "4000m","memory": "16Gi"}]},{"requests":…
Kartik
  • 13
  • 4
1
vote
1 answer

How can I create node in existing EKS cluster? or give me a solution for my error?

I'm facing this such error in kubernetes( 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate.). My application server is down. First, I just add one file in daemon set , due to memory…
1
vote
1 answer

Kubectl patch is not updating the apiVersion correctly

I run kubent and identify an outdated apiVersion > kubent ... KIND NAMESPACE NAME API_VERSION REPLACE_WITH…
red888
  • 27,709
  • 55
  • 204
  • 392
1
vote
1 answer

Enable tab auto completion for kubectl in bash function

Given a bash function in .bashrc such as kgp () { kubectl get po -n $1 $2 } Is it possible to have kubectl auto complete work for k8s resources such as namespaces/pods? As an example if I use kubectl get po -n nsprefix podprefix I can tab auto…
Kelvin Baumgart
  • 151
  • 1
  • 2
  • 13
1
vote
1 answer

Error in Kubectl command: The connection to the server localhost:8080 was refused - did you specify the right host or port?

I am trying to run kubectl commands in offline mode but it keeps saying> kubectl cordon hhpsoscr0001 The connection to the server localhost:8080 was refused - did you specify the right host or port? I fail to understand what can be the issue. Can…
arpita22
  • 21
  • 4
1
vote
1 answer

Is it possible to extend "kubectl create"?

From "Extending kubectl with plugins": It is currently not possible to create plugins that overwrite existing kubectl commands. [...] Due to this limitation, it is also not possible to use plugins to add new subcommands to existing…
ciis0
  • 311
  • 1
  • 9