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 Statsd prometheus exporter to sandbox deployment #165

Closed
wants to merge 4 commits into from
Closed
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
75 changes: 73 additions & 2 deletions deployment/sandbox/flyte_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ kind: Namespace
metadata:
name: sparkoperator
---
apiVersion: v1
kind: Namespace
metadata:
name: statsagent
spec:
finalizers:
- kubernetes
status:
phase: Active
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -634,9 +644,10 @@ data:
- FLYTE_AWS_ENDPOINT: "http://minio.flyte:9000"
- FLYTE_AWS_ACCESS_KEY_ID: minio
- FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage
- FLYTE_STATSD_HOST: stats.statsagent
kind: ConfigMap
metadata:
name: flyte-plugin-config-b525btf774
name: flyte-plugin-config-h7t6tbcf22
namespace: flyte
---
apiVersion: v1
Expand Down Expand Up @@ -861,6 +872,21 @@ spec:
app: contour
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: stats
namespace: statsagent
spec:
clusterIP: None
ports:
- name: udp
port: 8125
protocol: UDP
targetPort: 9125
selector:
app: stats
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -1169,7 +1195,7 @@ spec:
name: flyte-propeller-config-55gc695955
name: config-volume
- configMap:
name: flyte-plugin-config-b525btf774
name: flyte-plugin-config-h7t6tbcf22
name: plugin-config-volume
---
apiVersion: apps/v1
Expand Down Expand Up @@ -1457,6 +1483,51 @@ spec:
name: config-volume
schedule: '*/1 * * * *'
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: stats
name: stats
namespace: statsagent
spec:
selector:
matchLabels:
app: stats
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9102"
prometheus.io/scrape: "true"
labels:
app: stats
app.kubernetes.io/name: statsdagent
app.kubernetes.io/version: latest
spec:
containers:
- image: docker.io/prom/statsd-exporter:latest
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- sleep
- "300"
name: exporter
ports:
- containerPort: 9125
- containerPort: 9102
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: 200m
memory: 500Mi
restartPolicy: Always
terminationGracePeriodSeconds: 30
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
Expand Down
74 changes: 74 additions & 0 deletions kustomize/base/statsd-exporter/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Namespace
apiVersion: v1
kind: Namespace
metadata:
name: statsagent
spec:
finalizers:
- kubernetes
status:
phase: Active
---
# Service
apiVersion: v1
kind: Service
metadata:
name: stats
namespace: statsagent
spec:
clusterIP: None
ports:
- name: udp
protocol: UDP
port: 8125
targetPort: 9125
selector:
app: stats
---

# Create a deamonSet so that a pod is created on every node that joins the cluster and garbage colleter
# from nodes that leave the cluster
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: stats
namespace: statsagent
labels:
app: stats
spec:
selector:
matchLabels:
app: stats
template:
metadata:
labels:
app: stats
app.kubernetes.io/name: statsdagent
app.kubernetes.io/version: latest
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9102"
prometheus.io/path: "/metrics"
spec:
restartPolicy: Always
terminationGracePeriodSeconds: 30
containers:
- name: exporter
image: docker.io/prom/statsd-exporter:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9125
- containerPort: 9102
lifecycle:
preStop:
exec:
command:
- sleep
- "300"
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: "200m"
memory: 500Mi
2 changes: 2 additions & 0 deletions kustomize/base/statsd-exporter/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- daemonset.yaml
1 change: 1 addition & 0 deletions kustomize/overlays/sandbox/flyte/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bases:
# global resources
- ../../../base/namespace
- ../../../base/statsd-exporter
- ../../../dependencies/database
- ../../../dependencies/storage

Expand Down
1 change: 1 addition & 0 deletions kustomize/overlays/sandbox/propeller/plugins/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ plugins:
- FLYTE_AWS_ENDPOINT: "http://minio.flyte:9000"
- FLYTE_AWS_ACCESS_KEY_ID: minio
- FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage
- FLYTE_STATSD_HOST: stats.statsagent