Skip to content

Commit 2e766a7

Browse files
ianbibbyGitHub Enterprise
authored andcommitted
Merge pull request prometheus-community#25 from reddit/infrared-v2-adoption
Infrared v2 adoption
2 parents f54f716 + d5bca75 commit 2e766a7

File tree

42 files changed

+2276
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2276
-107
lines changed

.drone.yml

Lines changed: 192 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
# Code imported by infragen. DO NOT EDIT.
3+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
14
# This file is used by the Drone CI Server and Agents to determine what
25
# should happen (if anything) in response to git pushes and pull requests.
36
# More info: https://reddit.atlassian.net/wiki/spaces/IO/pages/59113516/Drone+CI
@@ -29,6 +32,8 @@ steps:
2932
wavefront_token:
3033
from_secret: wavefront_token
3134
---
35+
# Code imported by infragen. DO NOT EDIT.
36+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
3237
kind: pipeline
3338
type: docker
3439
name: Publish
@@ -83,105 +88,238 @@ steps:
8388
- failure
8489
- success
8590
---
91+
# Code imported by infragen. DO NOT EDIT.
92+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
93+
kind: secret
94+
name: artifactory_bearer
95+
get:
96+
path: secret/artifactory/drone/token
97+
---
98+
# Code imported by infragen. DO NOT EDIT.
99+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
100+
kind: secret
101+
name: artifactory_password
102+
get:
103+
path: secret/artifactory/drone/password
104+
---
105+
# Code imported by infragen. DO NOT EDIT.
106+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
107+
kind: secret
108+
name: slack_token
109+
get:
110+
path: secret/drone/common/slack_token
111+
---
112+
# Code imported by infragen. DO NOT EDIT.
113+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
114+
kind: secret
115+
name: slack_webhook
116+
get:
117+
path: secret/drone/common/slack_webhook
118+
---
119+
# Code imported by infragen. DO NOT EDIT.
120+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
121+
kind: secret
122+
name: gate_password
123+
get:
124+
path: secret/drone/common/gate_password
125+
---
126+
# Code imported by infragen. DO NOT EDIT.
127+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
128+
kind: secret
129+
name: wavefront_token
130+
get:
131+
path: secret/drone/build/wavefront-token
132+
---
133+
# Code imported by infragen. DO NOT EDIT.
134+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
135+
# Made by spinnaker-to-drone-pipeline migration tool
136+
kind: secret
137+
name: core-prod-usva-aws-1-postgres-exporter
138+
get:
139+
path: secret/achilles/drone/core-prod-usva-aws-1/postgres-exporter
140+
---
141+
# Code imported by infragen. DO NOT EDIT.
142+
# This is a legacy snippet imported from 'infrared/legacydrone.yaml'. To change it, update that file and then run 'make generate'.
143+
# Made by spinnaker-to-drone-pipeline migration tool
144+
kind: secret
145+
name: drone_token
146+
get:
147+
path: secret/drone/build/drone_token
148+
---
149+
# Code generated by infragen. DO NOT EDIT.
150+
# Originated from:
151+
# RenderFor @ github.snooguts.net/reddit-go/infrared-generator/domains/infrared/infraenv.(*Environment)/environment.go:187
152+
# ApplyTo @ github.snooguts.net/reddit-go/infrared-domain-release-platform/releaseplatform/release.(*DroneDeployer)
153+
# build @ github.snooguts.net/reddit-go/infrared-domain-release-platform/releaseplatform/release.(*DroneDeployer)
154+
# addNotifyPipeline @ github.snooguts.net/reddit-go/infrared-domain-release-platform/releaseplatform/release.(*DroneDeployer)
86155
kind: pipeline
87156
type: docker
88-
name: Deploy
157+
name: notify deploy postgres-exporter to prod
89158
depends_on:
90159
- Publish
91160
trigger:
92-
event:
93-
- push
94161
branch:
95162
- master_reddit
163+
event:
164+
- push
96165
steps:
97-
# Made by spinnaker-to-drone-pipeline migration tool
98-
- name: Deploy to Production
99-
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/drone-plugin-deploy-notifier:latest
166+
- name: 'Notify #infra-storage-salon'
167+
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/drone-plugin-deploy-notifier:2.15.2
100168
pull: always
169+
environment:
170+
PLUGIN_SLACK_TOKEN:
171+
from_secret: slack-token_e9b25e
101172
depends_on:
102173
- clone
103-
when:
104-
branch:
105-
- master_reddit
106174
settings:
107-
notify_targets: postgres-exporter
175+
image_tag: ${DRONE_COMMIT_SHA}
176+
notify_targets:
177+
- prod
108178
slack_channel: infra-storage-salon
109-
slack_token:
110-
from_secret: slack_token
111179
---
112-
# Made by spinnaker-to-drone-pipeline migration tool
180+
# Code generated by infragen. DO NOT EDIT.
181+
# Originated from:
182+
# New @ github.snooguts.net/reddit-go/infrared-generator/domains/infrared/infraenv/environment.go:125
183+
# RenderFor @ github.snooguts.net/reddit-go/infrared-generator/domains/infrared/infraenv.(*Environment)
184+
# ApplyTo @ github.snooguts.net/reddit-go/infrared-domain-release-platform/releaseplatform/release.(*DroneDeployer)
185+
# build @ github.snooguts.net/reddit-go/infrared-domain-release-platform/releaseplatform/release.(*DroneDeployer)
113186
kind: pipeline
114187
type: docker
115-
name: 'Pipeline: Deploy'
188+
name: deploy postgres-exporter to prod
116189
node:
117190
deployment-pool: "true"
118191
trigger:
119192
event:
120193
- promote
121194
target:
122-
- postgres-exporter
195+
- prod
123196
concurrency:
124197
limit: 1
125198
steps:
126-
- name: Deploy Manifest - prod-3-ue1d
127-
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/drone-plugin-reddit-deploy:2
199+
- name: deploy to prod-3-d
200+
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/drone-plugin-reddit-deploy:2.15.10
128201
pull: always
202+
environment:
203+
PLUGIN_SLACK_TOKEN:
204+
from_secret: common slack token_f38f59
205+
SERVICE_ACCOUNT_TOKEN:
206+
from_secret: service account prod-3-d_postgres-exporter_f38f59
129207
depends_on:
130208
- clone
131209
settings:
132210
cluster: prod-3-d
133-
env: production
134-
image_tag: ${IMAGE_TAG}
135-
kustomize: infrared/deploy-to-production
211+
kustomize: .reddit/postgres-exporter/prod/configs
212+
kustomize_images:
213+
- artifactory.build.ue1.snooguts.net/reddit-docker-prod/postgres_exporter
136214
namespace: postgres-exporter
137-
service_account_token:
138-
from_secret: core-prod-usva-aws-1-postgres-exporter
139215
slack_channel: infra-storage-salon
140-
slack_token:
141-
from_secret: slack_token
142-
starlark: infrared/manifest.star
143-
timeout: 600
144-
token:
145-
from_secret: drone_token
146-
---
147-
kind: secret
148-
name: artifactory_bearer
149-
get:
150-
path: secret/artifactory/drone/token
216+
timeout: 10m0s
151217
---
152-
kind: secret
153-
name: artifactory_password
154-
get:
155-
path: secret/artifactory/drone/password
218+
# Code generated by infragen. DO NOT EDIT.
219+
# Originated from:
220+
# Generate @ github.snooguts.net/reddit/postgres_exporter/infrared/manifest.go:35
221+
# NewConfig @ github.snooguts.net/reddit-go/infrared-domain-renovate/renovate
222+
# NewValidationPipeline @ github.snooguts.net/reddit-go/infrared-domain-renovate/renovate
223+
kind: pipeline
224+
type: docker
225+
name: 'Renovate: Validate Configuration'
226+
trigger:
227+
event:
228+
- pull_request
229+
steps:
230+
- name: Validate config files
231+
image: artifactory.build.ue1.snooguts.net/dockerhub-remote/renovate/renovate:37
232+
pull: always
233+
depends_on:
234+
- clone
235+
commands:
236+
- renovate-config-validator ".github/renovate.json"
156237
---
157-
kind: secret
158-
name: slack_token
159-
get:
160-
path: secret/drone/common/slack_token
238+
# Code generated by infragen. DO NOT EDIT.
239+
# Originated from:
240+
# Generate @ github.snooguts.net/reddit/postgres_exporter/infrared/manifest.go:41
241+
# NewCodegenCheckPipeline @ github.snooguts.net/reddit-go/infrared-generator/domains/infrared/infraredci
242+
kind: pipeline
243+
type: docker
244+
name: Infrared v2
245+
trigger:
246+
event:
247+
- pull_request
248+
steps:
249+
- name: Check Infrared Codegen
250+
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/go-base:1.23.5
251+
pull: always
252+
environment:
253+
GOTOOLCHAIN: auto
254+
depends_on:
255+
- clone
256+
commands:
257+
- ""
258+
- '#************************************************************************************************#'
259+
- '# If you see a failure below, run ''make generate'' to rebuild your generated Infrared v2 configs: #'
260+
- '#************************************************************************************************#'
261+
- ""
262+
- |-
263+
if test -f "infrared/go.mod"; then
264+
go run -C infrared -mod=readonly github.snooguts.net/reddit-go/infrared-generator/cmd/infragen --dir ..
265+
elif test -f "internal/infrared/go.mod"; then
266+
go run -C internal/infrared -mod=readonly github.snooguts.net/reddit-go/infrared-generator/cmd/infragen --dir ../..
267+
else
268+
go run -mod=readonly github.snooguts.net/reddit-go/infrared-generator/cmd/infragen
269+
fi
270+
- git status; git diff
271+
- test -z "$(git status --porcelain)" || echo "!!! Run 'make generate' to rebuild your generated Infrared v2 configs !!!"
272+
- test -z "$(git status --porcelain)"
161273
---
162-
kind: secret
163-
name: slack_webhook
164-
get:
165-
path: secret/drone/common/slack_webhook
274+
# Code generated by infragen. DO NOT EDIT.
275+
# Originated from:
276+
# Generate @ github.snooguts.net/reddit/postgres_exporter/infrared/manifest.go:42
277+
# NewDeployPipeline @ github.snooguts.net/reddit-go/infrared-domain-achilles/achilles/achillesci
278+
kind: pipeline
279+
type: docker
280+
name: Achilles Deploy
281+
trigger:
282+
branch:
283+
- master_reddit
284+
event:
285+
- push
286+
steps:
287+
- name: 'Achilles: Sync Taxonomy Resources'
288+
image: artifactory.build.ue1.snooguts.net/reddit-docker-prod/drone-plugin-achilles-deploy:v0.1.3
289+
pull: always
290+
environment:
291+
SECRET_ORG_SERVICE_ACCOUNT_TOKEN:
292+
from_secret: org-deploy-token_6c9323
293+
depends_on:
294+
- clone
295+
settings:
296+
cluster: orch-1
297+
scope: repo
166298
---
299+
# Code generated by infragen. DO NOT EDIT.
167300
kind: secret
168-
name: gate_password
301+
name: slack-token_e9b25e
169302
get:
170-
path: secret/drone/common/gate_password
303+
path: secret/drone/common/slack_token
304+
name: value
171305
---
306+
# Code generated by infragen. DO NOT EDIT.
172307
kind: secret
173-
name: wavefront_token
308+
name: common slack token_f38f59
174309
get:
175-
path: secret/drone/build/wavefront-token
310+
path: secret/drone/common/slack_token
311+
name: value
176312
---
177-
# Made by spinnaker-to-drone-pipeline migration tool
313+
# Code generated by infragen. DO NOT EDIT.
178314
kind: secret
179-
name: core-prod-usva-aws-1-postgres-exporter
315+
name: service account prod-3-d_postgres-exporter_f38f59
180316
get:
181317
path: secret/achilles/drone/core-prod-usva-aws-1/postgres-exporter
318+
name: value
182319
---
183-
# Made by spinnaker-to-drone-pipeline migration tool
320+
# Code generated by infragen. DO NOT EDIT.
184321
kind: secret
185-
name: drone_token
322+
name: org-deploy-token_6c9323
186323
get:
187-
path: secret/drone/build/drone_token
324+
path: secret/drone/achilles-drone-plugin/org-deploy-token
325+
name: orch-1

