Why is pod not found? Error from server (NotFound): pods "curl-pod" not found - kubernetes

I can list pods in my prod namespace
kubectl get pods -n prod
NAME READY STATUS RESTARTS AGE
curl-pod 1/1 Running 1 (32m ago) 38m
web 1/1 Running 1 (33m ago) 38m
I got error
kubectl describe pods curl-pod
Error from server (NotFound): pods "curl-pod" not found
Get events show
Normal Scheduled pod/curl-pod Successfully assigned prod/curl-pod to minikube
Why?

kubernetes manages by namespace, so you must specify namespace otherwise kubernetes will use namespace default.
So, you must type:
kubectl describe pod/curl-pod -n prod

Related

How to get information related to etcd in my local kubernetes cluster created using Rancher Desktop

So my question is pretty straightforward, how to get information related to etcd in the kubernetes cluster I created using rancher desktop. I get the following 3 pods when I start the cluster.
❯ kubectl cluster-info
Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/https:metrics-server:https/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
❯ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-d76bd69b-6n2tn 1/1 Running 24 (38m ago) 35d
kube-system local-path-provisioner-6c79684f77-g44x4 1/1 Running 24 (38m ago) 35d
kube-system metrics-server-7cd5fcb6b7-fl7ws 1/1 Running 24 (38m ago) 35d
I want to see the storage consumption of the etcd. Any help is much appreciated since I couldn't find anything related to this so far.

Getting pod logs (Kubernetes for failed pod)

when I get all the pods kubectl get pod
and I get:
NAME READY STATUS RESTARTS AGE
balanced-7bbf659597-sk478 1/1 Running 0 5d13h
hello-minikube-68ff6fd96-xxbx8 1/1 Running 0 5d13h
mongo-express-5bf4b56f47-5s2b6 1/1 Running 8 (13h ago) 14h
mongodb-deployment-844789cd64-fjlgk 0/1 CrashLoopBackOff 101 (4m30s ago) 13h
but then when I try to get the logs of the failed pod kubectl logs mongodb-deployment-844789cd64-fjlgk nothing happens, and then when I describe the pod: kubectl describe mongodb-deployment-844789cd64-fjlgk I get this error:
error: the server doesn't have a resource type "mongodb-deployment-844789cd64-fjlgk"
Your pod isn't available when you try see the log, you must access to the previous log file using the following command
kubectl logs mongodb-deployment-844789cd64-fjlgk --previous
Using previous parameter kubectl will dump logs for a previous instantiation of your container

After Installing Artifactory with Helm, pods having issues

doing some projects to learn kubernetes
I have an EKS (aws) Cluster, using helm to install Artifactory. Installation goes well I go to access Artifactory through Load Balancer URL and its not working. I check the pods and..
$ kubectl get pods -n tools
NAME READY STATUS RESTARTS AGE
artifactory-0 0/1 Init:3/5 0 90m
artifactory-artifactory-nginx-7c4dcfdbbc-xn4wk 0/1 Running 11 (98s ago) 89m
artifactory-postgresql-0 1/1 Running 0 3h32m
jenkins-0 2/2 Running 0 3h34m
Tried to troubleshoot it
$ kubectl logs artifactory-0 -n tools
Defaulted container "artifactory" out of: artifactory, delete-db-properties (init), remove-lost-found (init), copy-system-yaml (init), wait-for-db (init), migration-artifactory (init)
Error from server (BadRequest): container "artifactory" in pod "artifactory-0" is waiting to start: PodInitializing
$ kubectl logs artifactory-artifactory-nginx-7c4dcfdbbc-xn4wk -n tools
Defaulted container "nginx" out of: nginx, setup (init)
Used kubectl describe on artifactory-artifactory-nginx-7c4dcfdbbc-xn4wk
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning Unhealthy 110s (x1235 over 111m) kubelet Startup probe failed:
artifactory-0 had no events

how to fix coredns service not found after initializing pod network

I started with Kubernetes tutorial and after intializeing the pod network
kubectl apply -f https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
I discovered that coredns is pending but rest of the services were running.
# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-74ff55c5b-gzn5l 0/1 Pending 0 19m
kube-system coredns-74ff55c5b-k2h5m 0/1 Pending 0 19m
the I tried to look at the logs:
# kubectl logs coredns-74ff55c5b-gzn5l
Error from server (NotFound): pods "coredns-74ff55c5b-gzn5l" not found
# kubectl logs coredns-74ff55c5b-k2h5m
Error from server (NotFound): pods "coredns-74ff55c5b-k2h5m" not found

How to get the endpoint for kubernetes-dashboard

I have installed kubernetes using minikube on ubuntu 16.04 machine.
I have also installed kubernetes-dashboard.
When i try accessing the dashboard i get
Waiting, endpoint for service is not registered yet
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
.....
Could not find finalized endpoint being pointed to by kubernetes-dashboard: Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
`
However, when i try a kubectl get pods --all namespacesi get the below output
kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-addon-manager-minikube 1/1 Running 0 11m
kube-system kube-dns-1301475494-xtb3b 3/3 Running 0 8m
kube-system kubernetes-dashboard-2039414953-dvv3m 1/1 Running 0 9m
kube-system kubernetes-dashboard-2crsk 1/1 Running 0 8m
kubectl get endpoints --all-namespaces
NAMESPACE NAME ENDPOINTS AGE
default kubernetes 10.0.2.15:8443 11m
kube-system kube-controller-manager <none> 6m
kube-system kube-dns 172.17.0.4:53,172.17.0.4:53 8m
kube-system kube-scheduler <none> 6m
kube-system kubernetes-dashboard <none> 9m
How can i fix this issue? I don't seem to understand what is wrong. I am completely new to kubernetes
You need to run minikube dashboard. You shouldn't install dashboard separately; it comes with minikube.
some of the minikube commands
./minikube.exe version
./minikube.exe delete
./minikube.exe start --help
./minikube get-k8s-versions
./minikube.exe status
./minikube.exe ip
./minikube.exe dashboard --url=true