adding statsd deployment

parent e74982cd
......@@ -16,8 +16,25 @@ This only runs with `istioctl` version > 1.5
```
3. configure telegraf operator with `istio` class
> This depends on which output system you desider for the istio metrics
4. `kubectl apply -f istio.yml`
4. Create secret statsd metrics shipping
```yaml
apiVersion: v1
kind: Secret
metadata:
name: monitor
namespace: istio-system
stringData:
ENV: testing
MONITOR_BUCKET: istio
MONITOR_HOST_V2: https://us-west-2-1.aws.cloud2.influxdata.com/
MONITOR_ORG: my-best-organization-in-cloud2
MONITOR_TOKEN: xxxxxxxxxxxxxx
type: Opaque
```
5. `kubectl apply -f statsd.yml`
6. `kubectl apply -f istio.yml`
## Reference:
- https://istio.io/docs/reference/config/istio.operator.v1alpha1/
- https://istio.io/docs/ops/deployment/requirements/
......@@ -25,6 +25,7 @@ spec:
meshConfig:
trustDomain: cluster.local
enableTracing: true
statsdUdpAddress: "statsd.istio-system.svc:9125"
accessLogFile: "/dev/stdout"
accessLogEncoding: JSON
defaultConfig:
......@@ -99,11 +100,11 @@ spec:
k8s:
replicaCount: 1
podAnnotations:
telegraf.influxdata.com/port: "14010"
telegraf.influxdata.com/port: "15010"
telegraf.influxdata.com/class: "istio"
pilot:
enabled: true
k8s:
podAnnotations:
telegraf.influxdata.com/port: "14010"
telegraf.influxdata.com/port: "15010"
telegraf.influxdata.com/class: "istio"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: statsd
name: statsd
namespace: istio-system
spec:
ports:
- name: statsd
port: 9125
protocol: UDP
selector:
app: statsd
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: statsd
name: statsd
namespace: istio-system
spec:
replicas: 3
selector:
matchLabels:
app: statsd
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
labels:
app: statsd
spec:
containers:
- envFrom:
- secretRef:
name: monitor
image: telegraf:1.14
name: telegraf
ports:
- containerPort: 9125
name: stastd
protocol: UDP
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- mountPath: /etc/telegraf
name: telegraf-config
volumes:
- configMap:
name: telegraf-config-envoy-statsd
name: telegraf-statsd
---
apiVersion: v1
data:
telegraf.conf: |+
[[outputs.influxdb_v2]]
urls = ["$MONITOR_HOST_V2"]
token = "$MONITOR_TOKEN"
organization = "$MONITOR_ORG"
bucket = "$MONITOR_BUCKET"
timeout = "60s"
[global_tags]
env = "$ENV"
[[inputs.statsd]]
protocol = "udp"
service_address = ":9125"
[agent]
metric_batch_size = 1000
metric_buffer_limit = 10000
debug = false
[[inputs.internal]]
kind: ConfigMap
metadata:
labels:
app: statsd
name: telegraf-config-envoy-statsd
namespace: istio-system
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment