Skip to content

Commit cd9bc7b

Browse files
authored
Add PostgreSQL pod name Scalyr sidecar environment (zalando#194)
This will allow the Scalyr image to add a custom attribute to shipped log entries that notes the name of the originating pod.
1 parent 15c278d commit cd9bc7b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/cluster/k8sres.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,15 @@ func (c *Cluster) generatePodTemplate(
445445
Resources: *resourceRequirementsScalyrSidecar,
446446
VolumeMounts: volumeMounts,
447447
Env: []v1.EnvVar{
448+
{
449+
Name: "POD_NAME",
450+
ValueFrom: &v1.EnvVarSource{
451+
FieldRef: &v1.ObjectFieldSelector{
452+
APIVersion: "v1",
453+
FieldPath: "metadata.name",
454+
},
455+
},
456+
},
448457
{
449458
Name: "SCALYR_API_KEY",
450459
Value: c.OpConfig.ScalyrAPIKey,

0 commit comments

Comments
 (0)