podname logs for log service

This commit is contained in:
Frostebite 2023-08-11 17:29:19 +01:00
parent 1314055a63
commit 2cb1914301
3 changed files with 5 additions and 48 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -21,32 +21,10 @@ class KubernetesLogService {
}
static async createLogDeployment(namespace: string, kubeClient: k8s.AppsV1Api, kubeClientCore: CoreV1Api) {
// json
/*
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
service: http-fileserver
name: http-fileserver
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
service: http-fileserver
spec:
containers:
- image: pgaertig/nginx-big-upload:latest
imagePullPolicy: Always
name: http-fileserver
resources: {}
restartPolicy: Always
status: {}
*/
if (!process.env.LOG_SERVICE_IP) {
return `0.0.0.0`;
}
// create a deployment with above json
const deployment = new k8s.V1Deployment();
deployment.apiVersion = 'apps/v1';
@ -126,7 +104,7 @@ status: {}
continue;
}
const logs = await CloudRunnerSystem.Run(`kubectl logs ${podname} -f --timestamps`, false, true);
const logs = await CloudRunnerSystem.Run(`kubectl logs ${podname} -f --timestamps -p`, false, true);
CloudRunnerLogger.log(`Logs: ${logs}`);
// get cluster ip
@ -143,27 +121,6 @@ status: {}
// create kubernetes service to expose deployment
static async createLogServiceExpose(namespace: string, kubeClient: CoreV1Api) {
// json
/*
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
service: http-fileserver
name: http-fileserver
spec:
ports:
- name: 80-80
port: 80
protocol: TCP
targetPort: 80
selector:
service: http-fileserver
type: LoadBalancer
status:
loadBalancer: {}
*/
// create a service with above json
const service = new k8s.V1Service();
service.apiVersion = 'v1';