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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

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,