Add PostgreSQL pod name Scalyr sidecar environment (#194)

This will allow the Scalyr image to add a custom attribute to shipped
log entries that notes the name of the originating pod.
This commit is contained in:
Manuel Gómez
2017-12-21 16:52:27 +01:00
committed by GitHub
parent 15c278d4e8
commit cd9bc7bdc5
+9
View File
@@ -445,6 +445,15 @@ func (c *Cluster) generatePodTemplate(
Resources: *resourceRequirementsScalyrSidecar,
VolumeMounts: volumeMounts,
Env: []v1.EnvVar{
{
Name: "POD_NAME",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{
APIVersion: "v1",
FieldPath: "metadata.name",
},
},
},
{
Name: "SCALYR_API_KEY",
Value: c.OpConfig.ScalyrAPIKey,