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.

Filter by
Sorted by
Tagged with
-1 votes
3 answers
40 views

Unable to run a Shell inside a k8s pod

When I run the command kubectl exec -it backstage-test01-5d877c7f54-425s6 -n customer-namespaces -- /bin/bash it returns this error : Defaulted container "linkerd-proxy" out of: linkerd-...
Ghassen's user avatar
  • 591
-1 votes
0 answers
18 views

I'm creating a kubernetes cluster setup in ec2 using kubeadm I want to expose my frontend application through the internet with Load Balancer Service [closed]

I do not want to complicate with an ingress controller because its for learning purposes and I want to use LB service type, but I'm a bit confused about how the cloud controller manager works and even ...
dipuerto's user avatar
0 votes
0 answers
7 views

Microk8s gpu alloc by vram size

I have microk8s node with different type gpu. ( RTX A5000, Rtx A2000) I install nvidia-gpu-operator and it reports this node has two "nvidia.com/gpu" my labelallocatable gpu is 2 Two gpu has ...
Chaosdragon's user avatar
0 votes
0 answers
21 views

How to disable pod editing in kubernetes

I have a cluster on Azure composed by some pods installed by helmfile and managed by kubernetes. Now all users can execute kubectl edit on the pods and can change docker image version and environment ...
Stef C's user avatar
  • 1
0 votes
2 answers
71 views

Does "kubectl logs -f -l" follow newly created pod?

kubectl logs -f with label seclection by -l like the followings: $ kubectl logs -f -l 'role=job' shows all pods matching the label-selection and keep the streamed logs. What happens when a pod is ...
Fumisky Wells's user avatar
0 votes
1 answer
20 views

How to exclude fields in kubectl get

When running kubectl get -o yaml, I would like to filter out the annotation kubectl.kubernetes.io/last-applied-configuration so results are easier to read. Is there a native way of doing this with ...
gtirloni's user avatar
  • 357
0 votes
2 answers
47 views

How do I log into ECR to pull images if I can't use docker as a runtime?

One of the steps to log into ECR required to pull and push images is the following, according to AWS (https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html): aws ecr get-...
winterlyrock's user avatar
0 votes
1 answer
25 views

How do I use "kubectl" instead of the path to the kubectl.exe in Powershell

When I run Kubernetes commands, Powershell is wanting me to use the path to the kubectl.exe instead of just using the command kubectl. I'm told using an Alias would work but I'm not sure how to do ...
burntcookie's user avatar
0 votes
0 answers
15 views

Facing intermittent timeout issues with GKE [closed]

So there are two VMs in different network , One on Private VPC of Gcloud lets call it GCVM , and another being on-premise OPVM , both VMs have appropirate permissions to access Kubernetes Cluster , ...
Prime108's user avatar
0 votes
0 answers
9 views

How to activate bash-completion for cnpg's kubectl plugin when running on a local k3s node?

cnpg completion will work when running like this: . <( kubectl cnpg completion bash ) however, when running on a k3s node, the proper way to run kubectl is either: k3s kubectl ... or, make the /...
Lockszmith's user avatar
  • 2,172
0 votes
0 answers
23 views

How to add bash auto completion to `k3s kubectl ...`?

I add bash-completion for k3s by running: . <( k3s completion bash ) When I run the following, I only get bash-completion for kubectl ... and not k3s kubectl ...: . <( k3s kubectl completion ...
Lockszmith's user avatar
  • 2,172
0 votes
0 answers
22 views

How to change namespace by Rancher kubectl

I installed rancher via podman and created a namespace. Now when I start the kubectl shell via the UI, I am not able to change the namespace via: kubectl config set-context --current --namespace=XXX ...
chef's user avatar
  • 75
-1 votes
0 answers
48 views

I get an error saying pod has unbound immediate PersistentVolumeClaims, but all my pvc are bound. What do I do? I have followed exactly the tutorial

thanks for reading my issue. I am following this tutorial on deploying a MSSQL server to AKS, but on deploying, the pod won't run. I am unsure why. So all I really did was git clone the sample-helm-...
Manolo Viso Romero's user avatar
0 votes
1 answer
34 views

Kubernetes: Need advice deleting a list of pods with pause in-between deletions

Good day. Is there a Kubernetes pod deletion method for deleting a list of 48 pods while waiting until the previous pod has 'Running' status before deleting the next pod in the list? I tried using a ...
Bjoern's user avatar
  • 1
0 votes
1 answer
21 views

Is there a reference of default kubectl column templates?

Is there a way to get from kubectl the default template of the output, if not, is there an online resource for these? It doesn't matter which format it outputs, I'm just interested in a reference of ...
Lockszmith's user avatar
  • 2,172
0 votes
0 answers
26 views

Using --sort-by with kubectl get pods --all-namespaces to sort by both namespace AND name doesn't work

I'm guessing at this point the answer is a big fat NO. I'm reaching the hive mind here for a clear answer of why, or in case I'm wrong (which I really hope I am) for a concrete example. I've been able ...
Lockszmith's user avatar
  • 2,172
0 votes
1 answer
36 views

How to execute a shell command in Pod B from Pod A using Kubertenes client in GKE

I have a server deployment with Horizontal scaling. The deployment will have 3-5 pods at any given time based on the load. I use volume mapping to pass configuration data to the deployed server pods. ...
Navin Vinayagam's user avatar
0 votes
1 answer
67 views

One-off kubectl run with file

I would like to execute a one-off in a Kubernetes cluster, however using a file from the local file system. Something like: kubectl run mytmpjob --rm --restart='Never' \ --command <some-command-...
peterh's user avatar
  • 18.5k
0 votes
1 answer
30 views

"kubectl --template". How can I understand it?

I can't catch up what is the difference between kubectl.....-o jsonpath='{...}' and kubectl....--template='{{...}}' Are they both just for retrieving data? I know well about the jsonpath flag. But ...
dykim123.kim's user avatar
0 votes
0 answers
20 views

Access failing for private endpoint in Oracle kubernetes cluster

I am trying to connect to a private Oracle OKE cluster but it is failing with below error $ sudo kubectl get nodes E0912 15:34:18.729625 57232 memcache.go:265] couldn't get current server API ...
Zama Ques's user avatar
  • 1,502
