Healthchecks for NGINX in nginx-http-dep.yaml and dev-setup/nginx-http.yaml (#1679)

This commit is contained in:
Krish 2017-07-17 18:59:11 +02:00 committed by GitHub
parent e0efc2286a
commit 4c8b0fc828
7 changed files with 31 additions and 26 deletions

View File

@ -133,11 +133,6 @@ Step 4.1: Vanilla NGINX
``cluster-frontend-port`` in the ConfigMap above. This is the
``public-cluster-port`` in the file which is the ingress in to the cluster.
* Set ``ports[1].port`` and ``ports[1].targetPort`` to the value set in the
``cluster-health-check-port`` in the ConfigMap above. This is the
``public-health-check-port`` in the file which is the health check port.
Note: This will be removed in the future.
* Start the Kubernetes Service:
.. code:: bash

View File

@ -16,6 +16,8 @@ data:
# cluster-health-check-port is the port number on which an external load
# balancer can check the status/liveness of the external/public server.
# In our deployment, Kubernetes sends 'livenessProbes' to this port and
# interprets a successful response as a 'healthy' service.
cluster-health-check-port: "8888"
# cluster-dns-server-ip is the IP of the DNS server. A Kubernetes deployment

View File

@ -18,10 +18,6 @@ spec:
targetPort: 80
name: ngx-public-bdb-port-http
protocol: TCP
- port: 8080
targetPort: 8080
name: public-health-check-port
protocol: TCP
- port: 27017
targetPort: 27017
name: ngx-public-mdb-port
@ -68,10 +64,18 @@ spec:
ports:
- containerPort: 27017
protocol: TCP
- containerPort: 8080
protocol: TCP
- containerPort: 80
protocol: TCP
- containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 15
failureThreshold: 3
timeoutSeconds: 10
resources:
limits:
cpu: 200m

View File

@ -1,7 +1,7 @@
# Frontend API server that:
# 1. Forwards BDB HTTP & WS requests to BDB backend.
# 2. Forwards MDB TCP connections to MDB backend.
# 3. Does health check with LB (optional).
# 3. Does health check with LB.
worker_processes 2;
daemon off;
@ -103,14 +103,14 @@ http {
}
}
# # Frontend server for the load balancer to respond to health checks.
# server {
# listen HEALTH_CHECK_PORT;
#
# location = /health {
# return 200;
# }
# }
# Frontend server for the load balancer to respond to health checks.
server {
listen HEALTH_CHECK_PORT;
location = /health {
return 200;
}
}
}
# NGINX stream block for TCP and UDP proxies. Used to proxy MDB TCP

View File

@ -65,8 +65,17 @@ spec:
protocol: TCP
- containerPort: "<cluster-health-check-port from ConfigMap>"
protocol: TCP
name: ngx-health
- containerPort: "<cluster-frontend-port from ConfigMap>"
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: ngx-health
initialDelaySeconds: 15
periodSeconds: 15
failureThreshold: 3
timeoutSeconds: 10
resources:
limits:
cpu: 200m

View File

@ -17,8 +17,4 @@ spec:
targetPort: "<cluster-frontend-port from ConfigMap>"
name: public-cluster-port
protocol: TCP
- port: "<cluster-health-check-port from ConfigMap>"
targetPort: "<cluster-health-check-port from ConfigMap>"
name: public-health-check-port
protocol: TCP
type: LoadBalancer

View File

@ -3,8 +3,7 @@
# 2. Forwards BDB HTTP requests to OpenResty backend.
# 3. Forwards BDB WS requests to BDB backend.
# 4. Forwards MDB TCP connections to MDB backend.
# 5. Forwards requests from 3scale to OpenResty backend.
# 6. Does health check with LB.
# 5. Does health check with LB.
worker_processes 2;
daemon off;