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

Kubernetes and microk8s join error: Joining failed

I am trying to learn microk8s. I installed 3 Ubuntu in my virtual box. I installed the microk8s on each of these virtual machines. I want machines in the form of master node and 2 worker nodes to communicate with each other. I tried to use microk8s…
nobody1879
  • 41
  • 4
1
vote
0 answers

Jcasc and credentials as a kubernetes secret

I've defined Jenkins credentials as a kubectl secrets. apiVersion: v1 kind: Secret metadata: name: "git" labels: "jenkins.io/credentials-type": "basicSSHUserPrivateKey" annotations: "jenkins.io/credentials-description" : "private…
syncerror
  • 131
  • 1
  • 10
1
vote
1 answer

Append Namespace and pod name in output of resource utilization

I have been able to generate the following output with plugin of kubectl in following way : ./kubectl get namespaces | awk '{ print $1 }' | while read x; do ./kubectl resource-capacity --sort cpu.util --namespace $x --util --pod-count --pods;…
1
vote
1 answer

Output of echo in a while loop inside a busybox container does not change

I am trying to get a busybox Pod to output some logs in a JSON format every second while updating the time timestamp and the msg value for debugging purposes. For that, I create the following hello-pod cat <
usersina
  • 1,063
  • 11
  • 28
1
vote
0 answers

Unable to run kubectl command on fully private EKS Cluster

I am having a very hard time to deploy and access fully private eks cluster. My Issue: I have deployed a fully private cluster and I am not able to run kubectl command even from the machine in cluster's VPC. Also, whenever I try to create nodes I…
1
vote
1 answer

How to copy file from local system to kubernetes pods with new kubectl version

I'm trying to copy files from my local to kubernetes pods. I've been using the command for a very few months now and everything worked fine: kubectl cp C:/test.jar backend-0:/usr/local/myproject/tomcat/webapps/WEB-INF/lib -c tomcat Now I bought a…
1
vote
0 answers

Error - no kind "ClientConfig" is registered for version "authentication.gke.io/v2alpha1" in scheme "pkg/runtime/scheme.go:100"

Below is the code(with invalid kubernetes cluster URL - 10.xx.xx.xx sitting in google cloud) : package main import ( "fmt" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" ) func NewK8sClient(masterUrl, kubeconfigPath…
overexchange
  • 15,768
  • 30
  • 152
  • 347
1
vote
0 answers

Different ways to test the Pod Disruption Budget in Kubernetes

I want to test the Pod Disruption Budget for my applictaion. One way I see is to use kubectl drain command but that is something I do not want to do because of some sharing issue. Are there any other ways to test if PDB working as expected ?
Nish
  • 922
  • 13
  • 31
1
vote
3 answers

kubectl command for talking to multiple physical clusters

This is my ~/.kube/config file: apiVersion: v1 clusters: - cluster: server: https://192.168.10.190:6443 name: cluster-1 - cluster: server: https://192.168.99.101:8443 name: cluster-2 contexts: - context: cluster: cluster-1 user:…
overexchange
  • 15,768
  • 30
  • 152
  • 347
1
vote
0 answers

RKE : Failed to apply the ServiceAccount needed for job execution

Failed to apply the ServiceAccount needed for job execution: Post \"https://44.198.185.122:6443/apis/rbac.authorization.k8s.io/v1/clusterrolebindings?timeout=30s\": read tcp 192.168.1.6:63871->44.198.185.122:6443: wsarecv: An existing connection was…
1
vote
1 answer

kubectl patch doesn't update status subresource

I am trying to update status subresource for a Custom Resource and I see a discrepency with curl and kubectl patch commands. when I use curl call it works perfectly fine but when I use kubectl patch command it says patched but with no change. Here…
user3435964
  • 663
  • 1
  • 11
  • 23
1
vote
3 answers

kubectl short alias for deployment

Is there any shorter alias on the kubectl/oc for deployments? In OpenShift you have deployment configurations and you can access them using their alias dc. Writing deployment all the time takes too much time. Any idea how to shorten that without…
1
vote
2 answers

Minikube have no external ipaddress

I am running my minikube as docker image. I am trying to expose my service to outside world using Nodeport. This is my yaml file. apiVersion: apps/v1 kind: Deployment metadata: name: docker-hello-world labels: app: docker-hello-world spec: …
1
vote
2 answers

Fix kubectl version skew

I want to fix version difference between client (1.21) and server (1.24). 1.21 version for client is desired version. So version for server shall be decreased. $ kubectl version --short Client Version: v1.21.14 Server Version: v1.24.3 WARNING:…
Ryo Matsuzaka
  • 135
  • 1
  • 1
  • 9
1
vote
2 answers

Terraform kubectl provider error: failed to created kubernetes rest client for read of resource

I have a Terraform config that (among other resources) creates a Google Kubernetes Engine cluster on Google Cloud. I'm using the kubectl provider to add YAML manifests for a ManagedCertificate and a FrontendConfig, since these are not part of the…
Niels Kersic
  • 830
  • 1
  • 9
  • 24