Skip to content

Commit

Permalink
Add PostgreSQL pod name Scalyr sidecar environment
Browse files Browse the repository at this point in the history
This will allow the Scalyr image to add a custom attribute to shipped
log entries that notes the name of the originating pod.
  • Loading branch information
Manuel Gómez committed Dec 21, 2017
1 parent 15c278d commit 3f76597
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cluster/k8sres.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3f76597

Please sign in to comment.