podname logs for log service

This commit is contained in:
Frostebite 2023-08-01 22:28:46 +01:00
parent 74b943e9a7
commit a275c2ec4a
3 changed files with 10 additions and 1 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -104,7 +104,16 @@ status: {}
// log service json
CloudRunnerLogger.log(`Service: ${JSON.stringify(service.body, undefined, 4)}`);
const logs = await CloudRunnerSystem.Run(`kubectl logs deployment/http-fileserver -f --timestamps`, false, true);
// get podname of deployment
const podname = await CloudRunnerSystem.Run(
`kubectl get pods -n ${namespace} -l service=http-fileserver -o jsonpath='{.items[0].metadata.name}'`,
false,
true,
);
const logs = await CloudRunnerSystem.Run(`kubectl logs ${podname} -f --timestamps`, false, true);
CloudRunnerLogger.log(`Logs: ${logs}`);
// get cluster ip