Skip to content

Commit

Permalink
Add OSS prometheus exporter support
Browse files Browse the repository at this point in the history
* Added oss prometheus deployment manifest
* Added oss prometheus daemonset manifest
* Updated comparison document
* Updated install document
  • Loading branch information
Dean-Coakley committed Aug 27, 2018
1 parent 01a7db3 commit 7005576
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 2 deletions.
15 changes: 14 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,19 @@ For NGINX Plus, you can access the live activity monitoring dashboard:
## Support For Prometheus Monitoring
If you are using [Prometheus](https://prometheus.io/), you can deploy the NGINX Plus Ingress controller with the Prometheus exporter for NGINX Plus. The exporter will export NGINX Plus metrics into your Prometheus. To deploy the Ingress controller with the exporter, use the modified manifests:
If you are using [Prometheus](https://prometheus.io/), you can deploy the NGINX Ingress controller with the [Prometheus exporter](https://github.com/nginxinc/nginx-prometheus-exporter) for NGINX. The exporter will export NGINX metrics into your Prometheus.
To deploy the NGINX Ingress controller with the exporter, use the modified manifests:
* For a deployment, run:
```
$ kubectl apply -f deployment/nginx-ingress-with-prometheus.yaml
```
* For a daemonset, run:
```
$ kubectl apply -f daemon-set/nginx-ingress-with-prometheus.yaml
```
To deploy the NGINX Plus Ingress controller with the exporter, use the modified manifests:
* For a deployment, run:
```
$ kubectl apply -f deployment/nginx-plus-ingress-with-prometheus.yaml
Expand All @@ -182,3 +194,4 @@ Delete the `nginx-ingress` namespace to uninstall the Ingress controller along w
```
$ kubectl delete namespace nginx-ingress
```
2 changes: 1 addition & 1 deletion docs/nginx-ingress-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The table below summarizes the key difference between nginxinc/kubernetes-ingres
| **Operational** |
| Reporting the IP address(es) of the Ingress controller into Ingress resources | Supported | Supported | Supported |
| Extended Status | Supported via a third-party module | Not supported | Supported |
| Prometheus Integration | Supported | Not supported | Supported |
| Prometheus Integration | Supported | Supported | Supported |
| Dynamic reconfiguration of endpoints (no configuration reloading) | Supported with a third-party Lua module | Not supported | Supported |

Notes:
Expand Down
55 changes: 55 additions & 0 deletions install/daemon-set/nginx-ingress-with-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nginx-ingress
namespace: nginx-ingress
spec:
selector:
matchLabels:
app: nginx-ingress
template:
metadata:
labels:
app: nginx-ingress
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9113"
spec:
serviceAccountName: nginx-ingress
containers:
- image: nginx/nginx-ingress:1.3.0
name: nginx-ingress
ports:
- name: http
containerPort: 80
hostPort: 80
- name: https
containerPort: 443
hostPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
args:
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -v=3 # Enables extensive logging. Useful for trooublshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
- image: nginx/nginx-prometheus-exporter:0.1.0
name: nginx-prometheus-exporter
ports:
- name: prometheus
containerPort: 9113
args:
- -web.listen-address
- :9113
- -nginx.scrape-uri
- http://127.0.0.1:8080/stub_status

54 changes: 54 additions & 0 deletions install/deployment/nginx-ingress-with-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress
namespace: nginx-ingress
spec:
replicas: 1
selector:
matchLabels:
app: nginx-ingress
template:
metadata:
labels:
app: nginx-ingress
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9113"
spec:
serviceAccountName: nginx-ingress
containers:
- image: nginx/nginx-ingress:1.3.0
name: nginx-ingress
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
args:
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -v=3 # Enables extensive logging. Useful for trooublshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
- image: nginx/nginx-prometheus-exporter:0.1.0
name: nginx-prometheus-exporter
ports:
- name: prometheus
containerPort: 9113
args:
- -web.listen-address
- :9113
- nginx.scrape-uri
- http://127.0.0.1:8080/stub_status

0 comments on commit 7005576

Please sign in to comment.