@@ -63,3 +63,105 @@ def project_name_from_project_dir(dirname: str):
6363prometheus_chart = helm .Chart (release_name = 'prometheus' ,
6464 config = chart_ops ,
6565 opts = pulumi .ResourceOptions (provider = k8s_provider ))
66+
67+ #
68+ # Deploy the statsd collector
69+ #
70+
71+ statsd_chart_values = {
72+ "replicaCount" : 1 ,
73+ "image" : {
74+ "repository" : "prom/statsd-exporter" ,
75+ "pullPolicy" : "IfNotPresent" ,
76+ "tag" : "v0.20.0"
77+ },
78+ "imagePullSecrets" : [],
79+ "nameOverride" : "" ,
80+ "fullnameOverride" : "" ,
81+ "statsd" : {
82+ "udpPort" : 9125 ,
83+ "tcpPort" : 9125 ,
84+ "cacheSize" : 1000 ,
85+ "eventQueueSize" : 10000 ,
86+ "eventFlushThreshold" : 1000 ,
87+ "eventFlushInterval" : "200ms"
88+ },
89+ "serviceMonitor" : {
90+ "enabled" : False ,
91+ "interval" : "30s" ,
92+ "scrapeTimeout" : "10s" ,
93+ "namespace" : "monitoring" ,
94+ "honorLabels" : False ,
95+ "additionalLabels" : {}
96+ },
97+ "serviceAccount" : {
98+ "create" : True ,
99+ "annotations" : {},
100+ "name" : ""
101+ },
102+ "podAnnotations" : {
103+ "prometheus.io/scrape" : "true" ,
104+ "prometheus.io/port" : "9102"
105+ },
106+ "podSecurityContext" : {},
107+ "securityContext" : {},
108+ "service" : {
109+ "type" : "ClusterIP" ,
110+ "port" : 9102 ,
111+ "path" : "/metrics" ,
112+ "annotations" : {}
113+ },
114+ "ingress" : {
115+ "enabled" : False ,
116+ "annotations" : {},
117+ "hosts" : [
118+ {
119+ "host" : "chart-example.local" ,
120+ "paths" : []
121+ }
122+ ],
123+ "tls" : []
124+ },
125+ "resources" : {},
126+ "autoscaling" : {
127+ "enabled" : False ,
128+ "minReplicas" : 1 ,
129+ "maxReplicas" : 100 ,
130+ "targetCPUUtilizationPercentage" : 80
131+ },
132+ "nodeSelector" : {},
133+ "tolerations" : [],
134+ "affinity" : {},
135+ "annotations" : {
136+ "prometheus.io/scrape" : "true" ,
137+ "prometheus.io/port" : "9102"
138+ }
139+ }
140+
141+ config = pulumi .Config ('prometheus' )
142+ statsd_chart_name = config .get ('statsd_chart_name' )
143+ if not statsd_chart_name :
144+ statsd_chart_name = 'prometheus-statsd-exporter'
145+ statsd_chart_version = config .get ('statsd_chart_version' )
146+ if not statsd_chart_version :
147+ statsd_chart_version = '0.3.1'
148+ helm_repo_name = config .get ('prometheus_helm_repo_name' )
149+ if not helm_repo_name :
150+ helm_repo_name = 'prometheus-community'
151+ helm_repo_url = config .get ('prometheus_helm_repo_url' )
152+ if not helm_repo_url :
153+ helm_repo_url = 'https://prometheus-community.github.io/helm-charts'
154+
155+ statsd_chart_ops = helm .ChartOpts (
156+ chart = statsd_chart_name ,
157+ namespace = ns .metadata .name ,
158+ repo = helm_repo_name ,
159+ fetch_opts = FetchOpts (repo = helm_repo_url ),
160+ version = statsd_chart_version ,
161+ values = statsd_chart_values ,
162+ transformations = [remove_status_field ]
163+ )
164+
165+ statsd_chart = helm .Chart (release_name = 'statsd' ,
166+ config = statsd_chart_ops ,
167+ opts = pulumi .ResourceOptions (provider = k8s_provider ))
0 commit comments