Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for prometheus for Plus #249

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ For NGINX Plus, you can access the live activity monitoring dashboard:
```
1. Open your browser at http://127.0.0.1:8080/dashboard.html to access the 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:
* For a deployment, run:
```
$ kubectl apply -f deployment/nginx-plus-ingress-with-prometheus.yaml
```
* For a daemon set, run:
```
$ kubectl apply -f daemon-set/nginx-plus-ingress-with-prometheus.yaml
```

**Note**: this is a preview version of the prometheus exporter for NGINX Plus. It is not suitable for using in production environments.

## Uninstall the Ingress Controller

Delete the `nginx-ingress` namespace to uninstall the Ingress controller along with all the auxiliary resources that were created:
Expand Down
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 | Coming soon | Coming soon |
| Extended Status | Supported via a third-party module | Not supported | Supported |
| Prometheus Integration | Supported | Not supported | Coming soon |
| Prometheus Integration | Supported | Not supported | Supported |
| Dynamic reconfiguration of endpoints (no configuration reloading) | Not supported | Not supported | Supported |

Notes:
Expand Down
46 changes: 46 additions & 0 deletions install/daemon-set/nginx-plus-ingress-with-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: "8090"
spec:
serviceAccountName: nginx-ingress
containers:
- image: nginx-plus-ingress:1.1.1
name: nginx-plus-ingress
ports:
- name: http
containerPort: 80
hostPort: 80
- name: https
containerPort: 443
hostPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- -nginx-plus
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -v=3 # Enables extensive logging. Useful for trooublshooting.
- image: nginxdemos/nginxplus-prometheus-exporter:0.1.0
name: nginxplus-prometheus-exporter
args:
- -listen-address
- :8090
- -plus
- -metric-endpoint
- http://127.0.0.1:8080/api
45 changes: 45 additions & 0 deletions install/deployment/nginx-plus-ingress-with-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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: "8090"
spec:
serviceAccountName: nginx-ingress
containers:
- image: nginx-plus-ingress:1.1.1
name: nginx-plus-ingress
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- -nginx-plus
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -v=3 # Enables extensive logging. Useful for trooublshooting.
- image: nginxdemos/nginxplus-prometheus-exporter:0.1.0
name: nginxplus-prometheus-exporter
args:
- -listen-address
- :8090
- -plus
- -metric-endpoint
- http://127.0.0.1:8080/api