1 vote
0 answers
23 views

Periodic "Connection Refused" errors when using kubectl on AWS EC2

I have an AWS EC2 machine with the following specification: Instance Name vCPUs RAM EBS-Optimized Bandwidth Network Bandwidth c5a.8xlarge 32 64 GiB 3.170 Gbps 10 Gbps I installed Kubernetes on it ...
Yaya's user avatar
  • 97
0 votes
2 answers
18 views

Using Nodejs to parse kubectl output "TypeError: item.spec.map is not a function"

Using nodejs trying to parse attribute value(number of replicas) by running child_process kubectl deployment json output Can you please suggest what I am doing wrong?? ** Error: var deploymentInfo = ...
UAB_SRR's user avatar
0 votes
0 answers
21 views

kubectl fails to fetch Argocd resource of type Application when kubectl inside a container

We have a gke cluster and we have installed ArgoCD on it. When we run the command locally to get applications: kubectl get applications -n argocd the list of Application resources can be seen. Then, ...
Muhammad Hasan's user avatar
-2 votes
0 answers
16 views

Do DigitalOcean block storages allow multiple pods to access them?

I would like to create a volume that multiple pods can access. I want that volume to be in a block storage. However, I have seen that block storages don't allow for ReadWriteMany. But it also says ...
John LeRouge's user avatar
0 votes
0 answers
53 views

Kubenetes deployment get failed, got "Liveness probe failed: HTTP probe failed with statuscode: 503" error

Kubernetes cluster was already there, I want to deploy latest version of the code, when updating the docker image version, newly created pod starts throwing error Liveness probe failed: HTTP probe ...
Bhanwarlal Chaudhary's user avatar
0 votes
1 answer
43 views

Unable to place the Pods Evenly

No matter how hard I tune this, I am not able to make the Pods spread evenly across the four nodes in AWS EKS Cluster. Here's the Pod yaml. nodeSelector: node_env: my-node-name affinity: ...
Arun V's user avatar
  • 3
0 votes
0 answers
21 views

Unable to get results when querying the Azure DNS zone list

I am following this tutorial to create a cloud based app. I am very unfamiliar with Azure as its my first time doing something like this. On unit 7, it instructs me to run this command in bash: az aks ...
Alex Alpert's user avatar
-1 votes
1 answer
64 views

How to update a statefulset?

I have a stateful set that I want to update but I get the error: The StatefulSet "postgres" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', '...
Jenia Ivanov's user avatar
  • 2,483
0 votes
0 answers
38 views

How to update the public IP of AWS EC2 instance in Route53

I'm running a k8s cluster in AWS and I got the following error after I ran kubectl get cluster-info: E0902 13:22:08.516718 897 memcache.go:265] couldn't get current server API group list: Get &...
kykywei's user avatar
  • 13
0 votes
1 answer
53 views

How to find out the API group a resource belongs to?

In my k3s cluster, I am editing a Role to add permission to a resource e.g. deployment. apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: creationTimestamp: "2023-09-02T08:00:23Z&...
user842225's user avatar
  • 5,487
0 votes
1 answer
64 views

Retrieve Logs of Deleted Pods in Airflow Running on Kubernetes

I'm running Apache Airflow on a Kubernetes cluster and I'm facing an issue with retrieving logs from deleted pods. I can easily get logs from currently running or recently terminated pods using ...
The Dan's user avatar
  • 1,438
0 votes
1 answer
35 views

kubectl- The connection to the server x.x.x.:6443 was refused - did you specify the right host or port?

I have set up a kubernetes cluster with a master node and a worker node. I am facing below error whenever I run a kubectl command- The connection to the server x.x.x.:6443 was refused - did you ...
Oshin aggrawal's user avatar
0 votes
1 answer
24 views

