Kubectl 日志输出详细程度是通过 -v 或者 –v 来控制的,参数后跟一个数字表示日志的级别。
详细程度 | 描述 |
---|---|
–v=0 | 用于那些应该 始终 对运维人员可见的信息,因为这些信息一般很有用。 |
–v=1 | 如果您不想要看到冗余信息,此值是一个合理的默认日志级别。 |
–v=2 | 输出有关服务的稳定状态的信息以及重要的日志消息,这些信息可能与系统中的重大变化有关。这是建议大多数系统设置的默认日志级别。 |
–v=3 | 包含有关系统状态变化的扩展信息。 |
–v=4 | 包含调试级别的冗余信息。 |
–v=5 | 跟踪级别的详细程度。 |
–v=6 | 显示所请求的资源。 |
–v=7 | 显示 HTTP 请求头。 |
–v=8 | 显示 HTTP 请求内容。 |
–v=9 | 显示 HTTP 请求内容而且不截断内容。 |
[wjh@node1 mubot]$ kl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
pv-mlcmlc1-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc1-disk-os mlc-sc-default 13d
pv-mlcmlc2-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc2-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=0
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=1
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=2
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=3
I0207 11:13:05.654097 2988619 cert_rotation.go:137] Starting client certificate rotation controller
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=4
I0207 11:13:08.921181 2988679 cert_rotation.go:137] Starting client certificate rotation controller
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=5
I0207 11:13:10.583781 2988715 cert_rotation.go:137] Starting client certificate rotation controller
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=6
I0207 11:13:13.567074 2988796 loader.go:372] Config loaded from file: /home/wjh/.kube/config
I0207 11:13:13.567952 2988796 cert_rotation.go:137] Starting client certificate rotation controller
I0207 11:13:13.582034 2988796 round_trippers.go:454] GET https://192.168.8.73:8443/api/v1/persistentvolumes/pv-mlcmlc0-disk-os 200 OK in 8 milliseconds
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=7
I0207 11:13:16.064279 2988832 loader.go:372] Config loaded from file: /home/wjh/.kube/config
I0207 11:13:16.065167 2988832 cert_rotation.go:137] Starting client certificate rotation controller
I0207 11:13:16.072871 2988832 round_trippers.go:432] GET https://192.168.8.73:8443/api/v1/persistentvolumes/pv-mlcmlc0-disk-os
I0207 11:13:16.072890 2988832 round_trippers.go:438] Request Headers:
I0207 11:13:16.072900 2988832 round_trippers.go:442] User-Agent: kubectl/v1.22.3 (linux/amd64) kubernetes/c920368
I0207 11:13:16.072908 2988832 round_trippers.go:442] Accept: application/json;as=Table;v=v1;g=meta.k8s.io,application/json;as=Table;v=v1beta1;g=meta.k8s.io,application/json
I0207 11:13:16.081558 2988832 round_trippers.go:457] Response Status: 200 OK in 8 milliseconds
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
[wjh@node1 mubot]$ kl get pv pv-mlcmlc0-disk-os -v=8
I0207 11:13:19.271981 2988890 loader.go:372] Config loaded from file: /home/wjh/.kube/config
I0207 11:13:19.272755 2988890 cert_rotation.go:137] Starting client certificate rotation controller
I0207 11:13:19.278741 2988890 round_trippers.go:432] GET https://192.168.8.73:8443/api/v1/persistentvolumes/pv-mlcmlc0-disk-os
I0207 11:13:19.278756 2988890 round_trippers.go:438] Request Headers:
I0207 11:13:19.278764 2988890 round_trippers.go:442] User-Agent: kubectl/v1.22.3 (linux/amd64) kubernetes/c920368
I0207 11:13:19.278770 2988890 round_trippers.go:442] Accept: application/json;as=Table;v=v1;g=meta.k8s.io,application/json;as=Table;v=v1beta1;g=meta.k8s.io,application/json
I0207 11:13:19.288222 2988890 round_trippers.go:457] Response Status: 200 OK in 9 milliseconds
I0207 11:13:19.288236 2988890 round_trippers.go:460] Response Headers:
I0207 11:13:19.288243 2988890 round_trippers.go:463] X-Kubernetes-Pf-Prioritylevel-Uid: 7cb89556-0a3c-47d0-8867-20cb168287e7
I0207 11:13:19.288249 2988890 round_trippers.go:463] Date: Mon, 07 Feb 2022 03:13:19 GMT
I0207 11:13:19.288255 2988890 round_trippers.go:463] Audit-Id: 0aca18d5-d4ad-4ee1-9462-2a88ea20cb4a
I0207 11:13:19.288260 2988890 round_trippers.go:463] Cache-Control: no-cache, private
I0207 11:13:19.288266 2988890 round_trippers.go:463] Content-Type: application/json
I0207 11:13:19.288271 2988890 round_trippers.go:463] X-Kubernetes-Pf-Flowschema-Uid: c95abbb8-e0e3-40ba-bc5a-b4026481be34
I0207 11:13:19.288339 2988890 request.go:1181] Response Body: {"kind":"Table","apiVersion":"meta.k8s.io/v1","metadata":{"resourceVersion":"5830685"},"columnDefinitions":[{"name":"Name","type":"string","format":"name","description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names","priority":0},{"name":"Capacity","type":"string","format":"","description":"A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity","priority":0},{"name":"Access Modes","type":"string","format":"","description":"AccessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes","priority":0},{"name":"Reclaim Policy","type":"strin [truncated 3459 chars]
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-mlcmlc0-disk-os 10Gi RWO Delete Bound default/dv-mlcmlc0-disk-os mlc-sc-default 13d
Leave a Reply