Questions tagged [kubectl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Kube-apiserver Unable to authenticate the requests, All workers NotReady Status

All of the workers status are NotReady. Kubelet on worker node shows below problem. Kubelet stopped posting node status Inspecting one of the workers kubelet shows below. systemctl status kubelet ...
19 votes
3 answers
76k views

How could I find the Kubernetes Pod restart reasons

In have scaled my Pods to 20 in my cluster and when I see the next day the few of the scaled Pods were recreated. When I say Pod recreated, it is getting deleted and created freshly and the timestamp ...
0 votes
0 answers
9 views

PVC is in terminating state and PV is in bound state in Kubernetes

I have the PVC which is in terminating state (because it is referenced from 3 other pods) and the PV is in bound state. PV has the retain reclaiming policy. Also I am not sure on the reason for the ...
0 votes
1 answer
57 views

kubeProxy unable to get node ip

I currently running a k8s cluster setup where I have 3 master nodes and 3 worker nodes installed with Kubeadm. Each one of the master nodes is responsible for managing a worker node. In one of my ...
0 votes
0 answers
135 views

Pods getting restarted after containerd and kubelet service restarts

As part of configuration changes take place, both containerd and kubelet serivces need restart. Upon restarting services, all the pods running on the node getting restarted. I've checked the events ...
0 votes
1 answer
31 views

How to keep the .kube/config tidy after deleting a cluster?

In Microsoft Windows, I'm finding that as I create and delete AKS clusters that my .kube/config file is accumulating context entries for things that I've deleted. I've tried using the following ...
1 vote
2 answers
1k views

Kubeadm and kubectl - connection refused

I deployed a basic cluster on two virtual machines (kvm) with one being designated as master with control plane on it using kubeadm init - everything sees to be starting correctly, but when I try to ...
0 votes
0 answers
146 views

Best practice to grant only necessary permissions to Kubernetes cluster user and pods?

Even though new to kubernetes clusters, I am assigned to deploy and administrate one for my lab. For now, pods with pytorch containers using gpus (those will be the most typical kind of pods to be ...
0 votes
1 answer
2k views

Cannot install kubectl on Ubuntu - GPG Error

Hi I'm trying to install kubectl following the native package install instructions on the official site, but I get the following error when I try to update apt package list before installing kubectl: $...
1 vote
1 answer
8k views

Kubelet is in running state but kubectl is giving connection to the server refused error

Kubernetes cluster was working fine earlier, Started getting issues running kubectl commands after restarting the master node (1.0.0.0). When I run kubectl get nodes command I am getting below error. ...
0 votes
1 answer
4k views

Kubernetes k3s master node fails to ready with FailedCreatePodSandBox errors

I'm trying to setup a small 4 worker node cluster atm and I just installed k3s on my raspberry pi 4s (8gb) and I'm getting a NotReady status. I'm new to kubernettes/k3s, but I believe with a totally ...
1 vote
2 answers
880 views

which K3S ports should (not) be exposed on a public interface

The K3S documentation explains which ports are required for this kubernetes distribution to work. What it does NOT explain is, which of these ports are OK to be open on a public interface. K3S seem to ...
0 votes
0 answers
58 views

Kubernetes Template for Custom Resources

in Kubernetes there is a way to get the template of the core resources like this: kubectl create secret generic --dry-run=client --output=yaml Is there a way to do the same for Custom Resources? I ...
0 votes
1 answer
179 views

Configure kubectl command to access remote minikube cluster on virtualbox debian VM

i have set up successfully on debian minikube with simple cluster Debian VM : umen@debian12:~$ kubectl get pods NAME READY STATUS RESTARTS AGE hello-77c947d946-jq2s4 1/1 ...
0 votes
0 answers
46 views

how to automate using rancher cli for updating docker image tag in deployment

We have some dev and qa k8s clusters managed using rancher. Every production release our team uses the rancher web ui to change the image tag version and update the app. We want to automate this ...
0 votes
1 answer
389 views

Facing error again in minikube renew certificate

When I run kubectl command getting error is certificate expired How to debug minikube errors? kubectl get pods Unable to connect to the server: x509: certificate has expired or is not yet valid
0 votes
1 answer
371 views

How to find specific Kubernetes resource and "terminate/finalize" it when namespace deletion is stuck?

Hi I tried to delete some namespaces and they are stuck in terminating... From the below details, I tried to delete the supposed rolebindings and roles, but they won't delete either and I don't know ...
0 votes
0 answers
297 views

Error running PostgreSQL Deployment in Kubernetes: "No such file or directory" for data directory

I am trying to deploy a PostgreSQL database using Kubernetes and encountered an error related to the data directory. Below is my YAML configuration for the Deployment: apiVersion: apps/v1 kind: ...
0 votes
1 answer
274 views

AKS Kubectl command doesn't return completed pods

I am using AKS with Kubernetes v1.25.6 and I have started to see a number of pods with a Completed status. From what I understand these are generated when an exit 0 code is returned on the process the ...
1 vote
1 answer
893 views

kubernetes kubectl Undo --insecure-skip-tls-verify to enable TLS Verification once again after it has been disabled

For testing purposes I have disabled tls verification for my cluster by typing: $ kubectl get nodes --insecure-skip-tls-verify This was done to temporarily fix a problem with an invalid certificate. ...
1 vote
1 answer
218 views

Create Rancher API Key with kubectl

Given access to the kubernetes cluster, but no API key, how can I programatically create a API key for rancher server? The method described in documentation here requires a password login an a web ...
0 votes
1 answer
224 views

Local Kubernetes Dns failure on one of three worker nodes

I have a problem with my Kubernetes on-premise cluster created with kubespray. I don't know why, but the dns resolutions is not working on one of my three nodes. I try to mount a debug container to ...
0 votes
2 answers
964 views

Unable to initialize Kubernetes cluster upon sudo kubeadm init line command

Trying to deploy Kubernetes on AWS EC2 instance. I'm seeing the following errors/warning when running sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=all Errors: [WARNING ...
0 votes
1 answer
668 views

Kubernetes component status reports etcd as unhealthy

I have a 3 node kube control network setup with etcd, kube-apiserver, kube-control-manager and kube-scheduler running. When I check the status of the components it says etcd is unhealthy, but etcd ...
0 votes
1 answer
297 views

Trying to install Kubernetes in RHEL 8.5 (CRI-O) - getting error

Trying to install Kubernetes in RHEL 8.5 (CRI-O) - getting error Error: Failed to download metadata for repo 'devel_kubic_libcontainers_stable: Downloading error(s): repodata/...
0 votes
0 answers
156 views

Frequent DiskPressure in Kubernetes Nodes

I'm currently facing an issue where one of my Kubernetes nodes keeps experiencing DiskPressure, leading to pod evictions and disruption of services. Despite our best efforts, we are struggling to ...
0 votes
0 answers
666 views

Kubernetes connection refuses often

I have configured Kubernetes using kubeadm in cent os stream 9. When I issue kubectl commands i am getting this error often The connection to the server xx.xxx.xx.xx:6443 was refused - did you ...
0 votes
1 answer
1k views

Forwarding apache logs from k8s Pod to Syslog server

I am new to Kubernetes, I know there are multiple ways to log collection. but I am specifically asking about my scenario. we have a Syslog xyz.com port 8090. now we want our pods to send logs to our ...
0 votes
0 answers
2k views

Kubelete fails with code=exited, status=1/FAILURE

I have setup K8S on fedora 37, following a Kubeadmi init seems images are pulled and things seemed correct. However, when I try Kubectl cluster-info 0406 11:58:52.440579 704658 memcache.go:265] ...
0 votes
0 answers
197 views

Multi cloud provider kubernetes cluster pod logs got timeout

Hi all i have master node in digital ocean and worker node in google cloud, nodes are connected using public ip of master node and pods are in running status but when i run kubectl logs i'm getting ...
0 votes
0 answers
559 views

k3s kubectl logs times out after 50 seconds

TLDR: Depending on my k3s version, kubectl logs -f drops back to the console (timeouts?) exactly after 50 seconds without new log entries, instead of remaining attached until a Ctrl-C is issued. I can'...
0 votes
1 answer
752 views

EKS cluster access - aws-auth : add groups in mapRoles

i try to access an EKS cluster on AWS with AWS Account (same i use for the console) steps i followed : aws configure with info provided in the "Command line or programmatic access" (AWS ...
0 votes
0 answers
903 views

Error While installing Calico CNI

I have a Kubernetes cluster with 1+1 configuration . I used the following steps to install Calico curl https://docs.projectcalico.org/manifests/calico-typha.yaml -o calico.yaml kubectl apply -f calico....
3 votes
4 answers
15k views

How to exec into a **node** (not container) via kubectl

How to exec into a K8s node? Up to now I only found ways to exec into containers running on a node. I would like to avoid ssh.
0 votes
1 answer
777 views

Kubernetes Ingress not properly routing traffic

I am trying to host a simple website using Kubernetes. I am trying to use a K8s deployment, service and an ingress to route the traffic from the external into the application running inside the pod. ...
1 vote
0 answers
310 views

Troubleshoot kubectl DNS Lookup REFUSED

This is happening on one engineers Macbook. Everyone else is able to run kubectl commands successfully. % kubectl --v=1000 get svc I0326 16:22:48.587540 28045 loader.go:379] Config loaded from file: ...
1 vote
1 answer
449 views

kubectl not getting all pods

I am using Google Cloud Platform, and I have two different kubernetes clusters running on GKE. Now these clusters are zonal clusters, and are running on different zones. the issue is when I am using ...
0 votes
0 answers
2k views

kube-apiserver.service failing after complete reinstall of kubernetes and kubectl plugins

I'm having an issue where kube-apiserver.service will always fail on my local Fedora 36. Getting the namespaces from a context I was experiencing certificate issues that prevented me from succeeding. ...
1 vote
1 answer
541 views

Ansible shell module fails to find kubectl

Running the command from the CLI on the server works perfect, but from playbook using Ansible shell module fails with: fatal: [localhost]: FAILED! => {"changed": true, "msg": &...
-1 votes
1 answer
839 views

Sonarqube app pod is not connecting with PostgreSQL DB pod when deploying to Kubernetes

I am trying to setup SonarQube in a Kubernetes cluster. The cluster was made using KubeADM in the AWS cloud. I have the following files for the setup. Sonarqube App Deployment file Sonarqube App ...
2 votes
1 answer
2k views

EKS Pods with ephemeral-storage constantly evicted

I'm working on EKS v1.20.11-eks-f17b81 and I'm facing an issue with a Java container Alpine based. Basically my deployment have the limits of ephemeral-storage for the request's and also the limit's ...
7 votes
2 answers
2k views

enable ephemeral containers AWS EKS

I'm trying to debug a distroless POD by trying kubectl debug which uses ephemeral containers that are disabled by default in aws eks. I'm using aws eks 1.21 ✗ kubectl debug -it opentelemetry-...
0 votes
1 answer
2k views

Fix the KubeletHasDiskPressure in Kubernetes on a very limited server

I have a question regarding our local Kubernetes installation (Kubelet version == 1.24.4). We're having a Kubernetes installation installed using Kubespray. I'm aware of a few related questions/...
1 vote
1 answer
317 views

How can I change the local port kubectl uses to establish a connection?

I want kubectl to use a different local port- not 22. Is this configurable? Is this something I have to configure in ssh? I want to create an ssh tunnel with IAP first and have kubeclt use that to ...
1 vote
1 answer
4k views

`kubectl` connection to the server was refused

I've been following Kelsey Hightower's Kubernetes the Hard Way which walks you through manually setting up a k8s cluster. This is not running on minikube - it's running on a remote VPS. I'm on the ...
1 vote
1 answer
1k views

How to create a container-disk image for VMs provisioned using KubeVirt

I am trying to create a VM setup in my Kubernetes cluster using KubeVirt. I have two EC2 instances(Master node: t2.xlarge and worker node: m5.metal) in AWS cloud and I have setup the cluster using ...
0 votes
1 answer
2k views

Cannot properly edit and save worker node specs in Kubernetes

I have a Kubernetes cluster setup using KubeAdm (Setup in EC2 instances in AWS Cloud). The CNI used is Flannel and the cluster is running quite well. My requirement is that I am trying to setup ...
0 votes
0 answers
459 views

Calico deployment not saving tolerance for master node

I was trying to setup a Kubernetes Cluster using Amazon EC2 and Kubeadm. I created a 't2.large' EC2 instance based on Ubuntu 18.04 AMI. Setup kubeadm, kubelet, kubectl and docker as the container ...
0 votes
1 answer
2k views

Calico Kubernetes Network Policy is denying all traffic and not working as expected

I am trying to implement some Calico based Kubernetes Network Policies. I have already setup Calico in my cluster and all the Calico based pods are running fine. In my cluster, There are two pods. 1. ...
1 vote
1 answer
1k views

Pods on two different nodes communicate very slow, any idea why?

I am learning k8s and I have 3 nodes k8s cluster. I have just recently deployed k8s with kubeadmin and so far it is working great. everything working perfectly but the only problem that I am facing is ...