Skip to content

Instantly share code, notes, and snippets.

@efossas
Created July 4, 2019 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efossas/2df7f20e73cb3aea183a8a856a985be7 to your computer and use it in GitHub Desktop.
Save efossas/2df7f20e73cb3aea183a8a856a985be7 to your computer and use it in GitHub Desktop.
Deployment Using Nginx Exporter In Istio Service Mesh
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ${YOU DEPLOYMENT}
namespace: ${YOUR NAMESPACE}
labels:
app: ${YOUR APP NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ${YOUR APP NAME}
template:
metadata:
labels:
app: ${YOUR APP NAME}
annotations:
# these annotations tell prometheus it should scrape metrics from the node exporter
prometheus.io/scrape: "true"
prometheus.io/port: "9113"
prometheus.io/path: "/metrics"
# these annotations make istio/envoy only handle traffic for your nginx server, not the nginx exporter
traffic.sidecar.istio.io/includeInboundPorts: "80"
traffic.sidecar.istio.io/excludeOutboundIPRanges: "0.0.0.0/0"
spec:
containers:
- name: ${YOUR APP NAME}
image: ${YOUR APP IMAGE}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
- containerPort: 8080
- name: nginx-exporter
image: nginx/nginx-prometheus-exporter:0.4.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment