Kubectl show logs from the last pod
JS
S
JavaScriptScript to show the logs of last pod using a custodian container
1#! /usr/bin/env node
2const { execSync } = require("child_process");
3const packageName = require(process.cwd() + "/package.json").name;
4execSync(
5 `docker run --rm --net host \\
6 --entrypoint="/bin/zsh" \\
7 custodian/ctn:0.2-zsh \\
8 -c "kubectl logs service/${packageName}"`,
9 { stdio: "inherit" }
10);
11Created on 11/13/2019