【发布时间】:2019-04-03 16:07:59
【问题描述】:
我的配置是Kubernetes on 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 to use
path: /settings # endpoint to hit
scheme: HTTP # or HTTPS
initialDelaySeconds: 3 # how long to wait before checking
periodSeconds: 5 # how long to wait between checks
successThreshold: 1 # how many successes to hit before accepting
failureThreshold: 2 # how many failures to accept before failing
timeoutSeconds: 10 # how long to wait for a response
ports:
- name: backend
containerPort: 80
关于如何解决这个问题的任何提示。
【问题讨论】:
标签: kubernetes google-compute-engine google-kubernetes-engine kubernetes-health-check