bigchaindb/k8s/dev-setup/nginx-http.yaml
Krish b7e13fd087 Secure WebSocket Support (#1619)
* Remove support for whitelist

* Rename nginx to nginx-api

* Remove websocket support from nginx-api

* Change nginx to nginx-api service
The nginx-api service will proxy requests to the BigchainDB HTTP API.

* Rename ngx-instance-0 to ngx-api-instance-0 in nginx_3scale

* Update nginx-api service base docker image and README

* Add nginx-ws service to support Websocket

* Add config files for simple dev setup

* WS support with split NGINX

* NGINX module as single entrypoint into the cluster.

* Tested HTTP and WS with latest configs

* Openresty as separate service

* Remove upstream api port as configuration parameter

* Changes while testing

* Adding READMEs for nginx-http and nginx-https modules

* Documentation update

* Change 'Openresty' to 'OpenResty'.
2017-07-17 13:46:05 +02:00

80 lines
1.9 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: ngx-http
namespace: default
labels:
name: ngx-http
annotations:
# NOTE: the following annotation is a beta feature and
# only available in GCE/GKE and Azure as of now
# Ref: https://kubernetes.io/docs/tutorials/services/source-ip/
service.beta.kubernetes.io/external-traffic: OnlyLocal
spec:
selector:
app: ngx-http-dep
ports:
- port: 80
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
protocol: TCP
type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ngx-http-dep
namespace: default
spec:
replicas: 1
template:
metadata:
name: ngx-http-dep
labels:
app: ngx-http-dep
spec:
terminationGracePeriodSeconds: 10
containers:
- name: nginx-http
image: bigchaindb/nginx_http:1.0
imagePullPolicy: Always
env:
- name: CLUSTER_FRONTEND_PORT
value: "80"
- name: HEALTH_CHECK_PORT
value: "8080"
- name: DNS_SERVER
value: "10.0.0.10"
- name: MONGODB_FRONTEND_PORT
value: "27017"
- name: MONGODB_BACKEND_HOST
value: "mdb.default.svc.cluster.local"
- name: MONGODB_BACKEND_PORT
value: "27017"
- name: BIGCHAINDB_BACKEND_HOST
value: "bdb.default.svc.cluster.local"
- name: BIGCHAINDB_API_PORT
value: "9984"
- name: BIGCHAINDB_WS_PORT
value: "9985"
ports:
- containerPort: 27017
protocol: TCP
- containerPort: 8080
protocol: TCP
- containerPort: 80
protocol: TCP
resources:
limits:
cpu: 200m
memory: 768Mi
restartPolicy: Always