Questions tagged [kubectl]

Use this tag if a question is about kubectl

Filter by
Sorted by
Tagged with
-1 votes
0 answers
8 views

Can't resolve service in Kubernetes

Hi all! Please tell me, maybe someone has encountered a similar problem or knows in which direction to think and look. I have a pod that wants to connect to Redis, but we use dragonfly instead, but ...
Moonlight's user avatar
0 votes
0 answers
12 views

`apiVersion` is set to `v1beta1`. Still getting 'no kind "ExecCredential" is registered for version "client.authentication.k8s.io/v1alpha1"'

Despite having explicitly set apiVersion: client.authentication.k8s.io/v1beta1, why the following error when running any kubectl command (f.e. kubectl version)? Unable to connect to the server: ...
VanillaDonuts's user avatar
0 votes
0 answers
6 views

Google cloud shows persistent disk SSD is full, wherease I do not have anything deployed currently

I am deploying a kubernetes cluster always in the demo namespace. However, even after deleting my namespace, google cloud shows almost full persistent disk usage. This behaviour does not happen every ...
lorand vatamany's user avatar
-1 votes
0 answers
29 views

Error from server (BadRequest): container velero is not valid for pod node-agent-

I'm getting frequent errors when I want to use kubectl exec deployment/[deployment]. This happens with Velero, a Kubernetes backup tool, but I assume that it happens with other deployments as well, ...
Kalle Richter's user avatar
-1 votes
0 answers
19 views

Error in deploying airflow by kubectl+kubeadm+helm+caiico cni

Description I installed airflow from offical kubectl, kubeadm, helm, calico cni website but airflow can't be deployed. Tried Install kubectl, kubeadm, helm from offical website. Install calico cni ...
Tai Lu's user avatar
  • 1
0 votes
1 answer
71 views

Execute Kubernetes commands with Jenkins

I am a beginner to devops and right now I'm learning jenkins. I have a kind cluster on my local machine and jenkins running inside a docker container at http://localhost:8000. I wish to execute the ...
Haaris Khatri's user avatar
0 votes
0 answers
10 views

How to configure kubectl scale command to fail if image is wrong

If the current image is wrong/old/dne then I want this command to fail: kubectl scale deploy gms --replicas=4 it just scales whatever is there - but I want it to check to ensure it's scaling the ...
Alexander Mills's user avatar
0 votes
0 answers
39 views

How to use Kubernetes OICD-Login WITH OTP but WITHOUT userinterface/browser?

I am connecting to Kubernetes Cluster, using kubectl oidc-login ( https://github.com/int128/kubelogin/ ) and using grant-type=password as there is no browser available on the system. This works fine: ...
Simon_Prewo's user avatar
0 votes
0 answers
46 views

kubernetes pods/pod/exec API call 403 forbidden response

I have an init-container in my deployment definition with a shared volume and a directory '/validators'. Inside this directory, there is a sh file that I want to execute using the following URL http://...
elyes kabous's user avatar
0 votes
0 answers
30 views

How to skip a required CRD property for server-side apply with kubectl?

I'd like to patch an existing PrometheusRule which has spec.groups[].rules[].expr required. The existing rule has an expr, however I'd like to omit it from my patch because the existing one is fine ...
Kalle Richter's user avatar
-1 votes
0 answers
143 views

Cilium installation problem after kubeadm init for a 2 node Kubernetes cluster in local VMs

I want to setup a 2 node Kubernetes cluster in local VMs using VMware. I have set up the control node using the following command: kubeadm init --pod-network-cidr=10.1.1.0/24 --apiserver-advertise-...
Panagiotis Pavlidis's user avatar
0 votes
1 answer
176 views

How to deploy an nginx ingress to a kubeadm cluster

I'm attempting to set up my own bare-metal Kubernetes cluster composed of a control plane (VPS 149.62.186.95) and a worker node (VPS 149.62.189.139). Both my VPS are running Ubuntu 22.04 with 2 vCPUs ...
Lorenzo Rottigni's user avatar
-1 votes
0 answers
21 views

K8s cluster has kube-system pod limits that are excessively high

Using AKS, the cluster has limits that are overcommitted due to kube-system pods having excessively high CPU/memory limits. kube-system pods like coredns or have a combined CPU limit of 300+% This is ...
John Doe's user avatar
1 vote
1 answer
388 views

Kubenetes new Pods/Deployments/Resources stuck in pending state forever without error

I have a local Kubernetes cluster setup using kubeadm. Everything was working fine a few days back but now I've got a strange problem. Whenever I add new resources be it a deployment or pod, it never ...
Sharad Tomer's user avatar
0 votes
1 answer
24 views

Redefine deployment (Portainer) pvc after node failure

I have a home lab running k3s. NAME STATUS ROLES AGE VERSION k8s-node-001 Ready control-plane,master,worker 302d v1.27.6+k3s1 k8s-node-002 Ready worker ...
JoSSte's user avatar
  • 133
0 votes
0 answers
16 views

How to delete Kubernetes Finalisers Kubernetes.io/pv-protection?

I am trying to delete the finalisers in the PV by issuing kubectl patch command and it deletes partially leaving behind Kubernetes.io/pv-protection Described the PVC and able to see two entries ...
user2586964's user avatar
1 vote
1 answer
58 views

What is a "single kubectl list object" as mentioned in jsonnet documentation?

The jsonnet documentation > Using Jsonnet With Kubernetes says: Use YAML stream output, multi-file output, or a single kubectl list object. This latter option is provided by Kubernetes without ...
RubenLaguna's user avatar
1 vote
1 answer
118 views

How to set context to be default in kubectl?

When I do : $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO ...
user63898's user avatar
  • 111
0 votes
1 answer
270 views

Config not found in /home/$USER/.kube/config

When I run k3s kubectl version $ k3s kubectl version W0730 19:46:32.066086 17273 loader.go:222] Config not found: /home/ecarroll/.kube/config [...] The connection to the server localhost:8080 was ...
Evan Carroll's user avatar
  • 2,089
