pod的liveness和readiness关闭和开启(健康检查)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/liuskyter/article/details/89921596

K8S的应用程序健康检查分为livenessProbe和readinessProbe,两者相似,但两者存在着一些区别。

livenessProbe在服务运行过程中检查应用程序是否运行正常,不正常将杀掉进程;而readness Probe是用于检测应用程序启动完成后是否准备好对外提供服务,不正常继续检测,直到返回成功为止

deploytment主要管些啥啊?

可以理解成是pod的控制器,包括pod的缩扩容,副本数定义,健康检查,回滚。。。。

liveness是检查pod状态正常不正常的,如果pod没有running就会根据策略重启pod

readness是检查业务容器是不是正常的,如不正常就根据测试重启pod内的容器

 

 

 

展开阅读全文

Liveness Analysis

11-20

Problem DescriptionnA program syntax is defined as below: nPROGRAM ::= STATEMENTS end '\n'nSTATEMENTS ::= STATEMENT STATEMENTS | epsilonnSTATEMENT ::= a [variable] '\n' | u [variable] '\n' | IF-CLAUSEnIF-CLAUSE ::= if '\n' STATEMENTS end '\n' | if '\n' STATEMENTS else '\n' STATEMENTS end '\n'nnIn which '\n' means the new line character, epsilon means an empty string, [variable] means a variable, which is represented by a number between 1 and n (inclusive). Same numbers denote the same variable. nThe program runs as follows: nIf the statement is "a [variable]", it assigns the variable a new value; nIf the statement if "u [variable]", it uses value of the variable to do something interesting; nIf there is an IF-CLAUSE, it is possible that condition of this clause is satisfied or not satisfied. nnWe only need to do liveness analysis on this program. This is why we do not explicitly write assigned values, what we do with the variables and condition of IF-CLAUSEs. nIn this task, there are three kinds of liveness for each of the variables. n1. Live. In one or more paths of this program, value of the variable at the beginning of the program is used. n2. Dead. In all paths of this program, the variable is assigned a new value before any use of this variable. n3. Half-dead. In all paths of this program, value of the variable at the beginning of the program is not used, but in one or more paths, the variable is never assigned a new value.n nnInputnFirst line, number of test cases, T. nFollowing are T test cases. For each test case, the first line is n, number of variables in the program. The following lines is the program. nnNumber of lines in the input <= 500000n nnOutputnT lines. Each line contains n numbers. If the variable is live, output 1; if the variable is dead, output -1; if the variable is half-dead, output 0.n nnSample Inputn10n1nendn1na 1nendn1nu 1nendn1na 1nu 1nendn1nu 1na 1nendn1nifna 1nelsena 1nendnendn1nifna 1nelsenu 1nendnendn1nifna 1nendnendn1nifnu 1nendnendn2na 1nu 2nendn nnSample Outputn0n-1n1n-1n1n-1n1n0n1n-1 1 问答

没有更多推荐了,返回首页