Created
July 4, 2019 18:12
-
-
Save efossas/2df7f20e73cb3aea183a8a856a985be7 to your computer and use it in GitHub Desktop.
Deployment Using Nginx Exporter In Istio Service Mesh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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