#2 pods with non-ready containers are flashing green
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -22,6 +22,12 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8080
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
|
||||
Reference in New Issue
Block a user