how to output the detail of kubectl logs

9/6/2019

I am using this command to deploy kubernetes dashboard:

 wget -c https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
  kubectl create -f kubernetes-dashboard.yaml

and the result is:

[root@iZuf63refzweg1d9dh94t8Z ~]# kubectl -n kube-system get svc kubernetes-dashboard
NAME                   TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
kubernetes-dashboard   ClusterIP   10.254.19.89   <none>        443/TCP   15s

check the pod:

[root@iZuf63refzweg1d9dh94t8Z ~]# kubectl get pod --namespace=kube-system
No resources found.

is there any possible to output the logs of kubectl create, so I can know the kubernetes dashboard create status,where is going wrong.how to fix it.Now I am hardly know where is going wrong and what should I do to fix the problem.

[root@iZuf63refzweg1d9dh94t8Z ~]# kubectl get all -n kube-system


NAME                           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
service/kube-dns               ClusterIP   10.43.0.10     <none>        53/UDP,53/TCP   102d
service/kubernetes-dashboard   ClusterIP   10.254.19.89   <none>        443/TCP         22h
service/metrics-server         ClusterIP   10.43.96.112   <none>        443/TCP         102d


NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/kubernetes-dashboard   0/1     0            0           22h

NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/kubernetes-dashboard-7d75c474bb   1         1         0       9d
-- Dolphin
kubernetes

3 Answers

9/6/2019

if you want to quickly find something you can do kubectl get pods --all-namespaces | grep dashboard

-- Raja
Source: StackOverflow

9/9/2019

Make sure you follow all steps from here: kubernetes-dashboard-doc.

Try to follow all steps, delete previous deployment (I see that you don't use command

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recommended.yaml

which is in official documentation - this may cause the problem), but firstly to see systems logs simply execute:

$ journalctl

Perhaps the most useful way of filtering is by the unit you are interested in. We can use the -u option to filter in this way.

For instance, to see all of the logs from an Nginx unit on our system, we can type:

$ journalctl -u nginx.service

or some services spawn a variety of child processes to do work. If you have scouted out the exact PID of the process you are interested in, you can filter by that as well.

For instance if the PID we’re interested in is 8088, we could type:

$ journalctl _PID=8088

More information you can find here: journalctl.

Useful documentation: kubernetes-dashboard.

Take notice that your kubernetes-dashboard service doesn't have external_ip associated to.

Describe deployment to see what happend there simply executing command:

$ kubectl describe deployment  deployment.apps/kubernetes-dashboard  -n kube-system
-- MaggieO
Source: StackOverflow

9/6/2019

Take a look at the file you downloaded. It defines several objects including a Deployment kind. Let's assume that you know that this is the one that does the creating, then you can do:

kubectl describe deployment kubernetes-dashboard -n kube-system

This will give you a list of events that will give more information about what is happening. A Deployment is responsible for creating Pods.

-- Jamie
Source: StackOverflow