Skip to content

Commit 615c254

Browse files
ianbibbyGitHub Enterprise
authored andcommitted
Merge pull request prometheus-community#13 from reddit/bugfix-k8s-vpc-deployment
Patch K8s SPC yaml to re-use a specific role
2 parents f26da93 + fac5ef6 commit 615c254

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

infrared/manifest.star

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,27 @@ def patch_node_specialization(d):
182182
toleration.value = "prod-vpc"
183183

184184
patch_resources("apps", "v1", "deployment", patch_node_specialization, name = fullname)
185+
186+
#
187+
# Patching required because the deployments will create their own SPC's using the configured name.
188+
# This results in convention-based role names to exist, but we want to stick to a specific role name ("service_postgres_exporter").
189+
#
190+
spc_patch = """
191+
spec:
192+
parameters:
193+
objects: |
194+
- objectName: postgres-exporter.yaml
195+
secretPath: secret/postgres-exporter/config
196+
secretKey: current
197+
roleName: service_postgres_exporter
198+
provider: vault
199+
status: {}
200+
"""
201+
202+
patch_resources_yaml(
203+
"secrets-store.csi.x-k8s.io",
204+
"v1alpha1",
205+
"SecretProviderClass",
206+
name = "k8s-vpc-postgres-exporter-deployment-exporter-secrets",
207+
patch = spc_patch,
208+
)

0 commit comments

Comments
 (0)