const currentPage = dv.current().file;
const dailyPages = dv.pages('"0-Daily"').sort(k=>k.file.name, "asc");
const currentPageName = currentPage.name;
const index = dailyPages.findIndex((e) => {return e.file.name === currentPageName});
if (index < 1) {
dv.table(["File", "Created", "Size"],[]);
} else {
const lastIndex = index - 1;
const lastPage = dailyPages[lastIndex].file;
const allPages = dv.pages().values;
const searchPages = [];
const lastTime = dv.parse(lastPage.name);
const currentTime = dv.parse(currentPage.name);
for (let page of allPages) {
const pageFile = page.file;
if (pageFile.cday > lastTime && pageFile.cday <= currentTime) {
searchPages.push(pageFile);
}
}
dv.table(["File", "Created", "Size"], searchPages.sort((a, b) => a.ctime > b.ctime ? 1 : -1).map(b => [b.link, b.ctime, b.size]));
}
k8s 简单操作
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s.node0.fanruan Ready control-plane 471d v1.24.2
k8s.node1.fanruan Ready <none> 471d v1.24.2
k8s.node2.fanruan Ready <none> 471d v1.24.2
k8s.node3.fanruan Ready <none> 471d v1.24.2
kubectl describe node [name]
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age
--------- ---- ------------ ---------- --------------- ------------- ---
guozi bi6-0 500m (3%) 16 (100%) 0 (0%) 0 (0%) 134d
kubectl exec -it [name] -n [namespace]
kubectl exec -ti bi6-0 -n guozi -- /bin/sh
kubectl get pod -n [namespace]
NAME READY STATUS RESTARTS AGE
bi6-0 1/1 Running 0 17m
kubectl get pod [name] -n [namespace] -o yaml > pod.yaml
输出 yaml 到 pod 文件中
kubectl describe pod -n [namespace]
Mounts:
/usr/local/tomcat/webapps/webroot/WEB-INF/customLib from bi6-data (rw,path="customLib")
Volumes:
bi6-data:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: bi6-data-bi6-0
ReadOnly: false
kubectl get pv
NAME | CAPACITY | CLAIM | |
---|---|---|---|
pvc-e9d57330-f2b6-43c6-b24b-78cf69281fb0 | 1Gi | guozi/bi6-data-bi6-0 |
这里 name 就是挂载的的路径 /data/pvc-xxx