1 vote
1 answer
220 views

How can I change the context of kubectl commands and helm?

Currently helm is installing to the wrong cluster on GKE, how can I install to a different cluster?
Evan Carroll's user avatar
  • 2,089
0 votes
2 answers
2k views

Bandwidth utilization by pod on Kubernetes

Can someone tell me how I can get bandwidth usage per pod in Kubernetes from CLI? Ideally, I need something that will extract bandwidth usage for every pod.
iRakic's user avatar
  • 1
3 votes
2 answers
1k views

I am looking for a production alternative to kubectl port-forward

I want to know what are production alternatives to make http://192.168.49.2:30001 this accessible http://host_machine_ip:8007 here I have set up minikube cluster with mobile-api service on it. ...
Giorgi Beria's user avatar
1 vote
1 answer
8k views

With kubectl, I'm getting Unable to connect to the server: x509: certificate signed by unknown authority

When I run something with k3s, like kubectl apply, I'm getting Unable to connect to the server: x509: certificate signed by unknown authority
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
526 views

kubectl uses wrong IP

My kubectl suddenly stopped working. Any commands results in "no route to host". For example, getting logs kubectl logs mypod-746cfd667b-tdrnt Error from server: Get "https://hades:...
mikabytes's user avatar
  • 161
1 vote
1 answer
3k views

How to get a list of deployments that only have a certain label in the spec section

I know that I can perform this command to see all the pods that have a certain label : kubectl get pods -l importance=normal Is there a command that would allow me to get the deployments that create ...
ErnieAndBert's user avatar
1 vote
1 answer
36 views

Kubernetes apply to get to desired state

I feel like I have a terrible knowledge gap when it comes to managing the resource states within Kubernetes. Suppose I have 2 deployments in my cluster, foo1 and foo2. They are both defined in ...
Murali Varma's user avatar
0 votes
2 answers
58 views

How to get ride of running "sudo swapoff -a" command everytime before running "kubectl" commands?

It seems I must run sudo swapoff -a command everytime I want to run kubectl commands because if I don't do that it gives me such a following error: The connection to the server 192.168.1.2:6443 was ...
best_of_man's user avatar
2 votes
2 answers
599 views

Why do I get different responses either when I use `sudo` before `kubectl` or not?

For example when I use kubectl get pods the response is: No resources found in default namespace. But when I use sudo kubectl get pods the result is: E1211 12:01:15.409201 50965 memcache.go:238] ...
best_of_man's user avatar
1 vote
1 answer
952 views

How do I list pods sorted by label version in Kubernetes?

I need to list some pods sorted by version and get the last index of it. I'm trying to do like: kubectl get pods --namespace my-namespace --selector "app.kubernetes.io/name=my-cool-pod" --...
Iso404's user avatar
  • 21
2 votes
0 answers
192 views

PreStop container hook on Pod termination

I have two containers in my Pod (one main app container and another one is just a simple nginx reverse proxy) containers: - name: my-app - name: my-nginx lifecycle: ...
Most Wanted's user avatar
2 votes
0 answers
839 views

How to colorize kubernetes logs?

It's easy enough to enable colorful logs on docker containers (by setting TERM=xterm-256color and running with tty: True). Still, I'm not getting any color when I run kubectl logs/stern on the ...
Jesse's user avatar
  • 121
2 votes
1 answer
443 views

How to run short-lived command using kubectl

I was trying to measure pod startup time buy running the following: % kubectl run --image busybox --attach test -- date error: timed out waiting for the condition At first it seems like this command ...
Kevin Cox's user avatar
  • 141
0 votes
1 answer
4k views

It seems like the kubelet isn't running or healthy [closed]

What did I want to do here? I want to make 3 node Kubernetes cluster First I install Ubuntu server 20.04.3 LTS in my VMware and this way too I make 3 servers. After I install docker and Kubernetes and ...
Hamza Zahidul Islam's user avatar
2 votes
0 answers
217 views

