我正在阅读文档,不清楚如何更改LAST-SCHEDULE
日期列的格式。对我来说,返回以小时 (4h( 为单位的近似值:
kubectl get cronjob job-one
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
job-one 0 13 * * ? False 0 4h 20d
但是在文档中,格式不同,显示日期,时间和时区:
NAME SCHEDULE SUSPEND ACTIVE LAST-SCHEDULE
hello */1 * * * * False 0 Mon, 29 Aug 2016 14:34:00 -0700
如何更改LAST-SCHEDULE
的格式以返回有关上次计划日期的详细信息?
kubectl version
客户端的结果:
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"windows/amd64"}
我不确定他们如何显示确切的时间格式,但您可以为kubectl
输出创建自定义列:
$ kubectl get cronjob job-one -o custom-columns=NAME:.metadata.name,LAST-SCHEDULE:.status.lastScheduleTime
NAME LAST-SCHEDULE
job-one 2018-03-15T22:21:00Z