mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Healthchecks for NGINX in nginx-http-dep.yaml and dev-setup/nginx-http.yaml (#1679)
This commit is contained in:
parent
e0efc2286a
commit
4c8b0fc828
@ -133,11 +133,6 @@ Step 4.1: Vanilla NGINX
|
|||||||
``cluster-frontend-port`` in the ConfigMap above. This is the
|
``cluster-frontend-port`` in the ConfigMap above. This is the
|
||||||
``public-cluster-port`` in the file which is the ingress in to the cluster.
|
``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:
|
* Start the Kubernetes Service:
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
@ -16,6 +16,8 @@ data:
|
|||||||
|
|
||||||
# cluster-health-check-port is the port number on which an external load
|
# cluster-health-check-port is the port number on which an external load
|
||||||
# balancer can check the status/liveness of the external/public server.
|
# 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-health-check-port: "8888"
|
||||||
|
|
||||||
# cluster-dns-server-ip is the IP of the DNS server. A Kubernetes deployment
|
# cluster-dns-server-ip is the IP of the DNS server. A Kubernetes deployment
|
||||||
|
@ -18,10 +18,6 @@ spec:
|
|||||||
targetPort: 80
|
targetPort: 80
|
||||||
name: ngx-public-bdb-port-http
|
name: ngx-public-bdb-port-http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- port: 8080
|
|
||||||
targetPort: 8080
|
|
||||||
name: public-health-check-port
|
|
||||||
protocol: TCP
|
|
||||||
- port: 27017
|
- port: 27017
|
||||||
targetPort: 27017
|
targetPort: 27017
|
||||||
name: ngx-public-mdb-port
|
name: ngx-public-mdb-port
|
||||||
@ -68,10 +64,18 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 27017
|
- containerPort: 27017
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- containerPort: 8080
|
|
||||||
protocol: TCP
|
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
- containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 15
|
||||||
|
failureThreshold: 3
|
||||||
|
timeoutSeconds: 10
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Frontend API server that:
|
# Frontend API server that:
|
||||||
# 1. Forwards BDB HTTP & WS requests to BDB backend.
|
# 1. Forwards BDB HTTP & WS requests to BDB backend.
|
||||||
# 2. Forwards MDB TCP connections to MDB 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;
|
worker_processes 2;
|
||||||
daemon off;
|
daemon off;
|
||||||
@ -103,14 +103,14 @@ http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# # Frontend server for the load balancer to respond to health checks.
|
# Frontend server for the load balancer to respond to health checks.
|
||||||
# server {
|
server {
|
||||||
# listen HEALTH_CHECK_PORT;
|
listen HEALTH_CHECK_PORT;
|
||||||
#
|
|
||||||
# location = /health {
|
location = /health {
|
||||||
# return 200;
|
return 200;
|
||||||
# }
|
}
|
||||||
# }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# NGINX stream block for TCP and UDP proxies. Used to proxy MDB TCP
|
# NGINX stream block for TCP and UDP proxies. Used to proxy MDB TCP
|
||||||
|
@ -65,8 +65,17 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
- containerPort: "<cluster-health-check-port from ConfigMap>"
|
- containerPort: "<cluster-health-check-port from ConfigMap>"
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
name: ngx-health
|
||||||
- containerPort: "<cluster-frontend-port from ConfigMap>"
|
- containerPort: "<cluster-frontend-port from ConfigMap>"
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: ngx-health
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 15
|
||||||
|
failureThreshold: 3
|
||||||
|
timeoutSeconds: 10
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
|
@ -17,8 +17,4 @@ spec:
|
|||||||
targetPort: "<cluster-frontend-port from ConfigMap>"
|
targetPort: "<cluster-frontend-port from ConfigMap>"
|
||||||
name: public-cluster-port
|
name: public-cluster-port
|
||||||
protocol: TCP
|
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
|
type: LoadBalancer
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
# 2. Forwards BDB HTTP requests to OpenResty backend.
|
# 2. Forwards BDB HTTP requests to OpenResty backend.
|
||||||
# 3. Forwards BDB WS requests to BDB backend.
|
# 3. Forwards BDB WS requests to BDB backend.
|
||||||
# 4. Forwards MDB TCP connections to MDB backend.
|
# 4. Forwards MDB TCP connections to MDB backend.
|
||||||
# 5. Forwards requests from 3scale to OpenResty backend.
|
# 5. Does health check with LB.
|
||||||
# 6. Does health check with LB.
|
|
||||||
|
|
||||||
worker_processes 2;
|
worker_processes 2;
|
||||||
daemon off;
|
daemon off;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user