Possible Pod Phases
Pod Phase
- Running
- Succeeded (Job completion, CronJob completion)
- Failed (Program crash, container startup failure)
- Pending (Resource shortage, NodeSelector no match, slow image pull)
- Unknown (kubelet cannot report status, node offline, network interruption)
Creation/Deployment Related
- ContainerCreating (Container is being created, pulling image)
- PodInitializing (Container is initializing, executing init container)
- ImagePullBackOff (Image pull failed, e.g., authentication issue, image does not exist)
- ErrImagePull (Same as above, occurs earlier than BackOff)
Abnormalities During Runtime
- CrashLoopBackOff (After the container crashes, kubelet will restart the container based on the backoff strategy, default is 10s later)
- OOMKilled (Container memory exceeds the limit and is forcibly killed by kubelet)
- BackOff (After multiple failures, enter the backoff state, such as init container failure)
- CrashLoopBackOff (Main container keeps crashing and restarting)
- CreateContainerConfigError (Container creation configuration error, such as a non-existent mounted volume)
- Error (Container exits with a non-zero exit code, but may not trigger failure due to restart policy)
Termination/Completion
- Terminating (Container is terminating, such as deleting pod)
- Completed (Container exits normally, such as the main container exits)
- Failed (Container exits with a non-zero exit code and the restart policy is Never)
Alert Architecture
Due to the involvement of the company’s alert system, it cannot be directly displayed.
Difference Between Counter and Gauge? What Scenarios to Use Counter
Counter
- Only increments
- Resets to zero after process restart
- qps, error, data processing volume (per item/package/byte), retry count
Gauge
- Can increment or decrement
- Inventory values of Redis/Kafka/queue, cpu/memory, online number of people
Difference Between 502 and 504
- 502 Gateway Error, usually the backend service returns an invalid response (such as returning HTML instead of JSON)
- 504 Gateway Timeout, usually the backend service response time exceeds the gateway timeout time
IP Address Range of 192.168.1.0/25
There are 2^7 - 2 = 126 IP addresses in total 000 0000 192.168.1.1~192.168.1.126
192.168.1.127 is a broadcast address 192.168.1.128 is the subnet mask
How to Allow Port 80 on a Single Machine and Deny All Other Ports
iptables
| |
Using Decorators in Python to Count Function Execution Time
| |
