diff --git a/app/src/pod.js b/app/src/pod.js index 7448c49..622d108 100644 --- a/app/src/pod.js +++ b/app/src/pod.js @@ -11,12 +11,17 @@ export default class Pod extends PIXI.Graphics { // pod.status.containerStatuses might be undefined! const containerStatuses = this.pod.status.containerStatuses || [] var ready = 0 + var running = 0 for (const containerStatus of containerStatuses) { if (containerStatus.ready) { ready++ } + if (containerStatus.state.running) { + running++ + } } const allReady = ready >= containerStatuses.length + const allRunning = running >= containerStatuses.length const podBox = this podBox.interactive = true @@ -62,6 +67,13 @@ export default class Pod extends PIXI.Graphics { podBox.lineStyle(2, 0xaaaaff, 1); } else if (this.pod.status.phase == 'Running' && allReady) { podBox.lineStyle(2, 0xaaffaa, 1); + } else if (this.pod.status.phase == 'Running' && allRunning && !allReady) { + // all containers running, but some not ready (readinessProbe) + PIXI.ticker.shared.add(function(_) { + var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI) + podBox.alpha = v + }) + podBox.lineStyle(2, 0xaaffaa, 1); } else if (this.pod.status.phase == 'Pending') { PIXI.ticker.shared.add(function(_) { var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI) @@ -69,6 +81,7 @@ export default class Pod extends PIXI.Graphics { }) podBox.lineStyle(2, 0xffffaa, 1); } else { + // CrashLoopBackOff, ImagePullBackOff or other unknown state PIXI.ticker.shared.add(function(_) { var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI) diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index e253496..ddd55b3 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -22,6 +22,12 @@ spec: ports: - containerPort: 8080 protocol: TCP + readinessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 1 resources: limits: cpu: 200m