4.4.1 查看资源注解
“kubectl get -o yaml” 和 “kubectl describe” 命令均能显示资源的注解信息。例如下面的命令显示的 pod-example 的注解信息:
**[terminal]
**[delimiter $ ]**[command kubectl describe pods pod-example]
Name: pod-example
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: kube-node-1.localdomain/192.168.0.134
Start Time: Sun, 01 Dec 2019 21:34:46 +0800
Labels: env=production
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"pod-example","namespace":"default"},"spec":{"containers":[{"image":"i...
Status: Running
IP: 10.244.2.6
... 省略 ...
pod-example 此前由声明式配置命令 apply 创建,因此它在注解中保存了如上的相关信息以便在下次资源变动时进行版本对比。