在Kubernetes/Docker生态系统中,有一种使用/healthz作为应用程序的健康检查端点的约定.
'healthz'这个名字来自哪里,是否有与该名称相关的特定语义?
有状态集 es-data 在我们的测试环境中失败,我被要求删除相应的 PV。
因此,我删除了 es-data 的以下内容:1) PVC 2) PV 它们显示为终止并留到周末。今天早上到达时,他们仍然显示为终止,因此强行删除了PVC和PV。没有喜悦。为了解决整个问题,我不得不删除有状态集。
如果您想删除 PV,这是否正确?
在Dockerfile中指定HEALTHCHECK的新功能对于Kubernetes探测指令来说似乎是多余的.什么时候使用什么建议?
我正在尝试在GCE中的Kubernetes(服务器1.6.4)中部署grafana实例.我使用以下清单:
部署(完整版):
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: grafana
spec:
replicas: 1
template:
metadata:
labels:
name: grafana
spec:
initContainers:
…
containers:
- name: grafana
image: grafana/grafana
readinessProbe:
httpGet:
path: /login
port: 3000
…
Run Code Online (Sandbox Code Playgroud)
服务:
apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
selector:
name: grafana
ports:
- protocol: TCP
port: 3000
type: NodePort
Run Code Online (Sandbox Code Playgroud)
Ingress:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: grafana
spec:
tls:
- secretName: grafana.example.com
backend:
serviceName: grafana
servicePort: 3000
Run Code Online (Sandbox Code Playgroud)
事实证明,grafana服务于302,/但默认的GCE入口健康检查预计200 / …
可以使用此初始延迟来配置Kubernetes的pods(部署)的活跃度和准备状态 - 意味着在容器启动后的许多发送之后,prob将开始.如果未指定,默认值是多少?我似乎找不到它.periodSeconds的默认值记录为10秒.
谢谢
我想用一个值为secret的httpHeader定义一个livenessProbe.
此语法无效:
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: X-Custom-Header
valueFrom:
secretKeyRef:
name: my-secret-key
value: secret
Run Code Online (Sandbox Code Playgroud)
如果我将my-secret-keyvalue 指定secret为名为的环境变量MY_SECRET_KEY,则以下内容可以起作用:
livenessProbe:
exec:
command:
- curl
- --fail
- -H
- "X-Custom-Header: $MY_SECRET_KEY"
- 'http://localhost:8080/healthz'
Run Code Online (Sandbox Code Playgroud)
不幸的是,它不是由于评估报价的方式.如果我curl --fail -H "X-Custom-Header: $MY_SECRET_KEY" http://localhost:8080/healthz直接在容器上键入命令,它就可以工作.
我也试过很多单引号组合并转义双引号.
有没有人知道一个解决方法?
我有两个我控制的API A和B,都有准备和生活健康检查.A依赖于B.
A
/foo - This endpoint makes a call to /bar in B
/status/live
/status/ready
B
/bar
/status/live
/status/ready
Run Code Online (Sandbox Code Playgroud)
A的准备情况运行状况检查是否应该因为依赖性而调用API B的就绪状况检查?
url api-design health-monitoring kubernetes kubernetes-health-check
docker文档说明了什么HEALTHCHECK是指令以及如何检查容器的运行状况。但我无法弄清楚健康检查失败时会发生什么。就像按照用户指令重新启动或停止容器或这两者中的任何一个一样。
另外引用的例子是:
HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost/ || exit 1
是exit 1关于什么的?
我的配置是 Kubernetes 上的 Jenkins,项目是用 PHP 编写的。
这里的问题是 pod 连接到入口(而不是使用 GCE 的 loadBalancer),并且当 pod 不健康时,它不会添加它。
我第一次从 0 加载项目时,它在我更新后工作,但由于它不健康而失败。
当我描述 pod 时,我收到以下警告:
就绪探测失败:获取http://10.32.1.71:80/setting s: net/http: 请求已取消(等待标头时超出 Client.Timeout)
我的生产配置:
# Configuration for the SQL connection
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: wobbl-main-backend-production
spec:
replicas: 1
template:
metadata:
name: backend
labels:
app: wobbl-main
role: backend
env: production
spec:
containers:
- name: backend
image: gcr.io/cloud-solutions-images/wobbl-mobile-backend:1.0.0
resources:
limits:
memory: "500Mi"
cpu: "100m"
imagePullPolicy: Always
readinessProbe:
httpGet: # make an HTTP request
port: 80 # port …Run Code Online (Sandbox Code Playgroud) google-compute-engine kubernetes google-kubernetes-engine kubernetes-health-check
在 Kubernetes 中Kubernetes Health Check Probes,如果timeoutSeconds超过会发生什么periodSeconds?例如:
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
Run Code Online (Sandbox Code Playgroud)
Pod 什么时候会“失败”?
initialDelaySeconds+ ( periodSeconds* failureThreshold); 或者initialDelaySeconds+ ( MAX( periodSeconds, timeoutSeconds) * failureThreshold);当 Pod 成功时,同样的问题也适用。
kubernetes kubernetes-health-check readinessprobe livenessprobe