/var/log/kube-apiserver.log
- API Server, responsible for serving the API/var/log/kube-scheduler.log
- Scheduler, responsible for making scheduling decisions/var/log/kube-controller-manager.log
- a component that runs most Kubernetes built-in controllers, with the notable exception of scheduling (the kube-scheduler handles scheduling).
/var/log/kubelet.log
- logs from the kubelet, responsible for running containers on the node/var/log/kube-proxy.log
- logs from kube-proxy, which is responsible for directing traffic to Service endpoints
Add the -v
option to your kubectl commands. Provides the equivalent curl
command used to query the API server.
$ kubectl get secrets -v6
Use the get --raw
mode to query the API using Kubectl.
$ kubectl get --raw '/api/v1/namespaces/default/secrets?labelSelector=name%3Dcert-manager%2Cowner%3Dhelm&limit=500'
Confirm the version of your kubectl client and k8s server API version.
$ kubectl version
Client Version: v1.28.8
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.8-gke.1067004
$ kubectl get --raw "/api/v1/nodes/node-1.example/proxy/logs/?query=kubelet"
Query parameter options:
Option | Description |
---|---|
boot |
boot show messages from a specific system boot |
pattern |
pattern filters log entries by the provided PERL-compatible regular expression |
query |
query specifies services(s) or files from which to return logs (required) |
sinceTime |
an RFC3339 timestamp from which to show logs (inclusive) |
untilTime |
an RFC3339 timestamp until which to show logs (inclusive) |
tailLines |
specify how many lines from the end of the log to retrieve; the default is to fetch the whole log |
Example of a more complex query:
$ kubectl get --raw "/api/v1/nodes/node-1.example/proxy/logs/?query=kubelet&pattern=error"
Add the -v
option to your helm commands. Provides the equivalent curl
command used to query the API server.
$ helm list -v6