#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!
|
// pod.status.containerStatuses might be undefined!
|
||||||
const containerStatuses = this.pod.status.containerStatuses || []
|
const containerStatuses = this.pod.status.containerStatuses || []
|
||||||
var ready = 0
|
var ready = 0
|
||||||
|
var running = 0
|
||||||
for (const containerStatus of containerStatuses) {
|
for (const containerStatus of containerStatuses) {
|
||||||
if (containerStatus.ready) {
|
if (containerStatus.ready) {
|
||||||
ready++
|
ready++
|
||||||
}
|
}
|
||||||
|
if (containerStatus.state.running) {
|
||||||
|
running++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const allReady = ready >= containerStatuses.length
|
const allReady = ready >= containerStatuses.length
|
||||||
|
const allRunning = running >= containerStatuses.length
|
||||||
|
|
||||||
const podBox = this
|
const podBox = this
|
||||||
podBox.interactive = true
|
podBox.interactive = true
|
||||||
@@ -62,6 +67,13 @@ export default class Pod extends PIXI.Graphics {
|
|||||||
podBox.lineStyle(2, 0xaaaaff, 1);
|
podBox.lineStyle(2, 0xaaaaff, 1);
|
||||||
} else if (this.pod.status.phase == 'Running' && allReady) {
|
} else if (this.pod.status.phase == 'Running' && allReady) {
|
||||||
podBox.lineStyle(2, 0xaaffaa, 1);
|
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') {
|
} else if (this.pod.status.phase == 'Pending') {
|
||||||
PIXI.ticker.shared.add(function(_) {
|
PIXI.ticker.shared.add(function(_) {
|
||||||
var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI)
|
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);
|
podBox.lineStyle(2, 0xffffaa, 1);
|
||||||
} else {
|
} else {
|
||||||
|
// CrashLoopBackOff, ImagePullBackOff or other unknown state
|
||||||
|
|
||||||
PIXI.ticker.shared.add(function(_) {
|
PIXI.ticker.shared.add(function(_) {
|
||||||
var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI)
|
var v = Math.sin((PIXI.ticker.shared.lastTime % 1000)/1000.* Math.PI)
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
|
|||||||
Reference in New Issue
Block a user