.github/renovate.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"description": "Code generated by infragen. DO NOT EDIT.",
4+
"extends": [
5+
"local>reddit/renovate-config",
6+
"local>reddit/renovate-config//infrared_v2"
7+
],
8+
"ignorePaths": [
9+
"**/infrared/**/*.tf",
10+
"**/node_modules/**",
11+
"**/npm-offline-cache/**",
12+
"**/vendor/**",
13+
".drone.yml",
14+
".github/renovate.json",
15+
".reddit/**",
16+
"Makefile"
17+
]
18+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Code generated by infragen. DO NOT EDIT.
2+
apiVersion: backstage.io/v1alpha1
3+
kind: Component
4+
metadata:
5+
tier: 3
6+
description: A service for exporting Postgres server metrics to Prometheus.
7+
links:
8+
- url: https://reddit.atlassian.net/wiki/spaces/STOR/pages/2418017019/Aurora+Postgres
9+
title: Runbooks
10+
- url: https://kube-web-view.build.ue1.snooguts.net/clusters/prod-3-d/namespaces/postgres_exporter/pods
11+
title: Kube-web-view
12+
- url: https://reddit.slack.com/channels/infra-storage-salon
13+
title: Salon Channel
14+
tags:
15+
- storage
16+
- postgres
17+
- monitoring
18+
- prometheus
19+
pagerDutyServiceId: PD6D691
20+
supportSlackChannel: infra-storage
21+
kubernetesNamespace: postgres_exporter
22+
clusterGroups: prod-3
23+
grafanaTag: postgres
24+
name: postgres-exporter
25+
title: Postgres Exporter
26+
kubernetesId: postgres_exporter
27+
spec:
28+
lifecycle: production
29+
type: service
30+
owner: storage
31+
system: postgres-exporter

0 commit comments

Comments
 (0)