Using Nodeport to access api in pod Kubernetes Service

I created a nodeport service on a port 12345, to access my api running on node 6666, deployed through a pod. The pod is deployed in multiple nodes. ports: - port: 8181 targetPort: 6666 ...
Lakshmi Narayanan's user avatar
-1 votes
0 answers
61 views

How to set default kubectl namespace inside a pod

I know I can set the default namespace for kubectl in this way: kubectl config set-context --current --namespace=NAMESPACE But when running inside a pod, there is no current context, so I cannot set ...
david.perez's user avatar
  • 6,160
-1 votes
0 answers
25 views

How to check which process is taking how much memory in a k8 pod [duplicate]

How to check which process is taking how much memory in a k8 pod. How to list down all the processes running in a pod and their memory usage.
keshav goyal's user avatar
0 votes
1 answer
19 views

How do I get a List of all the Service in Kubernetes using kubectl

How do I get a List of all the Service in Kubernetes using kubectl ks get services -o jsonpath='{range .items[*]}{.metadata.name}. {.metadata.namespace}.svc.cluster.local{"\n"}{end}' ...
Hugh Brien's user avatar
0 votes
0 answers
56 views

Kube API extension server client-cert-based authorization does not work with kubeconfig file client-certificate-data

Currently on k8s 1.24.13 I have client cert auth enabled and functioning normally (almost) from my extension api-server using the client-ca-file option with clients presenting certs in which the ...
SDee's user avatar
  • 113
1 vote
1 answer
54 views

How to list all resource to secret mappings?

I am looking for a kubectl command that will list everywhere a secret is referenced. Example output: deploymentABC - secretkeyname1 deploymentXYZ - secretkeyname2 statefulset123 - secretkeyname1 I ...
tooptoop4's user avatar
  • 244
-1 votes
1 answer
37 views

Query kubectl resources in config file

I have a yaml file that looks like this --- apiVersion: batch/v1 kind: CronJob metadata: name: hello-cron-job namespace: hello-world spec: schedule: "0 * * * *" jobTemplate: spec:...
andythsu's user avatar
0 votes
1 answer
27 views

unable to get restarted/crashed pod's log from previous option

My k8s pod gets terminated/crashed sometimes and restarts automatically. When I try to see the old log to debug for the crash, I get the below error. If terminated container not found, then how can I ...
myquest9 sh's user avatar
0 votes
0 answers
31 views

Node CLI commands through kubectl exec pod_name --

I am trying to build a script, which would be running database queries on a pod, after loading node CLI. Manually, i run kubectl exec pod_name -- node test.js, and that would give me a CLI and I run ...
Sugesh Nair's user avatar
0 votes
1 answer
40 views

How do nodes communicate with each other in a Kubernetes cluster?

I executed the kubectl get nodes -o wide command, and in the results, there is a column labeled INTERNAL-IP, which displays the internal IP for each node. I would like to understand if the nodes use ...
Dev OV's user avatar
  • 19
0 votes
0 answers
19 views

Minikube's kubectl path. Where is kubectl?

Kubectl is included with minicube. I use it. I need path to minikube's kubectl to use VS Code's Kubernetes extension. I don't want to install kubectl separetely Chat GPT suggested me: echo "$(...
user3565923's user avatar
0 votes
1 answer
15 views

Error when running minikube tutorial export POD_NAME

I'm running the kubernets bootcamp tutorial using minikube and one of the tutorial asks to register the POD_NAME by running a command: export POD_NAME="$(kubectl get pods -o go-template --...
user2588025's user avatar
0 votes
0 answers
80 views

Terraform error - failed to create kubernetes rest client for read of resource: yaml: line 23: mapping values are not allowed in this context kubectl

Running into an issue while running terraform scripts ('terraform init' works, then terraform apply or terraform destory gives the following error): │ Error: failed to create kubernetes rest client ...
G.Dhesi's user avatar
0 votes
1 answer
20 views

Where does kubectl store its logs?

I'm trying to locate any logs that kubectl may store related to errors raised locally in the process of executing kubectl commands. I can't find any documentation of where logs for the CLI itself may ...
Erik Peterson's user avatar
0 votes
1 answer
48 views

How to edit a kubernetes secret using Rust?

I want to update a secret. It has a data field, the value of which needs to be updated. In Rust, I can use the APIs create and delete but there is no update or edit. However, I can use kubectl edit ...
Aviral Srivastava's user avatar
0 votes
1 answer
23 views

Minikube cluster not working correctly on windows - web app not loading

I'm trying to develop a simple cluster using minikube on my local machine. Minikube is running on top of docker as a container. I was unable create image and up and run containers. for that, i upload ...
Dulana's user avatar
  • 1
0 votes
0 answers
38 views

JSON related error (maybe) on kubectl patch serviceaccount

I'm following this digital ocean tutorial and while running the steps, I had ran into an error regarding JSON. No matter what I pass for -p, I always get the given error. Why? I'm on windows? ...
Frank V's user avatar
  • 25.2k

1
2 3 4 5
74