Can kubernetes `--force` delete of pods be disabled by administrators?

Using kubectl delete pods PODNAME --force removes the pod from the Kubernetes API without checking the underlying pod deleted successfully. In most cases this means resources are locked indefinitely, ...
David Parks's user avatar
1 vote
3 answers
1k views

How to expose a service ( Experssjs Api ) deployed on minikube ( 192.168.49.2 ) to be able to access it from another device in the same network?

I've created a service inside minikube (expressjs API) running on my local machine, so when I launch the service using minikube service wedeliverapi --url i can access it from my browser with ...
Ali Ourag's user avatar
1 vote
1 answer
2k views

kubectl retrieve update time for the resource

I'm wondering whether it's possible to get the time where my resource was updated? e.g. via $ kubectl describe deployment/myapp I can see CreationTimestamp but I want to know the last time new ...
Most Wanted's user avatar
2 votes
1 answer
952 views

How to get public key from cert-manager?

I need to get a public key from cert manager from bash. How to do it properly? I can see the private key in kubernetes secrets; how to get public key that can be safely shared?
Karel Bílek's user avatar
2 votes
1 answer
643 views

HAProxy Not Working with Kubernetes NodePort for Backend (Bare Metal)

I have a host running HAProxy already. It's been up and running since before I did anything with Kubernetes. It works flawlessly as a reverse proxy and SSL terminator for various web things in ...
Adam Winter's user avatar
0 votes
1 answer
251 views

Change kubernetes resource requests after pod/job has started

I'd like to change my pod's CPU request value after a pod has started. Is this possible? In our shared kubernetes system there is a requirement that our actual resource usage be "reasonably close&...
David Parks's user avatar
-1 votes
1 answer
275 views

How to read Kubernets secrets values

What could be the kubectl command to see k8s secret values I tried kubectl get secrets/<secrets-name> -n <namespace> It returns NAME TYPE DATA AGE secrets1 Opaque ...
Dupinder Singh's user avatar
1 vote
1 answer
1k views

OIDC token invalid when put into kubeconfig

I can connect to the Kubernetes API from a container running inside the cluster with an OIDC token like so: kubectl —token $token get pod I would now like to prepare a kubeconfig such that other ...
rookie099's user avatar
  • 141
1 vote
1 answer
108 views

Scheduling a build using Kubernetes

The doc https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html provides details of creating a cron job. To start a scheduled task that executes a build every 10 mins I use the ...
blue-sky's user avatar
  • 111
2 votes
3 answers
4k views

kubectl asking for username (k8s cluster created via kops)

I created a kubernetes cluster using kops and deployed it in AWS (not EKS manual cluster using kops). Then I export in my local machine the configuration like kops export kubecfg --state ${...
Kristi Jorgji's user avatar
1 vote
1 answer
646 views

Failed to install kubernetes on centos

Following the official documentation, I have an error when trying to install kubernetes cluster yum package. I am on Centos 7 using yum. So I run this commands: cat <<EOF | sudo tee /etc/yum....
french_dev's user avatar
6 votes
2 answers
6k views

Kubernetes configuration with yaml anchors

I have a deployment.yaml file and want to reuse the environment for all my deployments like this: apiVersion: apps/v1 kind: Deployment metadata: name: beat spec: selector: matchLabels: ...
Most Wanted's user avatar
1 vote
1 answer
1k views

How to get CPU and Memory usage of nodes in a specific Kubernetes instance group?

I have a couple separate instance groups, and kubectl top nodes will display the CPU and Memory usage of all nodes. I'd like to be able to just ask for the information for a specific instance group if ...
James's user avatar
  • 111
1 vote
1 answer
874 views

Get all Deployments referencing given ConfigMap by the ConfigMap's name

Suppose I have a ConfigMap: apiVersion: v1 kind: ConfigMap metadata: name: london-tz-config data: SERVER_TIMEZONE: "Europe/London" I also have about 50 distinct Deployments. Let's say ...
kalatabe's user avatar
  • 163
0 votes
1 answer
695 views

config.yaml is not setting up a new context

I have a kubernetes Config file such as: apiVersion: v1 kind: Config preferences: {} contexts: - context: cluster: test-sim-development namespace: test-sim user: developer name: test-sim ...
Nona's user avatar
  • 101
1 vote
2 answers
5k views

How do I list pod name/version across multiple clusters in Kubernetes

I have multiple clusters that I want to query and in each cluster I want to find and list the versions of the pods running in there. I've written a shell script that sets the namespace and then ...
Guy's user avatar
  • 111
1 vote
1 answer
94 views

kubectl create deployment not has the option containerPort

When I execute kubectl create deployment nginx --image nginx --dry-run=client -o yaml it does not have options --port or --containerPort. My yaml is: apiVersion: apps/v1 kind: Deployment metadata: ...
Afonso Rodrigues's user avatar