Skip to content

Commit 0231e7e

Browse files
author
Lars Maier
authored
Added MY_NODE_NAME and NODE_NAME envs for all pods. (#349)
1 parent 7338c5e commit 0231e7e

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

pkg/util/constants/constants.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
package constants
2424

2525
const (
26-
EnvOperatorNodeName = "MY_NODE_NAME"
27-
EnvOperatorPodName = "MY_POD_NAME"
28-
EnvOperatorPodNamespace = "MY_POD_NAMESPACE"
29-
EnvOperatorPodIP = "MY_POD_IP"
26+
EnvOperatorNodeName = "MY_NODE_NAME"
27+
EnvOperatorNodeNameArango = "NODE_NAME"
28+
EnvOperatorPodName = "MY_POD_NAME"
29+
EnvOperatorPodNamespace = "MY_POD_NAMESPACE"
30+
EnvOperatorPodIP = "MY_POD_IP"
3031

3132
EnvArangoLicenseKey = "ARANGO_LICENSE_KEY" // Contains the License Key for the Docker Image
3233
EnvArangodJWTSecret = "ARANGOD_JWT_SECRET" // Contains JWT secret for the ArangoDB cluster

pkg/util/k8sutil/pods.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,22 @@ func newLifecycle() (*v1.Lifecycle, []v1.EnvVar, []v1.Volume, error) {
360360
},
361361
},
362362
},
363+
v1.EnvVar{
364+
Name: constants.EnvOperatorNodeName,
365+
ValueFrom: &v1.EnvVarSource{
366+
FieldRef: &v1.ObjectFieldSelector{
367+
FieldPath: "spec.nodeName",
368+
},
369+
},
370+
},
371+
v1.EnvVar{
372+
Name: constants.EnvOperatorNodeNameArango,
373+
ValueFrom: &v1.EnvVarSource{
374+
FieldRef: &v1.ObjectFieldSelector{
375+
FieldPath: "spec.nodeName",
376+
},
377+
},
378+
},
363379
}
364380
vols := []v1.Volume{
365381
v1.Volume{

0 commit comments

Comments
 (0)